mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 20:01:31 -05:00
PR c++/79133 gcc/cp/ PR c++/79133 * name-lookup.c (check_local_shadow): Reject captures and parameters with the same name. testsuite/ PR c++/79133 * g++.dg/cpp0x/lambda/lambda-shadow3.C: New. * g++.dg/cpp1y/lambda-generic-variadic18.C: Likewise. From-SVN: r263357
12 lines
460 B
C
12 lines
460 B
C
// { dg-do compile { target c++14 } }
|
|
|
|
int main() {
|
|
int x = 42;
|
|
auto lambda2 = [x=x](int x) {}; // { dg-error "previously declared as a capture" }
|
|
auto lambda3 = [x](auto... x) {}; // { dg-error "previously declared as a capture" }
|
|
auto lambda4 = [](auto... x) {
|
|
auto lambda5 = [x...](auto... x) {}; // { dg-error "previously declared as a capture" }
|
|
auto lambda6 = [x...](int x) {}; // { dg-error "previously declared as a capture" }
|
|
};
|
|
}
|