[clang] [clang][Sema] Diagnose exceptions only in non-dependent context in discarded `try/catch/throw` blocks (PR #139859)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon May 19 12:12:25 PDT 2025


erichkeane wrote:

So @Rajveer100 : I think I bottomed out with Aaron.  I think the solution of 'create a function to diagnose these, but only if not in a dependent `DeclContext`', then call this both from where we do the current checking, plus during `TreeTransform` of these things is the 'right' way forward.  So you're close!

We can discuss the REST of the proposals/ideas in the future if we get an RFC from someone.

In addition, I think there is value to considering an additional flag that works with `-fno-exceptions`/etc to allow in `consteval` functions, which I think gets us most of the `constexpr` uses that folks will care about, and be implimentable trivially after this patch is merged.

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


More information about the cfe-commits mailing list