------- Comment #8 from walton at seas dot harvard dot edu 2010-07-21 17:35 ------- Subject: Re: Name of member class of template class cannot be used as argument type.
Oh, I see. You are just telling me that the '::' will be interpreted as a global namespace indicator. In the case of the test code everything is in the global namespace so it has no effect, but in other cases it might have an effect. I still would like to know if this is a bug and I need to do the workaround. Bob On Wed, 21 Jul 2010, Bob Walton wrote: > > Replacing '::' with ' ' does not change the error message. I don't > think you are right about the compiler mistaking `typename' for a namespace; > there is no way to test this as `namespace typename { ... }' is rejected by > the compiler. > > Bob > > On Wed, 21 Jul 2010, redi at gcc dot gnu dot org wrote: > >> >> >> ------- 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 >> >> ------- You are receiving this mail because: ------- >> You reported the bug, or are watching the reporter. >> > -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45002