gcc/testsuite/g++.dg/cpp2a/lambda-targ10.C
raw| 1 | // PR c++/117887 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<bool V, class T> struct A { static constexpr bool value = V; }; |
| 5 | |
| 6 | template<class T> |
| 7 | using AT = A<[]{return sizeof(T) != sizeof(T*); }(), T>; |
| 8 | |
| 9 | template<class T> struct B { using type = T; }; |
| 10 | |
| 11 | template<class T> |
| 12 | void f() { |
| 13 | static_assert( B<AT<T>>::type::value); |
| 14 | static_assert(!B<AT<T*>>::type::value); |
| 15 | } |
| 16 | |
| 17 | template void f<char>(); |