This is the mail archive of the gcc-patches@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]

Re: [C++ patch] for C++/52369


2014-03-31 23:48 GMT+02:00 Jason Merrill <jason@redhat.com>:
[...]
>> if (permerror (input_location,
>>                        "default argument given for parameter "
>>                        "%d of %q#D", i, newdecl))
>>               permerror (DECL_SOURCE_LOCATION (olddecl),
>>                      "previous specification in %q#D here",
>>                      olddecl);
>>
>> should the second permerror be a note instead ?
>
>
> Yes.

OK to commit the attached patch ?
Tested x86_64 linux, though this piece of code does not seem to be
covered by the testsuite.

2014-04-02  Fabien Chêne  <fabien@gcc.gnu.org>

    * cp/decl.c (duplicate_decls): Check for the return of
    permerror before emitting a note.

-- 
Fabien
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c	(rÃvision 208997)
+++ gcc/cp/decl.c	(copie de travail)
@@ -1737,9 +1737,9 @@ duplicate_decls (tree newdecl, tree oldd
 			if (permerror (input_location,
 				       "default argument given for parameter "
 				       "%d of %q#D", i, newdecl))
-			  permerror (DECL_SOURCE_LOCATION (olddecl),
-				     "previous specification in %q#D here",
-				     olddecl);
+			  inform (DECL_SOURCE_LOCATION (olddecl),
+				  "previous specification in %q#D here",
+				  olddecl);
 		      }
 		    else
 		      {

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