File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,9 @@ bool ByteCodeExprGen<Emitter>::VisitCastExpr(const CastExpr *CE) {
167
167
return this ->emitNull (classifyPrim (CE->getType ()), CE);
168
168
169
169
case CK_PointerToIntegral: {
170
- // TODO: Discard handling.
170
+ if (DiscardResult)
171
+ return this ->discard (SubExpr);
172
+
171
173
if (!this ->visit (SubExpr))
172
174
return false ;
173
175
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ _Static_assert(!!1, "");
24
24
int a = (1 == 1 ? 5 : 3 );
25
25
_Static_assert (a == 5 , "" ); // all-error {{not an integral constant expression}}
26
26
27
+ const int DiscardedPtrToIntCast = ((intptr_t )((void * )0 ), 0 ); // all-warning {{left operand of comma operator has no effect}}
27
28
28
29
const int b = 3 ;
29
30
_Static_assert (b == 3 , "" ); // pedantic-ref-warning {{not an integer constant expression}} \
You can’t perform that action at this time.
0 commit comments