works with 4.0.4, 4.1.1, 4.2.0, fails with 4.1 branch 20061008 $ g++ -c -Wall -fPIC -fexceptions -frtti -I/usr/include/python2.3 -I/usr/share/python2.3/CXX -I/usr/include/subversion-1 -I/usr/include/apr-1.0 -I. -DNDEBUG -o pysvn.o pysvn.cpp /usr/include/python2.3/CXX/Objects.hxx:1932: error: parse error in template argument list
Created attachment 12401 [details] preprocessed source
I don't think this is valid code, reduced testcase: template <class T> class a { ~a<T>(); };
It's at least accepted by EDG and Comeau in strict-ansi mode. (so, confirmed)
(In reply to comment #3) > It's at least accepted by EDG and Comeau in strict-ansi mode. (so, confirmed) Don't take EDG/Comeau as conforming to the standard.
20060928 works Matthias
r117410 is the first version showing the failure. r117410 | mmitchel | 2006-10-03 20:06:00 +0200 (Di, 03 Okt 2006) | 12 lines PR c++/29138 * decl2.c (grokfield): Don't handle access declarations here. * parser.c (cp_parser_using_declaration): Handle access declarations too. (cp_parser_block_declaration): Adjust calls to cp_parser_using_declaration. (cp_parser_member_declaration): Likewise. Use cp_parser_using_declaration to look for access_declarations. PR c++/29138 * g++.dg/inherit/access8.C: New test. * g++.dg/template/dtor4.C: Tweak error messages.
fails with trunk 20061012 as well. Matthias
I don't believe the code is valid. W.
There is long-standing confusion in the C++ standard regarding the naming of destructors in various situations. (Part of the issue is to what extent destructors have names, and how the injection of class names into their own scopes work, and how the lookup rules for qualified names apply to destructors, and so forth.) However, I do think this code should be accepted; it doesn't look like one of the particularly tricky cases.
Subject: Bug 29408 Author: mmitchel Date: Mon Oct 16 23:07:46 2006 New Revision: 117800 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117800 Log: PR c++/29408 * parser.c (cp_parser_using_declaration): Stop parsing when something goes wrong with an access declaration. PR c++/29408 * g++.dg/parse/dtor12.C: New test. Added: trunk/gcc/testsuite/g++.dg/parse/dtor12.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed in 4.2.0.
Subject: Bug 29408 Author: mmitchel Date: Tue Oct 17 00:01:14 2006 New Revision: 117802 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117802 Log: PR c++/29408 * parser.c (cp_parser_using_declaration): Stop parsing when something goes wrong with an access declaration. PR c++/29408 * g++.dg/parse/dtor12.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/dtor12.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/parser.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed in 4.1.2.