Suspected template parsing bug.

Alexandre Oliva oliva@dcc.unicamp.br
Mon Mar 1 09:02:00 GMT 1999


On Feb 28, 1999, Paul Derbyshire <pderbysh@usa.net> wrote:

> At 10:15 PM 2/27/99 -0500, you wrote:
>> If X::rebind is fashioned in the same vein as std::allocator<T>::rebind<U>,
>> then you must qualify it with the 'template' keyword.
>> 
>> ... typename X::template rebind< ....

> 1. Not according to Stroustrup 3rd Ed, aka 'source'.

Sorry, Stroustrup is ``wrong''.  The C++ Standard requires both
typename and template in this case.

> 2. The code in question compiles once I fix the real error, which is
>    that "math_traits" wasn't in scope.

Even with -ansi -pedantic?  It should reject the code in this case.

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil



More information about the Gcc mailing list