This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

-pedantic and typename


I noticed that the current CVS snapshot generates a warning followed by
an error for the following

---------- snipedee-snip ----------
#include <vector.h>

template <class T>
class NAMESTABLE
    {
    typedef /*typename*/ vector<T>::iterator iterator;
    };
---------- snipedee-snip ----------

when -pedantic is used, but compiles fine without pedantic.

x.cc:6: warning: ANSI C++ forbids typedef which does not specify a type
x.cc:6: cannot declare member `vector<T,__default_alloc_template<false,0>
>::iterator' within `NAMESTABLE<T>'
x.cc:6: parse error before `;'


1) Is ``typename'' really required here?

2) Even if so, and the warning is okay -- why that error? 

3) According to gcc.info -pedantic only changes behavior according to
   ANSI C. Apparently, however, it also does something similar with
   regard to ISO C++. 

   Should the docs be updated in this direction?


Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/







Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]