diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 09:37:53 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-05-22 14:46:34 +0200 |
commit | 9c346feb33bddfe9b52a8a4cbc70e81193ce3c95 (patch) | |
tree | b79e28567b38b7233da09551057a06bae950a7d2 /compilerplugins/clang | |
parent | current ccache does not correctly handle PCH in depend mode (diff) | |
download | core-9c346feb33bddfe9b52a8a4cbc70e81193ce3c95.tar.gz core-9c346feb33bddfe9b52a8a4cbc70e81193ce3c95.zip |
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')
-rw-r--r-- | compilerplugins/clang/empty.cxx | 2 | ||||
-rw-r--r-- | compilerplugins/clang/expressionalwayszero.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compilerplugins/clang/empty.cxx b/compilerplugins/clang/empty.cxx index 4d48ca620087..5cf5a023e54c 100644 --- a/compilerplugins/clang/empty.cxx +++ b/compilerplugins/clang/empty.cxx @@ -100,7 +100,7 @@ private: return; } APSInt val; - if (!rhs->isIntegerConstantExpr(val, compiler.getASTContext())) + if (rhs->isValueDependent() || !rhs->isIntegerConstantExpr(val, compiler.getASTContext())) { return; } 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>(); } |