[PATCH] D139195: [-Wmissing-noreturn] Detect non-void noreturn function candidates

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 2 05:39:13 PST 2022


steakhal created this revision.
steakhal added reviewers: NoQ, xazax.hun, aaron.ballman.
Herald added subscribers: martong, rnkovacs.
Herald added a reviewer: Szelethus.
Herald added a project: All.
steakhal requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Previously, only `void` returning functions were considered for `noreturn`
attribute candidates. This patch removes this artificial restriction.

Notice the zero-initializations of the `CheckFallThroughDiagnostics`
objects. In some cases, such as inside `MakeForCoroutine()`, some struct
members were left uninitialized (probably by accident).
This way all the fields will be zero-initialized, preventing accidental
uninitialized reads during diagnostics construction.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139195

Files:
  clang/lib/Sema/AnalysisBasedWarnings.cpp
  clang/test/SemaCXX/return-noreturn.cpp
  clang/test/SemaObjC/return.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139195.479610.patch
Type: text/x-patch
Size: 8476 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221202/77449f02/attachment-0001.bin>


More information about the cfe-commits mailing list