diff mbox

[C++] for C++/52369

Message ID CAFH4-dgHUTRj8vcKMWKSwvQwv91AWb4XXgnmBdnrss4MRWU60A@mail.gmail.com
State New
Headers show

Commit Message

Fabien Chêne April 2, 2014, 8:21 p.m. UTC
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.

Comments

Jason Merrill April 2, 2014, 8:39 p.m. UTC | #1
On 04/02/2014 04:21 PM, Fabien Chêne wrote:
>      * cp/decl.c (duplicate_decls): Check for the return of
>      permerror before emitting a note.

You don't need "cp/" within cp/ChangeLog.  OK with that change.

Jason
diff mbox

Patch

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
 		      {