https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92268

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Oct 31 02:01:16 2019
New Revision: 277654

URL: https://gcc.gnu.org/viewcvs?rev=277654&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constraint.cc
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/g++.dg/concepts/diagnostic1.C
    trunk/gcc/testsuite/g++.dg/concepts/placeholder3.C
    trunk/gcc/testsuite/g++.dg/concepts/placeholder4.C
    trunk/gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
    trunk/gcc/testsuite/g++.dg/cpp2a/concepts-requires6.C

Reply via email to