Hello, $ uname -a Linux pc11-169 2.6.10-1-686 #1 Fri Mar 11 03:55:46 EST 2005 i686 GNU/Linux $ g++-3.4 --version g++-3.4 (GCC) 3.4.4 20050314 (prerelease) (Debian 3.4.3-12) Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ cat /tmp/bar.cc template <class T> struct foo { struct bar { int m; }; // Works if one of these two methods is commented. void m() const { } void m() { } bool n() const { return b->m < 42; } bar* b; }; $ g++-3.4 -c /tmp/bar.cc; echo $? /tmp/bar.cc: In member function `bool foo<T>::n() const': /tmp/bar.cc:13: error: missing `>' to terminate the template argument list /tmp/bar.cc:13: error: parse error in template argument list 1 $ g++-3.3 --version g++-3.3 (GCC) 3.3.5 (Debian 1:3.3.5-12) Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ g++-3.3 -c /tmp/bar.cc; echo $? 0 And I am using a Debian unstable. Both g++-3.3 and g++-3.4 come from the g++-3.3 and g++-3.4 Debian packages.
Confirmed, something is definitely wrong. This is most likely related to PR 10200.
Subject: Bug 20679 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: mmitchel@gcc.gnu.org 2005-04-04 19:09:10 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: overload4.C Log message: PR c++/20679 * parser.c (cp_parser_template_name): Fix thinko. PR c++/20679 * g++.dg/template/overload4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.21&r2=1.4648.2.22 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.319.2.4&r2=1.319.2.5 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.94&r2=1.5084.2.95 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/overload4.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Subject: Bug 20679 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2005-04-04 19:11:08 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: overload4.C Log message: PR c++/20679 * parser.c (cp_parser_template_name): Fix thinko. PR c++/20679 * g++.dg/template/overload4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4687&r2=1.4688 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.325&r2=1.326 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5278&r2=1.5279 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/overload4.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
Fixed in 4.0, 4.1.
Subject: Bug 20679 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: mmitchel@gcc.gnu.org 2005-04-04 23:43:54 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: overload4.C Log message: PR c++/20679 * parser.c (cp_parser_template_name): Fix thinko. PR c++/20679 * g++.dg/template/overload4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.209&r2=1.3892.2.210 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.54&r2=1.157.2.55 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.379&r2=1.3389.2.380 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/overload4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.2.2.1
Fixed in 3.4.4.