[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Wed Mar 25 13:38:18 PDT 2015


 compilerplugins/clang/constantfunction.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 44753f7cf05f502e566fe97231883a047d1f120a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Wed Mar 25 21:37:48 2015 +0100

    Expr::EvaluateAs... does not work for type-dependent expressions
    
    Change-Id: Iea1cd468528d00ffa07e13b2063ca5fce5cc4fae

diff --git a/compilerplugins/clang/constantfunction.cxx b/compilerplugins/clang/constantfunction.cxx
index 49a2c10..c3cd2b4 100644
--- a/compilerplugins/clang/constantfunction.cxx
+++ b/compilerplugins/clang/constantfunction.cxx
@@ -450,8 +450,9 @@ bool ConstantFunction::VisitFunctionDecl(const FunctionDecl * pFunctionDecl) {
                 // && !pReturnStmt->getRetValue()->isEvaluatable(compiler.getASTContext())) {
                 bool aBoolResult;
                 llvm::APSInt aIntResult;
-                if (!pReturnStmt->getRetValue()->EvaluateAsBooleanCondition(aBoolResult, compiler.getASTContext())
-                    && !pReturnStmt->getRetValue()->EvaluateAsInt(aIntResult, compiler.getASTContext()))
+                if (pReturnStmt->getRetValue()->isTypeDependent()
+                    || (!pReturnStmt->getRetValue()->EvaluateAsBooleanCondition(aBoolResult, compiler.getASTContext())
+                        && !pReturnStmt->getRetValue()->EvaluateAsInt(aIntResult, compiler.getASTContext())))
                 {
                     return true;
                 }


More information about the Libreoffice-commits mailing list