Author: dim Date: Fri Aug 23 18:02:37 2013 New Revision: 254725 URL: http://svnweb.freebsd.org/changeset/base/254725
Log: MFC r254581: 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: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Fri Aug 23 18:01:58 2013 (r254724) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp Fri Aug 23 18:02:37 2013 (r254725) @@ -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. _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"