forked from OSchip/llvm-project
PR27989: only enqueue binary operators into the data recursive int expression
evaluator if they are actually int expressions. llvm-svn: 271754
This commit is contained in:
parent
2905d54af3
commit
3a09d8be7c
|
@ -7112,7 +7112,9 @@ public:
|
|||
static bool shouldEnqueue(const BinaryOperator *E) {
|
||||
return E->getOpcode() == BO_Comma ||
|
||||
E->isLogicalOp() ||
|
||||
(E->getLHS()->getType()->isIntegralOrEnumerationType() &&
|
||||
(E->isRValue() &&
|
||||
E->getType()->isIntegralOrEnumerationType() &&
|
||||
E->getLHS()->getType()->isIntegralOrEnumerationType() &&
|
||||
E->getRHS()->getType()->isIntegralOrEnumerationType());
|
||||
}
|
||||
|
||||
|
|
|
@ -949,3 +949,11 @@ namespace SpeculativeEvalWrites {
|
|||
|
||||
static_assert(!f(), "");
|
||||
}
|
||||
|
||||
namespace PR27989 {
|
||||
constexpr int f(int n) {
|
||||
int a = (n = 1, 0);
|
||||
return n;
|
||||
}
|
||||
static_assert(f(0) == 1, "");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue