Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Aug 2013 20:46:29 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r254581 - head/contrib/llvm/tools/clang/lib/Sema
Message-ID:  <201308202046.r7KKkT8S011366@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Tue Aug 20 20:46:29 2013
New Revision: 254581
URL: http://svnweb.freebsd.org/changeset/base/254581

Log:
  Pull in r188716 from upstream clang trunk:
  
    PR16727: don't try to evaluate a potentially value-dependent
    expression when checking for missing parens in &&/|| expressions.
  
  This fixes an assertion encountered when building the lang/sdcc port.
  
  Reported by:	kwm

Modified:
  head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp

Modified: head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp
==============================================================================
--- head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp	Tue Aug 20 20:40:20 2013	(r254580)
+++ head/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp	Tue Aug 20 20:46:29 2013	(r254581)
@@ -8884,14 +8884,16 @@ EmitDiagnosticForLogicalAndInLogicalOr(S
 /// '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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201308202046.r7KKkT8S011366>