typedef, class template and inheritance

Gabriel Dos Reis Gabriel.Dos-Reis@dptmaths.ens-cachan.fr
Sat Oct 4 14:23:00 GMT 1997


>>>>> «Jason», Jason Merrill <jason@cygnus.com> wrote:

>>>>> Gabriel Dos Reis <Gabriel.Dos-Reis@dptmaths.ens-cachan.fr> writes:
>> From my reading of Bjarne's 3rd edition "The C++ Progamming
>> Language", I understand that the keyword typename is required when the
>> type is a _parameter_ (the compiler is not psychic to figure out
>> whether fred_t is a type name or not).

Jason> Nope, it's required whenever the type *depends on* a template parameter, as
Jason> foo<T, T> does.  That g++ accepts the code at all is an extension; you have
Jason> found a bug in that extension.


So here goes a question: is code listed in Bjarne's book (page 557)
illegal? He said his code is pure C++ and get compiled.

-- Gaby



More information about the Gcc-bugs mailing list