This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14136] [4.0 Regression] double error message for typename used as destructor declarator


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]