diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index 7146d070f..966538af9 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -216,7 +216,8 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, ++i) { auto* overloadParam = overloadParams[i]; auto* gradientParam = gradientParams[i]; - auto* init = m_Sema.ImpCastExprToType(BuildDeclRef(overloadParam), gradientParam->getType(), clang::CK_BitCast).get(); + TypeSourceInfo* typeInfo = m_Context.getTrivialTypeSourceInfo(gradientParam->getType()); + auto* init = m_Sema.BuildCStyleCastExpr(noLoc, typeInfo, noLoc, BuildDeclRef(overloadParam)).get(); auto* gradientVD = BuildGlobalVarDecl(gradientParam->getType(), gradientParam->getName(),