this example is from N4527 14.7.3[temp.expl.spec]/5, a little bit of change.
template<class T>
struct A {
struct B{};
};
template<> struct A<char>::B{
void f();
struct C;
struct D{}; // ok
};
void A<char>::B::f(){}// ok in gcc5.1.0 and clang3.6.0
struct A<char>::B::C{};// error in gcc5.1.0, ok in clang3.6.0
int main()
{
return 0;
}
I think it is a bug, I have reported. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67402
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.