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 @@ -1019,7 +1019,7 @@ bool ByteCodeExprGen<Emitter>::VisitMemberExpr(const MemberExpr *E) {
1019
1019
if (DiscardResult)
1020
1020
return this ->discard (Base);
1021
1021
1022
- if (!this ->visit (Base))
1022
+ if (!this ->delegate (Base))
1023
1023
return false ;
1024
1024
1025
1025
// Base above gives us a pointer on the stack.
@@ -1507,8 +1507,10 @@ bool ByteCodeExprGen<Emitter>::VisitMaterializeTemporaryExpr(
1507
1507
return this ->emitGetPtrLocal (*LocalIndex, E);
1508
1508
}
1509
1509
} else {
1510
+ const Expr *Inner = E->getSubExpr ()->skipRValueSubobjectAdjustments ();
1511
+
1510
1512
if (std::optional<unsigned > LocalIndex =
1511
- allocateLocal (SubExpr , /* IsExtended=*/ true )) {
1513
+ allocateLocal (Inner , /* IsExtended=*/ true )) {
1512
1514
if (!this ->emitGetPtrLocal (*LocalIndex, E))
1513
1515
return false ;
1514
1516
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