https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Last reconfirmed|2012-02-01 00:00:00 | Resolution|--- |FIXED Target Milestone|--- |4.9.0 --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> --- This seems to have been fixed for 4.9.0 Comment 1 now gives: a.cc: In function ‘int main()’: a.cc:17:11: error: ‘template<long unsigned int y> struct A::s’ is private within this context cout << A::s<10>::value << endl; ^ a.cc:7:10: note: declared private here struct s { ^ Comment 2 now gives: a.cc:7:9: error: ‘template<int <anonymous> > struct A::s’ is private within this context int i = A::s<10>::value; ^ a.cc:2:25: note: declared private here template <int> struct s { ^ And comment 3 now gives: a.cc:12:1: error: ‘struct C::Private’ is private within this context exploit<C::Private>::type x2; // should be an error ^~~~~~~~~~~~~~~~~~~ a.cc:3:10: note: declared private here struct Private { }; ^~~~~~~