c++: Respect current_constraint_diagnosis_depth in diagnose_compound_requirement
authorPatrick Palka <ppalka@redhat.com>
Sat, 28 Mar 2020 12:56:33 +0000 (08:56 -0400)
committerPatrick Palka <ppalka@redhat.com>
Sat, 28 Mar 2020 12:56:33 +0000 (08:56 -0400)
commitcd68edf894d6b72e5bc37ac205deef9d237ab70b
tree1ba70ce7194fddbe4c30a12da104d061ffe4c661
parent75defde9fb56157d5f0279720d48866925b71b19
c++: Respect current_constraint_diagnosis_depth in diagnose_compound_requirement

The previous patch tries to avoid changing our current default diagnostics.  But
for the sake of consistency we arguably should also respect
current_constraint_diagnosis_depth in diagnose_compound_requirement() like we do
in the other error-replaying diagnostic routines.  But doing so would be a
change to our default diagnostics behavior, so the change has been split out
into this separate patch for separate consideration.

gcc/cp/ChangeLog:

* constraint.cc (diagnose_compound_requirement): When diagnosing a
compound requirement, maybe replay the satisfaction failure, subject to
the current diagnosis depth.

gcc/testsuite/ChangeLog:

* g++.dg/concepts/diagnostic1.C: Pass -fconcepts-diagnostics-depth=2.
* g++.dg/concepts/diagnostic5.C: Adjust expected diagnostics.
* g++.dg/cpp2a/concepts-iconv1.C: Pass -fconcepts-diagnostics-depth=2.
* g++.dg/cpp2a/concepts-requires5.C: Likewise.
gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/diagnostic1.C
gcc/testsuite/g++.dg/concepts/diagnostic5.C
gcc/testsuite/g++.dg/cpp2a/concepts-iconv1.C
gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C