[clang] [Clang] FunctionEffects: accept throw-only callees from noexcept callers (PR #238401)

Ambrose Leeb via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 09:54:28 PST 2026


================
@@ -88,12 +88,17 @@ struct Violation {
   SourceLocation Loc;
   const Decl *Callee =
       nullptr; // Only valid for ViolationIDs Calls{Decl,Expr}WithoutEffect.
+  // True if the violation is, or is solely due to, an exception which
+  // propagates out of the function uncaught. A noexcept caller turns such an
+  // exception into termination, so it need not treat the callee as unsafe.
+  bool ThrowOnly = false;
----------------
Sirraide wrote:

I feel like if this approach is possible (i.e. splitting this into `ThrowsExceptions` and `CatchesExceptions`) then I don't think changing the diagnostic wording is an issue.

Also, remind me, does _catching_ allocate/block on some systems? I don’t think it would w/ the kind of exception handling I’m familiar w/, but perhaps there are weirder implementations out there

https://github.com/llvm/llvm-project/pull/238401


More information about the cfe-commits mailing list