diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 2498bf46f..8fdd41809 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -1894,11 +1894,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, const auto* PVD = FD->getParamDecl( i - static_cast(isMethodOperatorCall)); if (PVD->getType()->isRValueReferenceType()) { - IdentifierInfo* PVDII = PVD->getIdentifier(); IdentifierInfo* RValueName = CreateUniqueIdentifier("_r"); - auto* param = CloneParmVarDecl(PVD, PVDII); - param->setDeclName(RValueName); - PVD = param; + const_cast(PVD)->setDeclName(RValueName); } StmtDiff argDiff{}; // We do not need to create result arg for arguments passed by reference