Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this18.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/61151 |
2 // { dg-do compile { target c++11 } } | |
3 | |
4 struct B | |
5 { | |
6 void foo () {} | |
7 }; | |
8 | |
9 template <class> | |
10 struct A | |
11 { | |
12 template <class> void bar (); | |
13 B a; | |
14 }; | |
15 | |
16 template <class T> | |
17 template <class U> | |
18 void | |
19 A<T>::bar () | |
20 { | |
131 | 21 auto f = [this] () { auto g = [=] () { a.foo (); }; g (); }; // { dg-warning "implicit capture" "" { target c++2a } } |
111 | 22 f (); |
23 } | |
24 | |
25 int | |
26 main () | |
27 { | |
28 A<int> a; | |
29 a.bar <int> (); | |
30 } |