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]
Other format: [Raw text]

Re: c++/10200: Parse error for < operator


Synopsis: Parse error for < operator

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Mon Mar 24 17:26:13 2003
State-Changed-Why:
    Confirmed. A very weird error:
    ------------------
    template<typename> void foo() {}
    
    template <typename T>
    struct X {
        struct { int foo; } node;
    
        bool bar() {
          return (node.foo < 5);
        }
    };
    template struct X<int>;
    --------------------------
    
    Note that template function and member variable have to
    have the same name, to get this from 3.2.3pre and 3.3pre:
    
    g/x> /home/bangerth/bin/gcc-3.2.3-pre/bin/c++ -c x.cc
    x.cc: In member function `bool X<T>::bar()':
    x.cc:8: parse error before `;' token
    
    Present mainline gives
    g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
    x.cc: In member function `bool X<T>::bar() [with T = int]':
    x.cc:11:   instantiated from here
    x.cc:8: error: invalid use of `foo()'
    
    This is just as wrong.
    
    W.

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


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