diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-28 12:53:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-28 12:53:55 +0000 |
commit | 74fc72143af0b518aa5289e35de128a18aa58f1f (patch) | |
tree | 40233cd83aa45347a0274ccee5b05825aaf56b93 | |
parent | de1a4874025851aac3f1e1b7746ee40060597e26 (diff) | |
download | bcm5719-llvm-74fc72143af0b518aa5289e35de128a18aa58f1f.tar.gz bcm5719-llvm-74fc72143af0b518aa5289e35de128a18aa58f1f.zip |
PR14729: Fix typo in CheckICE for BinaryConditionalOperators.
llvm-svn: 171191
-rw-r--r-- | clang/lib/AST/ExprConstant.cpp | 2 | ||||
-rw-r--r-- | clang/test/Sema/i-c-e.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index d5976386991..41132741a56 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -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: { diff --git a/clang/test/Sema/i-c-e.c b/clang/test/Sema/i-c-e.c index e7b42c4e9a1..7749b6c1a0f 100644 --- a/clang/test/Sema/i-c-e.c +++ b/clang/test/Sema/i-c-e.c @@ -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{{}} |