aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/resolve
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-12-15 16:02:05 -0500
committerPatrick Palka <ppalka@redhat.com>2022-12-15 16:02:05 -0500
commit18499b9f848707aee42d810e99ac0a4c9788433c (patch)
tree0e2653dbba42e484cc3015fdc7f2b8dcb33d2c5d /gcc/rust/resolve
parentbe124477b38a71ba8ba0b24d859ae764bb44a4eb (diff)
downloadgcc-18499b9f848707aee42d810e99ac0a4c9788433c.zip
gcc-18499b9f848707aee42d810e99ac0a4c9788433c.tar.gz
gcc-18499b9f848707aee42d810e99ac0a4c9788433c.tar.bz2
c++: extract_local_specs and unevaluated contexts [PR100295]
Here during partial instantiation of the constexpr if, extra_local_specs walks the statement looking for local specializations within to capture. However, we're thwarted by the fact that 'ts' first appears inside an unevaluated context, and so the calls to process_outer_var_ref for its local specializations are a no-op. And since we walk each tree exactly once, we end up not capturing the local specializations despite 'ts' later occurring in an evaluated context. This patch fixes this by making extract_local_specs walk evaluated contexts first before walking unevaluated contexts. We could probably get away with not walking unevaluated contexts at all, but this approach seems more clearly safe. PR c++/100295 PR c++/107579 gcc/cp/ChangeLog: * pt.cc (el_data::skip_unevaluated_operands): New data member. (extract_locals_r): If skip_unevaluated_operands is true, don't walk into unevaluated contexts. (extract_local_specs): Walk the pattern twice, first with skip_unevaluated_operands true followed by it set to false. gcc/testsuite/ChangeLog: * g++.dg/cpp1z/constexpr-if-lambda5.C: New test.
Diffstat (limited to 'gcc/rust/resolve')
0 files changed, 0 insertions, 0 deletions