We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c0723fe commit 74a2ff7Copy full SHA for 74a2ff7
clang/test/SemaCXX/warn-shadow-in-lambdas.cpp
@@ -258,9 +258,15 @@ struct S {
258
};
259
260
int foo() {
261
+#ifdef AVOID
262
auto [a] = S{0}; // cxx14-warning {{decomposition declarations are a C++17 extension}}
- [a = a] () { // No warning - consistent with regular parameter captures
263
+ [a = a] () { // No warning with basic -Wshadow due to uncaptured-local classification
264
+ }();
265
+#else
266
+ auto [a] = S{0}; // cxx14-warning {{decomposition declarations are a C++17 extension}} expected-note {{previous declaration is here}}
267
+ [a = a] () { // expected-warning {{declaration shadows a structured binding}}
268
}();
269
+#endif
270
}
271
272
0 commit comments