gcc/testsuite/g++.dg/cpp0x/lambda/lambda-alias1.C
raw| 1 | // PR c++/105518 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct integral_constant { |
| 5 | constexpr operator int() const { return 42; } |
| 6 | }; |
| 7 | |
| 8 | template<int N> |
| 9 | struct A { |
| 10 | using type = A; |
| 11 | static constexpr int value = N; |
| 12 | }; |
| 13 | |
| 14 | template<class T> |
| 15 | void f(T t) { |
| 16 | using alias = A<t>; |
| 17 | [](int) { |
| 18 | typename alias::type a; // { dg-bogus "'t' is not captured" } |
| 19 | return a.value; |
| 20 | }(0); |
| 21 | } |
| 22 | |
| 23 | template void f(integral_constant); |