diff options
-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>(); } |