c++/5763: [2003-01-20]Compiler uses the wrong type

bangerth@dealii.org bangerth@dealii.org
Wed Feb 26 17:11:00 GMT 2003


Synopsis: [2003-01-20]Compiler uses the wrong type

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Wed Feb 26 17:11:52 2003
State-Changed-Why:
    Confirmed. The code is illegal, but the error message
    we presently get from mainline are less than helpful:
    x.cc:15: error: ISO C++ forbids declaration of `iterator' with no type
    x.cc:15: error: cannot declare member `filter<phase_2<Phase1> >::iterator'
       within `phase_2<Phase1>'
    x.cc:15: error: expected `;'
    x.cc:18: error: `phase_2<phase_1>::iter2' is not a class-name or namespace-name
    x.cc:18: error: expected constructor, destructor, or type conversion
    x.cc:18: error: expected `,' or `;'
    
    I think we should consider this a bug.
    
    The code is easily fixed, though, adding typename and
    template at the appropriate places in the typedef. It
    then also compiles with all versions of gcc.
    
    W.

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



More information about the Gcc-bugs mailing list