This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21783] No typename required when type use in a function
- From: "florent dot gallet at orange dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2005 15:23:36 -0000
- Subject: [Bug c++/21783] No typename required when type use in a function
- References: <20050527143655.21783.florent.gallet@orange.fr>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From florent dot gallet at orange dot fr 2005-05-27 15:23 -------
Tested with VC++ 2003:
SansNom1.cpp(7) : warning C4346: 'A<T>::B' : dependent name is not a type
prefix with 'typename' to indicate a type
SansNom1.cpp(9) : see reference to class template instantiation 'A<T>'
being compiled
SansNom1.cpp(7) : error C2061: syntax error : identifier 'B'
Code used:
7. template<class T> struct A {
8. typedef int B;
9. void f(A::B); // illformed: typename required before A::B
10. // A::B b; // ok error detected
11. };
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21783