]> granicus.if.org Git - clang/commitdiff
PR14729: Fix typo in CheckICE for BinaryConditionalOperators.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 28 Dec 2012 12:53:55 +0000 (12:53 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 28 Dec 2012 12:53:55 +0000 (12:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171191 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ExprConstant.cpp
test/Sema/i-c-e.c

index d59763869919dc3f98ee8f3963c48523fd6ab79b..41132741a5603bc3cf4e50b0800fe99cee7e99fd 100644 (file)
@@ -6734,7 +6734,7 @@ static ICEDiag CheckICE(const Expr* E, ASTContext &Ctx) {
     if (FalseResult.Val == 2) return FalseResult;
     if (CommonResult.Val == 1) return CommonResult;
     if (FalseResult.Val == 1 &&
-        Exp->getCommon()->EvaluateKnownConstInt(Ctx) == 0) return NoDiag();
+        Exp->getCommon()->EvaluateKnownConstInt(Ctx) != 0) return NoDiag();
     return FalseResult;
   }
   case Expr::ConditionalOperatorClass: {
index e7b42c4e9a14422631141fe80f2ea3f1a6f9bb10..7749b6c1a0f064d0db99abeeb6409ae4a018e501 100644 (file)
@@ -73,3 +73,5 @@ int illegaldiv4[0 / (1 / 0)]; // expected-error {{variable length array declarat
 int chooseexpr[__builtin_choose_expr(1, 1, expr)];
 int realop[(__real__ 4) == 4 ? 1 : -1];
 int imagop[(__imag__ 4) == 0 ? 1 : -1];
+
+int *PR14729 = 0 ?: 1/0; // expected-error {{not a compile-time constant}} expected-warning 3{{}}