Skip to content

Commit fb9cd1d

Browse files
committed
Tentative version of #149648
1 parent 452950e commit fb9cd1d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/AST/ByteCode/Interp.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,9 +1890,8 @@ inline bool CheckNull(InterpState &S, CodePtr OpPC) {
18901890
if (Ptr.isZero()) {
18911891
S.FFDiag(S.Current->getSource(OpPC),
18921892
diag::note_constexpr_dereferencing_null);
1893-
return false;
1893+
return S.noteUndefinedBehavior();
18941894
}
1895-
18961895
return true;
18971896
}
18981897

clang/test/AST/ByteCode/const-eval.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ typedef __INTPTR_TYPE__ intptr_t;
180180
const intptr_t A = (intptr_t)(((int*) 0) + 1);
181181
const intptr_t B = (intptr_t)(((char*)0) + 3);
182182
_Static_assert(A > B, "");
183+
int * GH149500_p = &(*(int *)0x400);
184+
static const void *GH149500_q = &(*(const struct sysrq_key_op *)0);
185+
183186
#else
184187
#error :(
185188
#endif

0 commit comments

Comments
 (0)