compilerplugins/clang/buriedassign.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 21f92ce72ada2ea92ef4997a7a0fae986f023b6c
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed May 12 10:14:05 2021 +0200
Commit:     Stephan Bergmann <sberg...@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 <sberg...@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))
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to