| 1 |
// FIXME: These test cases currently crash during codegen, despite initializers |
| 2 |
// for CLEs being constant. |
| 3 |
// RUN: not --crash %clang_cc1 -verify -std=c++20 -emit-llvm %s -o - |
| 4 |
// expected-no-diagnostics |
| 5 |
namespace case1 { |
| 6 |
struct RR { int&& r; }; |
| 7 |
struct Z { RR* x; }; |
| 8 |
constinit Z z = { (RR[1]){1} }; |
| 9 |
} |
| 10 |
|
| 11 |
|
| 12 |
namespace case2 { |
| 13 |
struct RR { int r; }; |
| 14 |
struct Z { int x; const RR* y; int z; }; |
| 15 |
inline int f() { return 0; } |
| 16 |
Z z2 = { 10, (const RR[1]){__builtin_constant_p(z2.x)}, z2.y->r+f() }; |
| 17 |
} |