gcc/testsuite/g++.dg/cpp1y/lambda-generic-variadic2.C
raw| 1 | // PR c++/64105 |
| 2 | // This test was ICEing in C++11 mode. |
| 3 | // { dg-do compile { target c++11 } } |
| 4 | // { dg-skip-if "requires hosted libstdc++ for functional function" { ! hostedlib } } |
| 5 | |
| 6 | #include <functional> |
| 7 | |
| 8 | using F = std::function<void(void)>; |
| 9 | |
| 10 | struct X |
| 11 | { |
| 12 | template <typename T> |
| 13 | static void f(T t) |
| 14 | { |
| 15 | g(t); |
| 16 | } |
| 17 | |
| 18 | static void g(F) {} |
| 19 | }; |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | X::f([](auto... xs){}); // { dg-error "" "" { target { ! c++14 } } } |
| 24 | } |