gcc/testsuite/g++.dg/warn/Winit-list4.C
raw| 1 | // PR c++/97632 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | // Test we don't warn in an unevaluated operand. |
| 4 | |
| 5 | #include <initializer_list> |
| 6 | |
| 7 | template<typename _Tp> |
| 8 | concept default_initializable |
| 9 | = requires |
| 10 | { |
| 11 | _Tp{}; |
| 12 | (void) ::new _Tp; // { dg-bogus "does not extend the lifetime" } |
| 13 | }; |
| 14 | |
| 15 | static_assert(default_initializable<std::initializer_list<int>>); |