[PATCH] D119778: [clang] Add a note "deducing return type for 'foo'"

Chuanqi Xu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 14 18:19:44 PST 2022


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



More information about the cfe-commits mailing list