On 12/21/25 7:43 AM, Egas Ribeiro wrote:
Regtested and bootstrapped on x86_64-pc-linux-gnu.
Should the test case be split up?
No, the test is fine.
Also, for some reason we only get diagnostics correctly after c++20. I'd
expect that it should work for c++98 onward, but no error is reported so
i kept the test in c++20.
This seems to be because of the flag_concepts check earlier in the function.
-- >8 --
When a partial specialization was redeclared with different template
parameters, maybe_new_partial_specialization was incorrectly treating it
as the same specialization by only comparing template argument lists
without comparing template-heads. This caused an ICE when the
redeclaration had different template parameters.
Per [temp.spec.partial.general]/2, two partial specializations declare
the same entity only if they have equivalent template-heads and
template argument lists.
Fix by comparing template parameter lists (template-heads) in addition
to template argument lists when checking for existing specializations.
PR c++/122958
gcc/cp/ChangeLog:
* pt.cc (maybe_new_partial_specialization): Compare template
parameter lists when checking for existing specializations.
gcc/testsuite/ChangeLog:
* g++.dg/template/partial-spec-redecl.C: New test.
This doesn't match...
Signed-off-by: Egas Ribeiro <[email protected]>
---
gcc/cp/pt.cc | 7 ++++++-
.../g++.dg/cpp2a/partial-spec-redecl.C | 19 +++++++++++++++++++
...the actual pathname added.
Jason