http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57887
Bug ID: 57887 Summary: nested non-type template parameters not declared in this scope Product: gcc Version: 4.8.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: plasmahh at gmx dot net Hi, when trying to compile the following: struct B { template<int N> struct A { int X = N; }; }; I get the error: g.cxx:6:11: error: 'N' was not declared in this scope Things work fine when I make X a static const(expr), or when I move A outside B. The above code however works fine within clang, and I could not find any wording that would make N suddenly not being available within A, especially since when you add teh following member function to A (but remove X), it compiles fine: void foo( ) { int x = N; } so it /somehow/ is in scope.