Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi7.C

raw
1 // PR c++/64496
2 // { dg-do compile { target c++11 } }
3
4 template <typename> class B;
5 template <typename W, typename... X>
6 struct B<W(X...)> { template <typename F> B(F); };
7 template <typename W, typename... X>
8 template <typename F>
9 B<W(X...)>::B(F) {}
10
11 int
12 main()
13 {
14 int a;
15 struct A // { dg-message "lambda in local class" }
16 {
17 B<void()> l = [=] {
18 a; // { dg-error "not captured" }
19 };
20 };
21 [] { // { dg-message "capture-default" }
22 a; // { dg-error "not captured" }
23 };
24 A t;
25 }