| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
|
| 3 |
template <class T> |
| 4 |
concept Destructible = false; |
| 5 |
|
| 6 |
template <class T, class...Args> |
| 7 |
concept ConstructibleObject = |
| 8 |
// Concept evaluation should short-circuit even the template |
| 9 |
// substitution, so we shouldn't even substitute into the requires |
| 10 |
// constraint and the unimplemented multi-dimensional new T{...} |
| 11 |
// initialization. ATM we do, but as long as we don't output the |
| 12 |
// sorry() message we used to for such constructs when asked not |
| 13 |
// to issue errors, this shouldn't be a problem for this and |
| 14 |
// similar cases. |
| 15 |
Destructible<T> && requires (Args&&...args) { |
| 16 |
new T{ (Args&&)args... }; |
| 17 |
}; |
| 18 |
|
| 19 |
int main() { |
| 20 |
using T = int[2][2]; |
| 21 |
// GCC has not implemented initialization of multi-dimensional |
| 22 |
// arrays with new{} expressions. |
| 23 |
static_assert(!ConstructibleObject<T, T>); |
| 24 |
} |