8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-shadow3.C
Ville Voutilainen 63b48839b8 re PR c++/79133 (lambda capture shadowing parameter & decltype confusion)
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
2018-08-07 16:46:16 +03:00

7 lines
150 B
C

// { dg-do compile { target c++11 } }
int main() {
int x = 42;
auto lambda = [x](int x) {}; // { dg-error "previously declared as a capture" }
}