Opened from comment 4 in PR29727. The following valid snipped is rejected with the current mainline === template<int> struct A { struct S { int X; }; static S a; }; template<int N> typename A<N>::S A<N>::a = { X : 1 }; void foo() { A<0>::a; } === because 'X' is not found in the designated initializer: [...] pr29727_valid.C:18: error: 'Y' was not declared in this scope pr29727_valid.C:18: error: 'B<0>::S' has no non-static data member named '<declaration error>' We get the same with 4.0.1, 4.2.1 and the 4.3 branch. I don't have any earlier version to check, so I don't know if this is a regression or not. With a non template class, the code is accepted.
Confirmed (also by Paolo in PR29727). This is rejected since at least GCC 2.95.3.
Another Dup. *** This bug has been marked as a duplicate of bug 57041 ***