From 4ad3336c93769f995b4c3ae009a423f44ecf2a1f Mon Sep 17 00:00:00 2001 From: "petro.zarytskyi" Date: Sun, 6 Jul 2025 17:48:01 +0200 Subject: [PATCH] Fix broken master after merging #1438 and #1437 at the same time. This PR addresses 2 problems that arose after that: a mismatch in the signature of a new custom `reverse_forw` and a new tape popping up in a test. --- include/clad/Differentiator/STLBuiltins.h | 2 +- lib/Differentiator/ReverseModeVisitor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/clad/Differentiator/STLBuiltins.h b/include/clad/Differentiator/STLBuiltins.h index 40155c571..fd027ac89 100644 --- a/include/clad/Differentiator/STLBuiltins.h +++ b/include/clad/Differentiator/STLBuiltins.h @@ -729,7 +729,7 @@ template < typename It, typename ::clad::custom_derivatives::helpers::is_iterator::type = 1> clad::ValueAndAdjoint operator_plus_plus_reverse_forw(It* it, int, - It* d_it, int*) { + It* d_it, int) { return {++*it, ++*d_it}; } diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 794443625..bdb6ba4da 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -2039,7 +2039,7 @@ Expr* ReverseModeVisitor::getStdInitListSizeExpr(const Expr* E) { CallArgs, Loc, CUDAExecConfig) .get(); } - if (call->getType()->isVoidType()) + if (!needsForwPass) return StmtDiff(call); Expr* callRes = nullptr; if (isInsideLoop)