c++: more constrained nested partial specialization
authorPatrick Palka <ppalka@redhat.com>
Wed, 3 Jun 2020 20:37:24 +0000 (16:37 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 3 Jun 2020 20:40:34 +0000 (16:40 -0400)
commitc06280ac4c34b0aff8cfa2e74ae8c7afd759d52f
tree23209ade8805880d036eb64aed9ecc4f95270a42
parentaee69073cdb8086d393f12474c6177e75467ceaa
c++: more constrained nested partial specialization

When checking that a constrained partial specialization is more
constrained than the primary template, we pass only the innermost level
of generic template arguments to strictly_subsumes.  This leads to us
doing a nonsensical substitution from normalize_concept_check if the
full set of template arguments has multiple levels, and it ultimately
causes strictly_subsumes to sometimes erroneously return false as in the
testcase below.

gcc/cp/ChangeLog:

* pt.c (process_partial_specialization): Pass the full set of
generic template arguments to strictly_subsumes.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-partial-spec8.C: New test.
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp2a/concepts-partial-spec8.C [new file with mode: 0644]