c++/10200: Parse error for < operator
bangerth@dealii.org
bangerth@dealii.org
Mon Mar 24 17:56:00 GMT 2003
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
More information about the Gcc-bugs
mailing list