summaryrefslogtreecommitdiff
path: root/compilerplugins/clang/expressionalwayszero.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-22 09:37:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-22 14:46:34 +0200
commit9c346feb33bddfe9b52a8a4cbc70e81193ce3c95 (patch)
treeb79e28567b38b7233da09551057a06bae950a7d2 /compilerplugins/clang/expressionalwayszero.cxx
parentfd59a10734b1f7cc58579898be83644f5a747457 (diff)
Don't try to evaluate value of value-dependent Expr
...which causes asserts to fire since <https://github.com/llvm/llvm-project/ commit/04323c24a1ac9464471331d9f6499d3cb95d1ccd> "Added an assertion to constant evaluation enty points that prohibits …" Change-Id: Iafbf1cea85d15a38a71275d4cea8303bab500f6a Reviewed-on: https://gerrit.libreoffice.org/72723 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang/expressionalwayszero.cxx')
-rw-r--r--compilerplugins/clang/expressionalwayszero.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/compilerplugins/clang/expressionalwayszero.cxx b/compilerplugins/clang/expressionalwayszero.cxx
index c3bc0bb0730f..067aa9cc6dbd 100644
--- a/compilerplugins/clang/expressionalwayszero.cxx
+++ b/compilerplugins/clang/expressionalwayszero.cxx
@@ -135,7 +135,7 @@ std::unique_ptr<APSInt> ExpressionAlwaysZero::getExprValue(Expr const * expr)
return std::unique_ptr<APSInt>();
}
APSInt x1;
- if (compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
+ if (!expr->isValueDependent() && compat::EvaluateAsInt(expr, x1, compiler.getASTContext()))
return std::unique_ptr<APSInt>(new APSInt(x1));
return std::unique_ptr<APSInt>();
}