gcc/testsuite/g++.dg/cpp0x/diag3.C
raw| 1 | // PR c++/59655 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<typename T> struct A { static constexpr bool value = false; }; |
| 5 | |
| 6 | struct B { |
| 7 | template<typename T> |
| 8 | B (T t) |
| 9 | { |
| 10 | static_assert (A<T>::value, "baz"); // { dg-error "static assertion failed" } |
| 11 | foo (t); |
| 12 | } |
| 13 | template<typename T> void foo (T) {} // { dg-bogus "used but never defined" } |
| 14 | }; |
| 15 | |
| 16 | int |
| 17 | main () |
| 18 | { |
| 19 | B t([](int) { }); |
| 20 | } |