diff --git a/lib/Differentiator/VisitorBase.cpp b/lib/Differentiator/VisitorBase.cpp index 20e18795b..87c55b4cd 100644 --- a/lib/Differentiator/VisitorBase.cpp +++ b/lib/Differentiator/VisitorBase.cpp @@ -916,7 +916,8 @@ namespace clad { // Account for the this pointer. if (isa(m_DiffReq.Function) && - !utils::IsStaticMethod(m_DiffReq.Function)) + !utils::IsStaticMethod(m_DiffReq.Function) && + (!m_DiffReq.Functor || m_DiffReq.Mode != DiffMode::jacobian)) ++numOfDerivativeParams; // All output parameters will be of type `void*`. These // parameters will be casted to correct type before the call to the actual