File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -2916,11 +2916,7 @@ template <class Emitter>
29162916bool ByteCodeExprGen<Emitter>::VisitCXXDefaultInitExpr(
29172917 const CXXDefaultInitExpr *E) {
29182918 SourceLocScope<Emitter> SLS (this , E);
2919- if (Initializing)
2920- return this ->visitInitializer (E->getExpr ());
2921-
2922- assert (classify (E->getType ()));
2923- return this ->visit (E->getExpr ());
2919+ return this ->delegate (E->getExpr ());
29242920}
29252921
29262922template <class Emitter >
Original file line number Diff line number Diff line change @@ -1264,3 +1264,24 @@ namespace {
12641264 static_assert (true_type::value, " " );
12651265 static_assert (true_type::value, " " );
12661266}
1267+
1268+ #if __cplusplus >= 202002L
1269+ namespace {
1270+ // / Used to crash because the CXXDefaultInitExpr is of compound type.
1271+ struct A {
1272+ int &x;
1273+ constexpr ~A () { --x; }
1274+ };
1275+ struct B {
1276+ int &x;
1277+ const A &a = A{x};
1278+ };
1279+ constexpr int a () {
1280+ int x = 1 ;
1281+ int f = B{x}.x ;
1282+ B{x}; // both-warning {{expression result unused}}
1283+
1284+ return 1 ;
1285+ }
1286+ }
1287+ #endif
You can’t perform that action at this time.
0 commit comments