[PATCH] D69762: [Diagnostics] Try to improve warning message for -Wreturn-type

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 9 05:21:44 PST 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

In D69762#1739022 <https://reviews.llvm.org/D69762#1739022>, @xbolva00 wrote:

> We cannot use it for block; it is a hard error. Corountine and function can be merged as suggested.


We can use `.Text` to share diagnostic text between warnings and errors (we do this elsewhere), but I don't insist for this patch.

LGTM aside from a commenting request.



================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:578
 
 def warn_maybe_falloff_nonvoid_function : Warning<
+  "non-void function does not return a value in all control paths">,
----------------
A FIXME comment that we'd like to combine these diagnostics eventually would be appreciated.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:6860
     "lambda declared 'noreturn' should not return">;
   def warn_maybe_falloff_nonvoid_lambda : Warning<
+    "non-void lambda does not return a value in all control paths">,
----------------
And maybe move these two up closer to the other duplicate-ish diagnostics.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69762/new/

https://reviews.llvm.org/D69762





More information about the cfe-commits mailing list