brintos

brintos / llvm-project-archived public Read only

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