gcc-2.95.1 pedantic bug? some map template does not work within template function

Alexandre Oliva oliva@dcc.unicamp.br
Tue Aug 31 22:45:00 GMT 1999


On Aug 31, 1999, AJRobb@bigfoot.com wrote:

>   // -pedantic complains if the first form of typedef is used above
>   typedef DescMap::const_iterator DescIterator;

And it's correct, because the C++ Standard requires template-dependent
qualified names (and DescMap = map<X,Y> is template-dependent) to be
preceded by the `typename' keyword:

    typedef typename DescMap::const_iterator DescIterator;
            ^^^^^^^^

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{dcc.unicamp.br,guarana.{org,com}} aoliva@{acm.org,computer.org}
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them



More information about the Gcc-bugs mailing list