This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14136] [4.0 Regression] double error message for typename used as destructor declarator
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Nov 2004 02:31:18 -0000
- Subject: [Bug c++/14136] [4.0 Regression] double error message for typename used as destructor declarator
- References: <20040213054710.14136.pinskia@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From reichelt at gcc dot gnu dot org 2004-11-27 02:31 -------
The following patch fixes the error message for me.
I haven't done bootstrapping and regtesting, though.
Index: parser.c
===================================================================
RCS file: /usr/local/gcc/CVS/gcc-cvs/gcc/gcc/cp/parser.c,v
retrieving revision 1.276
diff -u -p -r1.276 parser.c
--- parser.c 3 Nov 2004 02:48:37 -0000 1.276
+++ parser.c 27 Nov 2004 07:07:14 -0000
@@ -3234,7 +3234,8 @@ cp_parser_unqualified_id (cp_parser* par
identifier in the declarator for a destructor declaration. */
if (declarator_p
&& !DECL_IMPLICIT_TYPEDEF_P (type_decl)
- && !DECL_SELF_REFERENCE_P (type_decl))
+ && !DECL_SELF_REFERENCE_P (type_decl)
+ && !cp_parser_committed_to_tentative_parse (parser))
error ("typedef-name %qD used as destructor declarator",
type_decl);
===================================================================
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14136