2014-03-31 23:48 GMT+02:00 Jason Merrill <ja...@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 <fab...@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 {