[Libreoffice-commits] core.git: compilerplugins/clang
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Wed May 12 12:37:36 UTC 2021
compilerplugins/clang/buriedassign.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit 21f92ce72ada2ea92ef4997a7a0fae986f023b6c
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed May 12 10:14:05 2021 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Wed May 12 14:36:59 2021 +0200
Guard against isCXX11ConstantExpr on dependent expression
> Assertion failed: (!isValueDependent() && "Expression evaluator can't be called on a dependent expression."), function isCXX11ConstantExpr, file ~/llvm/llvm-project/clang/lib/AST/ExprConstant.cpp, line 15540.
...as would have hit with a preliminary version of
ad48b2b02f83eed41fb1eb8d16de7e804156fcf1 "Optimized OString operator +=
overloads"
Change-Id: I652063b4eebd076973eaa57219df91cd1fbef312
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115462
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/compilerplugins/clang/buriedassign.cxx b/compilerplugins/clang/buriedassign.cxx
index 658ad4789d87..e1932c821e21 100644
--- a/compilerplugins/clang/buriedassign.cxx
+++ b/compilerplugins/clang/buriedassign.cxx
@@ -442,7 +442,8 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
if (auto binaryOp2
= dyn_cast<BinaryOperator>(binaryOp->getLHS()->IgnoreParenImpCasts()))
{
- if (binaryOp->getRHS()->isCXX11ConstantExpr(compiler.getASTContext())
+ if (!binaryOp->getRHS()->isValueDependent()
+ && binaryOp->getRHS()->isCXX11ConstantExpr(compiler.getASTContext())
&& isAssignmentOp(binaryOp2->getOpcode()))
report(DiagnosticsEngine::Warning, "buried assignment, rather put on own line",
compat::getBeginLoc(expr))
@@ -451,7 +452,8 @@ bool BuriedAssign::VisitIfStmt(IfStmt const* ifStmt)
if (auto binaryOp2
= dyn_cast<BinaryOperator>(binaryOp->getRHS()->IgnoreParenImpCasts()))
{
- if (binaryOp->getLHS()->isCXX11ConstantExpr(compiler.getASTContext())
+ if (!binaryOp->getLHS()->isValueDependent()
+ && binaryOp->getLHS()->isCXX11ConstantExpr(compiler.getASTContext())
&& isAssignmentOp(binaryOp2->getOpcode()))
report(DiagnosticsEngine::Warning, "buried assignment, rather put on own line",
compat::getBeginLoc(expr))
More information about the Libreoffice-commits
mailing list