From c41795086200386943a246cbaf8d86f3011f8c91 Mon Sep 17 00:00:00 2001 From: "petro.zarytskyi" Date: Mon, 9 Dec 2024 09:56:09 +0200 Subject: [PATCH] produce both a warning and a note --- lib/Differentiator/ReverseModeVisitor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Differentiator/ReverseModeVisitor.cpp b/lib/Differentiator/ReverseModeVisitor.cpp index e8c19c5b6..ec4862b3f 100644 --- a/lib/Differentiator/ReverseModeVisitor.cpp +++ b/lib/Differentiator/ReverseModeVisitor.cpp @@ -4280,10 +4280,14 @@ Expr* getArraySizeExpr(const ArrayType* AT, ASTContext& context, if (Expr* customReverseForwFnCall = BuildCallToCustomForwPassFn( CE->getConstructor(), primalArgs, reverseForwAdjointArgs, /*baseExpr=*/nullptr)) { - if (RD->isAggregate()) + if (RD->isAggregate()) { diag(DiagnosticsEngine::Note, CE->getConstructor()->getBeginLoc(), "No need to provide a custom constructor forward sweep for an " "aggregate type."); + diag(DiagnosticsEngine::Warning, CE->getBeginLoc(), + "No need to provide a custom constructor forward sweep for an " + "aggregate type."); + } Expr* callRes = StoreAndRef(customReverseForwFnCall); Expr* val = utils::BuildMemberExpr(m_Sema, getCurrentScope(), callRes, "value");