]> granicus.if.org Git - clang/commit
When evaluating a __builtin_constant_p conditional, always enter
authorRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 10 Sep 2019 21:24:09 +0000 (21:24 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Tue, 10 Sep 2019 21:24:09 +0000 (21:24 +0000)
commitba8c0cf0dfc245e4b6653c24d6e9a93fddcb06fa
treec11958f130f100df09761b559c6901d0cc581714
parent3396e1c447f5d6e4f8ee0e85256d2c7ca37691a4
When evaluating a __builtin_constant_p conditional, always enter
constant-folding mode regardless of the original evaluation mode.

In order for this to be correct, we need to track whether we're checking
for a potential constant expression or checking for undefined behavior
separately from the evaluation mode enum, since we don't want to clobber
those states when entering constant-folding mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@371557 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AST/ExprConstant.cpp
test/Sema/i-c-e.c