This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10200: Parse error for < operator
- From: bangerth at dealii dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, sturgill at cs dot baylor dot edu
- Date: 24 Mar 2003 17:26:13 -0000
- Subject: Re: c++/10200: Parse error for < operator
- Reply-to: bangerth at dealii dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, sturgill at cs dot baylor dot edu, gcc-gnats at gcc dot gnu dot org
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