From 564730a85769cb539f21ec2b9d0054eb9abf60a3 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Mon, 1 Dec 2008 02:07:06 +0000 Subject: Emit the correct diagnostic when a comma is in an ICE. llvm-svn: 60316 --- clang/lib/AST/ExprConstant.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp index 855385cf988..b9f3c77363a 100644 --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -516,13 +516,13 @@ bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { // Evaluate the side that actually matters; this needs to be // handled specially because calling Visit() on the LHS can // have strange results when it doesn't have an integral type. - if (Visit(E->getRHS())) - return true; - + if (!Visit(E->getRHS())) + return false; + if (Info.ShortCircuit) return Extension(E->getOperatorLoc(), diag::note_comma_in_ice, E); - return false; + return true; } if (E->isLogicalOp()) { -- cgit v1.2.3