This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ patch] for C++/52369
- From: Fabien Chêne <fabien dot chene at gmail dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 2 Apr 2014 22:21:21 +0200
- Subject: Re: [C++ patch] for C++/52369
- Authentication-results: sourceware.org; auth=none
- References: <CAFH4-diup6eH5j3MhZcknAAia+6ZSyzwD5D94WV0NMa+otgjFg at mail dot gmail dot com> <CAFH4-dgpyn56MQN-7bXM9teA9tBWSFYbcsjiAG5TT53YU04XjA at mail dot gmail dot com> <530F8315 dot 5010703 at redhat dot com> <CAFH4-dgj=JNDHuy2gaW0G9VcdwgrLMiGQg1JHuJHdB-Fcb2SQQ at mail dot gmail dot com> <5310FF29 dot 6060102 at redhat dot com> <CAFH4-diMgdJBTGV=fRZaESLhR4aGR_i8zyL1j99-sKD5eJRFQg at mail dot gmail dot com> <CAFH4-djUxkPYoThf-Gxhf-ZxFkPdEphHYprcDDhBtvHt3PC-6w at mail dot gmail dot com> <5313D7EB dot 8080801 at redhat dot com> <CAFH4-djGxznKjqbd96taMQoypJwvrGCTOkcso3aazD8-pz1-xQ at mail dot gmail dot com> <5330698D dot 5010107 at redhat dot com> <CAFH4-di3mpWOfpKONhH5z3r3-psD+osNi0s-FAw-X1KqN=aukA at mail dot gmail dot com> <5335AA6A dot 7030407 at redhat dot com> <CAFH4-div6q7MB9-BxppPZrqcCe0vXY9pL=8hp_c1vPCnHF9BLA at mail dot gmail dot com> <5339E290 dot 9030802 at redhat dot com>
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
{