Skip to content

Commit

Permalink
produce both a warning and a note
Browse files Browse the repository at this point in the history
  • Loading branch information
PetroZarytskyi committed Dec 9, 2024
1 parent 95300e1 commit c417950
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Differentiator/ReverseModeVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit c417950

Please sign in to comment.