diff options
author | Patrick Palka <ppalka@redhat.com> | 2023-11-10 10:58:04 -0500 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2023-11-10 10:58:04 -0500 |
commit | 705ab7927c81b77503d229513fac991106617766 (patch) | |
tree | 66c2ef60abeb65d30e3fba18c7aa768251ca4694 /gcc/fold-const.cc | |
parent | 5dbaf4851bbf56b6176dca1f1e7d38a16b5b84ee (diff) | |
download | gcc-705ab7927c81b77503d229513fac991106617766.zip gcc-705ab7927c81b77503d229513fac991106617766.tar.gz gcc-705ab7927c81b77503d229513fac991106617766.tar.bz2 |
c++: decltype of capture proxy [PR79378, PR96917]
We typically don't see capture proxies in finish_decltype_type because
process_outer_var_ref is a no-op within an unevaluated context and so a
use of a captured variable within decltype resolves to the captured
variable, not the capture. But we can see them during decltype(auto)
deduction and for decltype of an init-capture, which suggests we need to
handle capture proxies specially within finish_decltype_type after all.
This patch adds such handling.
PR c++/79378
PR c++/96917
gcc/cp/ChangeLog:
* semantics.cc (finish_decltype_type): Handle an id-expression
naming a capture proxy specially.
gcc/testsuite/ChangeLog:
* g++.dg/cpp1y/decltype-auto7.C: New test.
* g++.dg/cpp1y/lambda-init20.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/fold-const.cc')
0 files changed, 0 insertions, 0 deletions