The readability-else-after-return check was not warning about
an else after a throw of an exception that had arguments that needed
to be cleaned up.
Details
Details
Diff Detail
Diff Detail
- Repository
- rCTE Clang Tools Extra
Event Timeline
Comment Actions
How about also matching on call to functions with no-return attribute?
i.e.
[[noreturn]] my_die(); void do_stuff(); void fn(int x) { if(!x) my_die(); else // <- since `my_die()` will never return, `else` is not really needed. do_stuff(); }
Comment Actions
LGTM with a minor formatting nit.
test/clang-tidy/readability-else-after-return.cpp | ||
---|---|---|
7 | Indentation is incorrect here. |
Indentation is incorrect here.