[PATCH] D20693: [clang-tidy] New checker to replace dynamic exception specifications

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 11:51:26 PST 2017


aaron.ballman added a comment.

In https://reviews.llvm.org/D20693#638062, @mgehre wrote:

> Hi,
>  this is a good idea for a check.
>
> I would prefer when the FixIt just removes throw(A,B) specifier, instead of replacing it by noexcept(false),
>  because noexcept(false) means the same things as having no noexcept specifier at all.
>  And less code to read means its easier to understand.


If the API designer explicitly specified "this function can throw A or B", I think a more helpful FixIt is to specify `noexcept(false)` explicitly rather than leave off any information about the exception specification. The explicit nature of the dynamic exception specification suggests the API designer intended for the user to know more information about whether the function throws or not, so it's a bit hostile to replace that with no information about whether the function throws or not (even if it's functionally equivalent).


https://reviews.llvm.org/D20693





More information about the cfe-commits mailing list