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) {
1129
1129
if (DiscardResult)
1130
1130
return this ->discard (Base);
1131
1131
1132
- if (!this ->visit (Base))
1132
+ if (!this ->delegate (Base))
1133
1133
return false ;
1134
1134
1135
1135
// Base above gives us a pointer on the stack.
@@ -1617,8 +1617,10 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
1617
1617
return this ->emitGetPtrLocal (*LocalIndex, E);
1618
1618
}
1619
1619
} else {
1620
+ const Expr *Inner = E->getSubExpr ()->skipRValueSubobjectAdjustments ();
1621
+
1620
1622
if (std::optional<unsigned > LocalIndex =
1621
- allocateLocal (SubExpr , /* IsExtended=*/ true )) {
1623
+ allocateLocal (Inner , /* IsExtended=*/ true )) {
1622
1624
if (!this ->emitGetPtrLocal (*LocalIndex, E))
1623
1625
return false ;
1624
1626
return this ->visitInitializer (SubExpr);
Original file line number Diff line number Diff line change @@ -30,3 +30,11 @@ int NCI; // both-note {{declared here}}
30
30
int NCIA[NCI]; // both-warning {{variable length array}} \
31
31
// both-error {{variable length array}} \\
32
32
// 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 1
1
// 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
2
3
struct V {
3
4
char c[2 ];
4
5
banana V () : c(" i" ) {} // expected-error {{unknown type name}}
You can’t perform that action at this time.
0 commit comments