diff options
author | Marek Polacek <polacek@redhat.com> | 2025-08-20 10:49:47 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2025-08-20 16:28:57 -0400 |
commit | 51fbd1e4ea8023847d786a0fdc89219e93bcc666 (patch) | |
tree | 5a96f78fdaeb5ef0ca723690417bbdd8ae8952ea /libjava/gnu | |
parent | 6747672747cd86f75519f814816b7f83ddaedcc2 (diff) | |
download | gcc-51fbd1e4ea8023847d786a0fdc89219e93bcc666.zip gcc-51fbd1e4ea8023847d786a0fdc89219e93bcc666.tar.gz gcc-51fbd1e4ea8023847d786a0fdc89219e93bcc666.tar.bz2 |
c++: lambda capture and shadowing [PR121553]
P2036 says that this:
[x=1]{ int x; }
should be rejected, but with my P2036 we started giving an error
for the attached testcase as well, breaking Dolphin. So let's
keep the error only for init-captures.
PR c++/121553
gcc/cp/ChangeLog:
* name-lookup.cc (check_local_shadow): Check !is_normal_capture_proxy.
gcc/testsuite/ChangeLog:
* g++.dg/warn/Wshadow-19.C: Revert P2036 changes.
* g++.dg/warn/Wshadow-6.C: Likewise.
* g++.dg/warn/Wshadow-20.C: New test.
* g++.dg/warn/Wshadow-21.C: New test.
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libjava/gnu')
0 files changed, 0 insertions, 0 deletions