[PATCH] D41456: [clang-tidy] readability-else-after-return: also diagnose noreturn function calls.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 06:03:47 PST 2017

lebedev.ri added a comment.

In https://reviews.llvm.org/D41456#961826, @malcolm.parsons wrote:

> This check could also handle else after goto.

Yes, certainly. Though i'm not too sure on the restrictions.
The obvious precondition is, the label can to be defined anywhere **except** after the `goto` in the same (or child) compound statement:

  if(condition) {
    goto label:
    label: ; // <- false-positive
  } else ...

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list