ChuanqiXu added a comment. I am curious about the behavior if we removed the guard `if (OrigResultType.getBeginLoc().isValid())`.
================ Comment at: clang/lib/Sema/SemaStmt.cpp:3804-3807 + if (DAR != DAR_Succeeded) { + if (OrigResultType.getBeginLoc().isValid()) + Diag(OrigResultType.getBeginLoc(), diag::note_deducing_return_type_for) + << FD << OrigResultType.getSourceRange(); ---------------- What if merge this one into above block where the diagnostic happens. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119778/new/ https://reviews.llvm.org/D119778 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits