http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10618
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEW CC| |manu at gcc dot gnu.org --- Comment #7 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2011-09-21 14:39:29 UTC --- (In reply to comment #5) > The second part (the non-template case) of the bug is already fixed in 3.5.0: > pr10618.cc:15: error: `k' in class `B' does not name a type I would say it got broken again (GCC 4.5.2) test.cc:12:1: error: need ‘typename’ before ‘A<T>::k’ because ‘A<T>’ is a dependent scope test.cc:14:6: error: expected constructor, destructor, or type conversion before ‘func2’ If one adds the typename as suggested, it gets better but the first part is not even reported: test.cc:14:1: error: ‘k’ in class ‘B’ does not name a type Clang gives the correct output: /tmp/webcompile/_10395_0.cc:12:1: error: missing 'typename' prior to dependent type name 'A<T>::k' A<T>::k func1(); ^~~~~~~ typename /tmp/webcompile/_10395_0.cc:14:4: error: no type named 'k' in 'B' B::k func2(); ~~~^ 2 errors generated.