gcc/testsuite/g++.dg/cpp1y/lambda-generic-78018.C
raw| 1 | // PR c++/78018 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | |
| 4 | struct A |
| 5 | { |
| 6 | void f1(); |
| 7 | |
| 8 | template <typename F> |
| 9 | void f2(F f); |
| 10 | |
| 11 | template<typename T> |
| 12 | void f3(T t); |
| 13 | }; |
| 14 | |
| 15 | struct B |
| 16 | { |
| 17 | template<typename L> |
| 18 | void f(L) { } |
| 19 | }; |
| 20 | |
| 21 | void A::f1() |
| 22 | { |
| 23 | f2([&] (auto t) { f3(t); } ); |
| 24 | } |
| 25 | |
| 26 | template <typename F> |
| 27 | void A::f2(F f) |
| 28 | { |
| 29 | B b; |
| 30 | f(b); |
| 31 | } |
| 32 | |
| 33 | template<typename T> |
| 34 | void A::f3(T t) |
| 35 | { |
| 36 | } |
| 37 |