gcc/testsuite/g++.dg/cpp2a/concepts-requires31.C
raw| 1 | // PR c++/107179 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<bool B> struct bool_constant { static constexpr bool value = B; }; |
| 5 | |
| 6 | template<typename T> |
| 7 | struct is_implicitly_default_constructible |
| 8 | : bool_constant<requires { T(); }> |
| 9 | { }; |
| 10 | |
| 11 | struct X { private: X(); }; |
| 12 | struct Y { }; |
| 13 | |
| 14 | static_assert( !is_implicitly_default_constructible<X>::value ); |
| 15 | static_assert( is_implicitly_default_constructible<Y>::value ); |