summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
index dd05b82..a9179fd 100644
--- a/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
+++ b/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
@@ -8884,14 +8884,16 @@ EmitDiagnosticForLogicalAndInLogicalOr(Sema &Self, SourceLocation OpLoc,
/// 'true'.
static bool EvaluatesAsTrue(Sema &S, Expr *E) {
bool Res;
- return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res;
+ return !E->isValueDependent() &&
+ E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && Res;
}
/// \brief Returns true if the given expression can be evaluated as a constant
/// 'false'.
static bool EvaluatesAsFalse(Sema &S, Expr *E) {
bool Res;
- return E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res;
+ return !E->isValueDependent() &&
+ E->EvaluateAsBooleanCondition(Res, S.getASTContext()) && !Res;
}
/// \brief Look for '&&' in the left hand of a '||' expr.
OpenPOWER on IntegriCloud