diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-02-19 11:34:45 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-02-19 11:34:45 -0500 |
commit | 3a6f3354eaaf38b5e6be41e4ebf521d299593a6e (patch) | |
tree | 3a6cb02e6196e65eae901810a11e6e8104ec18bf /gcc/cp/constraint.cc | |
parent | b29f20b6e271b7cd1faad1ced9a55d92d00fcbfe (diff) | |
download | gcc-3a6f3354eaaf38b5e6be41e4ebf521d299593a6e.zip gcc-3a6f3354eaaf38b5e6be41e4ebf521d299593a6e.tar.gz gcc-3a6f3354eaaf38b5e6be41e4ebf521d299593a6e.tar.bz2 |
c++: compound-requirement partial substitution [PR113966]
When partially substituting a requires-expr, we don't want to perform
any additional checks beyond the substitution itself so as to minimize
checking requirements out of order. So don't check the return-type-req
of a compound-requirement during partial substitution. And don't check
the noexcept condition either since we can't do that on templated trees.
PR c++/113966
gcc/cp/ChangeLog:
* constraint.cc (tsubst_compound_requirement): Don't check
the noexcept condition or the return-type-requirement when
partially substituting.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-friend17.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/cp/constraint.cc')
-rw-r--r-- | gcc/cp/constraint.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc index d956901..49de321 100644 --- a/gcc/cp/constraint.cc +++ b/gcc/cp/constraint.cc @@ -2134,7 +2134,8 @@ tsubst_compound_requirement (tree t, tree args, sat_info info) /* Check the noexcept condition. */ bool noexcept_p = COMPOUND_REQ_NOEXCEPT_P (t); - if (noexcept_p && !expr_noexcept_p (expr, quiet.complain)) + if (noexcept_p && !processing_template_decl + && !expr_noexcept_p (expr, quiet.complain)) { if (info.diagnose_unsatisfaction_p ()) inform (loc, "%qE is not %<noexcept%>", expr); @@ -2148,7 +2149,7 @@ tsubst_compound_requirement (tree t, tree args, sat_info info) return error_mark_node; /* Check expression against the result type. */ - if (type) + if (type && !processing_template_decl) { if (tree placeholder = type_uses_auto (type)) { |