File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -1129,7 +1129,7 @@ bool ByteCodeExprGen<Emitter>::VisitMemberExpr(const MemberExpr *E) {
11291129 if (DiscardResult)
11301130 return this ->discard (Base);
11311131
1132- if (!this ->visit (Base))
1132+ if (!this ->delegate (Base))
11331133 return false ;
11341134
11351135 // Base above gives us a pointer on the stack.
@@ -1617,8 +1617,10 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
16171617 return this ->emitGetPtrLocal (*LocalIndex, E);
16181618 }
16191619 } else {
1620+ const Expr *Inner = E->getSubExpr ()->skipRValueSubobjectAdjustments ();
1621+
16201622 if (std::optional<unsigned > LocalIndex =
1621- allocateLocal (SubExpr , /* IsExtended=*/ true )) {
1623+ allocateLocal (Inner , /* IsExtended=*/ true )) {
16221624 if (!this ->emitGetPtrLocal (*LocalIndex, E))
16231625 return false ;
16241626 return this ->visitInitializer (SubExpr);
Original file line number Diff line number Diff line change @@ -30,3 +30,11 @@ int NCI; // both-note {{declared here}}
3030int NCIA[NCI]; // both-warning {{variable length array}} \
3131 // both-error {{variable length array}} \\
3232 // both-note {{read of non-const variable 'NCI'}}
33+
34+
35+ struct V {
36+ char c[1 ];
37+ banana V () : c(" i" ) {} // both-error {{unknown type name 'banana'}} \
38+ // both-error {{constructor cannot have a return type}}
39+ };
40+ _Static_assert (V().c[0 ], " " ); // both-error {{is not an integral constant expression}}
Original file line number Diff line number Diff line change 11// RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only %s
2+ // RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only -fexperimental-new-constant-interpreter %s
23struct V {
34 char c[2 ];
45 banana V () : c(" i" ) {} // expected-error {{unknown type name}}
You can’t perform that action at this time.
0 commit comments