This is the mail archive of the gcc-prs@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]
Other format: [Raw text]

Re: c++/5367: -pedantic switch causes template compilation to fail


Synopsis: -pedantic switch causes template compilation to fail

State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Sun Jan 13 10:40:49 2002
State-Changed-Why:
    With gcc 3.0.3, if I compile your test case with:
    g++ -pedantic -c test.cpp
    
    I get the error:
    test.cpp:7: warning: ISO C++ forbids declaration of `iterator' with no type
    test.cpp:7: cannot declare member `std::map<Key, T*, std::less<_Key>,
       std::allocator<std::pair<const Key, T*> > >::iterator' within
       `TemplateA<Key, T>'
    
    
    If I change the line:
       typedef MyMap::iterator MyMapIterator;
    
    to:
       typedef typename MyMap::iterator MyMapIterator;
    
    then it can compile.
    
    Can you verify if this works for you?

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5367


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