c++: Detect deduction guide redeclaration [PR97099]
authorMarek Polacek <polacek@redhat.com>
Fri, 18 Sep 2020 23:37:05 +0000 (19:37 -0400)
committerMarek Polacek <polacek@redhat.com>
Mon, 21 Sep 2020 14:11:41 +0000 (10:11 -0400)
commitb6ff694e592669e7865d39a884100dd677e7ceec
treefe5ac97074119251d228e9f5a028978e1914f806
parent2ec58cfcea146a61755516ce4ed160827fe0b4ff
c++: Detect deduction guide redeclaration [PR97099]

[temp.deduct.guide]p3: Two deduction guide declarations in the same
translation unit for the same class template shall not have equivalent
parameter-declaration-clauses.

So let's detect that.

gcc/cp/ChangeLog:

PR c++/97099
* decl.c (redeclaration_error_message): Detect a redeclaration of
deduction guides.

gcc/testsuite/ChangeLog:

PR c++/97099
* g++.dg/cpp1z/class-deduction74.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp1z/class-deduction74.C [new file with mode: 0644]