[PATCH] D33537: [clang-tidy] Exception Escape Checker

Balogh, Ádám via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 7 06:07:56 PDT 2018


baloghadamsoftware marked 10 inline comments as done.
baloghadamsoftware added inline comments.


================
Comment at: test/clang-tidy/bugprone-exception-escape.cpp:178
+void indirect_implicit() noexcept {
+  // CHECK-MESSAGES: :[[@LINE-1]]:6: warning: function 'indirect_implicit' throws
+  implicit_int_thrower();
----------------
dberris wrote:
> How deep does this go? Say we have a call to a function that's extern which doesn't have 'noexcept' nor a dynamic exception specifier -- do we assume that the call to an extern function may throw? Does that warn? What does the warning look like? Should it warn? How about when you call a function through a function pointer?
> 
> The documentation should cover these cases and/or more explicitly say in the warning that an exception may throw in a noexcept function (rather than just "function <...> throws").
We take the most conservative way here. We assume that a function throws if and only if its body has a throw statement or its header has the (old) throw() exception specification. We do not follow function pointers.


https://reviews.llvm.org/D33537





More information about the cfe-commits mailing list