Skip to content

Commit

Permalink
compatibility update
Browse files Browse the repository at this point in the history
  • Loading branch information
gojakuch committed Sep 11, 2024
1 parent 2c5a3fd commit b7b8a48
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/Differentiator/BaseForwardModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<VarDecl>(clonedDRE->getDecl());
auto* referencedDecl = cast<VarDecl>(clonedDRE->getDecl());
clonedDRE = BuildDeclRef(referencedDecl, NNS, clonedDRE->getFoundDecl());
}
} else
Expand Down
5 changes: 2 additions & 3 deletions lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1507,7 +1507,7 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context,
if (VD->getDeclContext() != m_Sema.CurContext) {
auto* ccDRE = dyn_cast<DeclRefExpr>(clonedDRE);
NestedNameSpecifier* NNS = DRE->getQualifier();
auto referencedDecl = cast<VarDecl>(ccDRE->getDecl());
auto* referencedDecl = cast<VarDecl>(ccDRE->getDecl());
clonedDRE = BuildDeclRef(referencedDecl, NNS, ccDRE->getFoundDecl());
}
// This case happens when ref-type variables have to become function
Expand Down Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Differentiator/VisitorBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b7b8a48

Please sign in to comment.