- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
here is another code snippet which does not compile with ICC (version 14.0.2 on Linux) but does compile with GCC and Clang:
template<int N, bool B> struct A; template<int N> struct A<N,false> { template<int M> struct Nested {}; }; template<int N> struct A<N,true> : public A<N,false> {}; template struct A<1,true>::Nested<2>; // explicit instantiation
The error message is:
$ icpc -c -std=c++11 testcase.cc testcase.cc(17): error: invalid qualifier for "A<1, false>::Nested<2>" (a derived class is not allowed here) template struct A<1,true>::Nested<2>; ^ compilation aborted for testcase.cc (code 2)
I got some help with this code snippet on stackoverflow.com (c.f. http://stackoverflow.com/q/22479641/1132850) and believe this is a compiler bug.
Note that instantiating an object instead of explicit instantiation does compile:
void foo() { A<1,true>::Nested<2>(); }
Best regards
Raimar
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is a simpler snippet to reproduce the problem:
template<int N> struct A { template<int M> struct Nested {}; }; template<int N> struct B : public A<N> {}; template struct B<1>::Nested<2>;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Raimer,
I have reproduced as you said ,and have entered this issue into our problem-tracking database.Thank you for submitting the issue.I'll get this posted whenever I have an update from development team.
Thank you.
--
QIAOMINQ.
Intel Developer Support
Please participate in our redesigned community support web site:
User forums: http://software.intel.com/en-us/forums/

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