File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ bool ByteCodeExprGen<Emitter>::VisitCastExpr(const CastExpr *CE) {
78
78
switch (CE->getCastKind ()) {
79
79
80
80
case CK_LValueToRValue: {
81
+ if (DiscardResult)
82
+ return this ->discard (SubExpr);
83
+
81
84
return dereference (
82
85
SubExpr, DerefKind::Read,
83
86
[](PrimType) {
@@ -86,9 +89,7 @@ bool ByteCodeExprGen<Emitter>::VisitCastExpr(const CastExpr *CE) {
86
89
},
87
90
[this , CE](PrimType T) {
88
91
// Pointer on stack - dereference it.
89
- if (!this ->emitLoadPop (T, CE))
90
- return false ;
91
- return DiscardResult ? this ->emitPop (T, CE) : true ;
92
+ return this ->emitLoadPop (T, CE);
92
93
});
93
94
}
94
95
Original file line number Diff line number Diff line change @@ -98,3 +98,15 @@ void f (int z) {
98
98
99
99
int expr ;
100
100
int chooseexpr [__builtin_choose_expr (1 , 1 , expr )];
101
+
102
+ int somefunc (int i ) {
103
+ return (i , 65537 ) * 65537 ; // expected-warning {{left operand of comma operator has no effect}} \
104
+ // expected-warning {{overflow in expression; result is 131073}} \
105
+ // pedantic-expected-warning {{left operand of comma operator has no effect}} \
106
+ // pedantic-expected-warning {{overflow in expression; result is 131073}} \
107
+ // ref-warning {{left operand of comma operator has no effect}} \
108
+ // ref-warning {{overflow in expression; result is 131073}} \
109
+ // pedantic-ref-warning {{left operand of comma operator has no effect}} \
110
+ // pedantic-ref-warning {{overflow in expression; result is 131073}}
111
+
112
+ }
You can’t perform that action at this time.
0 commit comments