[Bug c++/45002] Name of member class of template class cannot be used as argument type.

redi at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Jul 21 17:12:00 GMT 2010



------- Comment #6 from redi at gcc dot gnu dot org  2010-07-21 17:11 -------
(In reply to comment #5)
> 
> OK, adding `typename::' fixed the problem with the compiler

That should be just typename, it's not a namespace.  When the standard says
"qualified with typename" it means "typename T::A" not "typename::T::A"

The latter is parsed as "typename ::T::A" i.e. "T::A" in the global namespace,
which you're telling the compiler is a type



> balking at the template function definition, but now
> the compiler accepts the definition and then appears
> to forget it, so it cannot be used.  Test code below:
> see first commented line.
> // The following definition is accepted BUT then
> // appears to be `forgotten' so it cannot be used.
> //
> template < typename T >
> int funcC ( typename::B<T>::C * c ) { return 0; }

T is in a non-deduced context here, see
http://www.advogato.org/person/redi/diary/185.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45002



More information about the Gcc-bugs mailing list