[Bug c++/40901] Access qualifiers of embedded templates are discarded
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901 Jonathan Wakely 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 --- 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 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 > struct A::s’ is private within this context int i = A::s<10>::value; ^ a.cc:2:25: note: declared private here template struct s { ^ And comment 3 now gives: a.cc:12:1: error: ‘struct C::Private’ is private within this context exploit::type x2; // should be an error ^~~ a.cc:3:10: note: declared private here struct Private { }; ^~~
[Bug c++/40901] Access qualifiers of embedded templates are discarded
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901 --- Comment #4 from Jonathan Wakely 2011-01-18 15:11:05 UTC --- (In reply to comment #3) > access control isn't done for a nested-name-specifier sorry, should be "... for arguments in a template-id in a nested-name-specifier"
[Bug c++/40901] Access qualifiers of embedded templates are discarded
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901 Jonathan Wakely changed: What|Removed |Added Keywords||accepts-invalid --- Comment #3 from Jonathan Wakely 2011-01-18 15:07:56 UTC --- access control isn't done for a nested-name-specifier class C { struct Private { }; }; template struct exploit { typedef T type; }; exploit::type x2; // should be an error
[Bug c++/40901] Access qualifiers of embedded templates are discarded
--- Comment #2 from bangerth at gmail dot com 2009-08-25 14:04 --- Confirmed: - class A { template struct s { enum { value }; }; }; int i = A::s<10>::value; - This should produce an error but doesn't. W. -- bangerth at gmail dot com changed: What|Removed |Added CC||bangerth at gmail dot com Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 Last reconfirmed|-00-00 00:00:00 |2009-08-25 14:04:38 date|| http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901
[Bug c++/40901] Access qualifiers of embedded templates are discarded
--- Comment #1 from jwakely dot gcc at gmail dot com 2009-07-29 11:01 --- looks similar to bug 40843 but I'm not sure if it's the same -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40901