diff options
author | Patrick Palka <ppalka@redhat.com> | 2024-02-02 19:07:08 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2024-02-02 19:07:08 -0500 |
commit | 686b5eb9c9ee623a604dde5c49fa11c23f384c62 (patch) | |
tree | 375a880296aef2d13eb69da98f57a9b9874f0178 /libphobos/src/std/internal/attributes.d | |
parent | 64b0130bb6702c67a13caefaae9facef23d6ac60 (diff) | |
download | gcc-686b5eb9c9ee623a604dde5c49fa11c23f384c62.zip gcc-686b5eb9c9ee623a604dde5c49fa11c23f384c62.tar.gz gcc-686b5eb9c9ee623a604dde5c49fa11c23f384c62.tar.bz2 |
c++: requires-exprs and partial constraint subst [PR110006]
In r11-3261-gb28b621ac67bee we made tsubst_requires_expr never partially
substitute into a requires-expression so as to avoid checking its
requirements out of order during e.g. generic lambda regeneration.
These PRs however illustrate that we still sometimes do need to
partially substitute into a requires-expression, in particular when it
appears in associated constraints that we're directly substituting for
sake of declaration matching or dguide constraint rewriting. In these
cases we're being called from tsubst_constraint during which
processing_constraint_expression_p is true, so this patch checks this
predicate to control whether we defer substitution or partially
substitute.
In turn, we now need to propagate semantic tsubst flags through
tsubst_requires_expr rather than just using tf_none, notably for sake of
dguide constraint rewriting which sets tf_dguide.
PR c++/110006
PR c++/112769
gcc/cp/ChangeLog:
* constraint.cc (subst_info::quiet): Accomodate non-diagnostic
tsubst flags.
(tsubst_valid_expression_requirement): Likewise.
(tsubst_simple_requirement): Return a substituted _REQ node when
processing_template_decl.
(tsubst_type_requirement_1): Accomodate non-diagnostic tsubst
flags.
(tsubst_type_requirement): Return a substituted _REQ node when
processing_template_decl.
(tsubst_compound_requirement): Likewise. Accomodate non-diagnostic
tsubst flags.
(tsubst_nested_requirement): Likewise.
(tsubst_requires_expr): Don't defer partial substitution when
processing_constraint_expression_p is true, in which case return
a substituted REQUIRES_EXPR.
* pt.cc (tsubst_expr) <case REQUIRES_EXPR>: Accomodate
non-diagnostic tsubst flags.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/class-deduction-alias18.C: New test.
* g++.dg/cpp2a/concepts-friend16.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libphobos/src/std/internal/attributes.d')
0 files changed, 0 insertions, 0 deletions