From b7b8a48a66c0d353f32e141ecd9bf923afa06f5f Mon Sep 17 00:00:00 2001 From: Atell Krasnopolski Date: Wed, 11 Sep 2024 11:51:44 +0200 Subject: [PATCH] compatibility update --- lib/Differentiator/BaseForwardModeVisitor.cpp | 2 +- lib/Differentiator/ReverseModeVisitor.cpp | 5 ++--- lib/Differentiator/VisitorBase.cpp | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/Differentiator/BaseForwardModeVisitor.cpp b/lib/Differentiator/BaseForwardModeVisitor.cpp index 67458a065..913a1251e 100644 --- a/lib/Differentiator/BaseForwardModeVisitor.cpp +++ b/lib/Differentiator/BaseForwardModeVisitor.cpp @@ -1045,7 +1045,7 @@ StmtDiff BaseForwardModeVisitor::VisitDeclRefExpr(const DeclRefExpr* DRE) { // to the underlying struct of a lambda. if (clonedDRE->getDecl()->getDeclContext() != m_Sema.CurContext) { NestedNameSpecifier* NNS = DRE->getQualifier(); - auto referencedDecl = cast(clonedDRE->getDecl()); + auto* referencedDecl = cast(clonedDRE->getDecl()); clonedDRE = BuildDeclRef(referencedDecl, NNS, clonedDRE->getFoundDecl()); } } else diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 3e589682d..928d1ac88 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -1507,7 +1507,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, if (VD->getDeclContext() != m_Sema.CurContext) { auto* ccDRE = dyn_cast(clonedDRE); NestedNameSpecifier* NNS = DRE->getQualifier(); - auto referencedDecl = cast(ccDRE->getDecl()); + auto* referencedDecl = cast(ccDRE->getDecl()); clonedDRE = BuildDeclRef(referencedDecl, NNS, ccDRE->getFoundDecl()); } // This case happens when ref-type variables have to become function @@ -2135,8 +2135,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, CallArgs.insert(CallArgs.begin(), Clone(OCE->getArg(0))); call = CXXOperatorCallExpr::Create( m_Context, OCE->getOperator(), Clone(CE->getCallee()), CallArgs, - FD->getCallResultType(), VK_LValue, Loc, - CE->getFPFeaturesInEffect(LangOptions())); + FD->getCallResultType(), VK_LValue, Loc, FPOptions()); return StmtDiff(call); } diff --git a/lib/Differentiator/VisitorBase.cpp b/lib/Differentiator/VisitorBase.cpp index 16318e1ea..47bdfd28b 100644 --- a/lib/Differentiator/VisitorBase.cpp +++ b/lib/Differentiator/VisitorBase.cpp @@ -258,8 +258,8 @@ namespace clad { std::reverse(NNChain.begin(), NNChain.end()); - for (size_t i = 0; i < NNChain.size(); ++i) { - NNS = NNChain[i]; + for (auto& n : NNChain) { + NNS = n; if (NNS->getKind() == NestedNameSpecifier::Namespace) { NamespaceDecl* NS = NNS->getAsNamespace(); CSS.Extend(m_Context, NS, noLoc, noLoc);