[PATCH] D19201: [clang-tidy] misc-throw-with-noexcept

Stanisław Barzowski via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 31 09:41:12 PDT 2017


sbarzowski added a comment.

In https://reviews.llvm.org/D19201#768693, @baloghadamsoftware wrote:

> There is a patch (https://reviews.llvm.org/D33537) for a check which is a superset of this: [...] A more important difference is that we traverse the whole call-chain and check all the throw statements and try-catch blocks so indirectly throwing functions are also reported and no flase positives are caused by throw and catch in the same try block.


As a matter of fact this check also handles catching, so no false positive here.

But let's get to the point:
For me https://reviews.llvm.org/D33537 and https://reviews.llvm.org/D33333 seem like clearly better options and I think we should proceed with one or both of them instead of this one. However they don't handle (yet) everything that this check does. In particular they don't seem to handle noexcept decided during compilation (example: https://pastebin.com/1jZzRAbC). I've run into this case when I tried this check on HHVM and its dependencies.

Quoting @aaron.ballman

> As for #3 [noexcept decided during compilation], I would consider that to be a false-positive as well. A computed noexcept clause is going to be very common, especially in generic code. I think it's probably more important to get this one right than #2 [throw and catch in the same function].

As for this check, I think the development will stop here, no point in duplicating the effort. Maybe the test cases will be of some use to you.


https://reviews.llvm.org/D19201





More information about the cfe-commits mailing list