diff options
Diffstat (limited to 'compilerplugins/clang/constantfunction.cxx')
-rw-r--r-- | compilerplugins/clang/constantfunction.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compilerplugins/clang/constantfunction.cxx b/compilerplugins/clang/constantfunction.cxx index 49a2c10f299d..c3cd2b43bf73 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; } |