PR c++/92268 - hard error satisfying return-type-requirement
authorJason Merrill <jason@redhat.com>
Thu, 31 Oct 2019 02:01:16 +0000 (22:01 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 31 Oct 2019 02:01:16 +0000 (22:01 -0400)
commit56e0346dcb882b07199b8b19616b52f9667e356f
tree7547594aa1edb233eafc2a8935fc82ee8742e7c5
parentd11368e6e0bc88033c2ff8a0e5f534d6d2f36b89
PR c++/92268 - hard error satisfying return-type-requirement

Previously we would put the template arguments for the concept-check in a
TEMPLATE_ID and then also pass them to constraints_satisfied_p, which meant
that we would try to normalize the concept-check with the fully instantiated
arguments, leading to sadness.  Simply not passing the args to
constraints_satisfied_p fixes the problem.

I also noticed that we weren't detecting substitution failure in the
constraints, but were silently treating it as success.

* constraint.cc (type_deducible_p): Check for substitution failure.
(diagnose_compound_requirement): Adjust diagnostic.
* pt.c (do_auto_deduction): Don't pass cargs to
constraints_satisfied_p.

From-SVN: r277654
gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/cp/pt.c
gcc/testsuite/g++.dg/concepts/diagnostic1.C
gcc/testsuite/g++.dg/concepts/placeholder3.C
gcc/testsuite/g++.dg/concepts/placeholder4.C
gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C
gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C [new file with mode: 0644]