- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Judith Ward (Intel) wrote:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, you are right. Thank you.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page