diff options
author | Jason Merrill <jason@redhat.com> | 2025-04-08 15:53:34 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2025-04-08 22:09:59 -0400 |
commit | 94438ca82792063abf05823326695af25ab02d17 (patch) | |
tree | 06775074cb10a688319dc13c659d7a43e58f3053 /gcc/rust/ast/rust-desugar-question-mark.cc | |
parent | 6ed8c17c2bce631ae370d93164ceb6c1b5adf925 (diff) | |
download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 |
When normalizing is_foo for <T>, we get to normalizing
callable<decltype(...),T> for <T,foo>, which means substituting <T,foo> into
<decltype(...),T>.
Since r14-9938, because in_template_context is false we return the lambda
unchanged, just with LAMBDA_EXPR_EXTRA_ARGS set, so the closure type still
refers to the is_specialization_of tparms in its CLASSTYPE_TEMPLATE_INFO.
So then in normalize_atom caching find_template_parameters walks over the
parameter mapping; any_template_parm_r walks into the TREE_TYPE of a
LAMBDA_EXPR without considering EXTRA_ARGS and finds a template parm from
the wrong parameter list.
But since r15-3530 we expect to set tf_partial when substituting with
dependent arguments, so we should set that when normalizing. And then
tf_partial causes TREE_STATIC to be set on the EXTRA_ARGS, meaning that
those args will replace all the template parms in the rest of the lambda, so
we can walk just the EXTRA_ARGS and ignore the rest.
PR c++/118698
gcc/cp/ChangeLog:
* constraint.cc (struct norm_info): Add tf_partial.
* pt.cc (any_template_parm_r): Handle LAMBDA_EXPR_EXTRA_ARGS.
gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/concepts-lambda22.C: New test.
Diffstat (limited to 'gcc/rust/ast/rust-desugar-question-mark.cc')
0 files changed, 0 insertions, 0 deletions