STLport build error

STLport build error

Greetings,

Env: Win 8.1 x64, MSVC 2013, ICC 14 (latest up-to-date), but the issue is manifesting on beta ICC 15 as well.

I get this error for this code:

namespace detail {

template <class _Tp, class... _Args>
struct __is_constructible
{
  private:
    template <class _Up, class... _UpArgs>
    static typename remove_reference<decltype(_Up( declval<_UpArgs>()... ), declval<true_type>())>::type __test(int);

    template <class, class...>
    static false_type __test(...);    
  public:
#ifdef _STLP_STATIC_CONST_INIT_BUG
    static const bool __value;
#else
    static const bool __value = is_same<decltype(__test<_Tp, _Args...>(0)),true_type>::value;
#endif
};

} // namespace detail

--- snip---

1>stlport\type_traits(908): error : expected an identifier
1>        public integral_constant<bool, detail::__is_constructible<_Tp,_Args...>::__value>
1>                                               ^

"__is_constructible" is indeed in its own namespace scope ("detail"). But when I change struct name to e.g. "__is_constructibleX" it compiles fine.

IMHO there is some problem with namespace resolution in ICC 14 & 15.

PS: did anyone reading this have successful build of STLport at MSVC 2013 && ICC 14/15 ? Any advice is very welcome!

-- With best regards, VooDooMan - If you find my post helpful, please rate it and/or select it as a best answer where applies. Thank you.
7 posts / 0 nouveau(x)
Dernière contribution
Reportez-vous à notre Notice d'optimisation pour plus d'informations sur les choix et l'optimisation des performances dans les produits logiciels Intel.

 

MSVC++ 2013 (and Intel) have implemented the __is_constructible compiler hook to implement the std::is_constructible type trait (i.e. __is_constructible is a built-in keyword). Thus an implementation cannot reuse it as an identifier.

See:http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20131209/095417.html

Actually I'm surprised you're not seeing an error on the declaration of the struct, i.e.:

!% cat p.cpp

struct __is_constructible {};

!% cl -c p.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 18.00.21005.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

p.cpp
p.cpp(2) : error C2332: 'struct' : missing tag name
p.cpp(2) : error C2143: syntax error : missing ';' before '__is_constructible'
p.cpp(2) : error C2059: syntax error : '__is_constructible'
p.cpp(2) : error C2143: syntax error : missing ';' before '{'
p.cpp(2) : error C2447: '{' : missing function header (old-style formal list?)

Judy

Greetings,

As I am beta-tester of ICC 15, at premier support Reddy told me that it seems to be a built-in keyword which cannot be used as an identifier.

Is there some URL with a full list of internal keywords? I did some googling, but I did not find such list.

TIA!

-- With best regards, VooDooMan - If you find my post helpful, please rate it and/or select it as a best answer where applies. Thank you.
Best Reply

 

No but all identifiers that start with two underscores or an underscore followed by a capital letter are reserved to the implementation.

In this case the STLPort library implementation is using the same reserved identifier that recent versions of the Microsoft compiler have started using.

http://en.cppreference.com/w/cpp/keyword

Judy

Citation :

Judith Ward (Intel) a écrit :

No but all identifiers that start with two underscores or an underscore followed by a capital letter are reserved to the implementation.

Yes, I am aware of that, but there is no capital letter after 2 underscores.

-- With best regards, VooDooMan - If you find my post helpful, please rate it and/or select it as a best answer where applies. Thank you.

 

I don't think you read the rules correctly:

> Also, each name that contains a double underscore __ or begins with an underscore followed by an uppercase letter is always reserved to the > implementation and should not be used as an identifier.

Notice the "or". Any name that begins with a double underscore is reserved no matter what comes after it. Also any name that with a single underscore followed by a capital letter is reserved.

Judy

 

Oh, you are right. Thank you.

-- With best regards, VooDooMan - If you find my post helpful, please rate it and/or select it as a best answer where applies. Thank you.

Connectez-vous pour laisser un commentaire.