[clang] [Clang] Disable exceptions by default for GPU targets (PR #205402)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 23 11:58:38 PDT 2026


https://github.com/AaronBallman requested changes to this pull request.

These changes require a release note but I'd also expect this to be documented explicitly.

Another thing we need to be thinking about is how this plays with constexpr exceptions, which are a C++26 language feature. The way `-fno-cxx-exceptions` currently works disables exceptions entirely, so keywords like `try` are not valid: https://godbolt.org/z/Ef8h9vPMT -- this design is helpful for people who want to ensure no exception code is accidentally added. I think we'd want to continue to allow constant evaluation of exceptions even on GPU targets, right?

Finally, I think there's desire for GPUs to support a conforming C++ implementation, so won't exception handling be necessary to solve regardless at some point?

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


More information about the cfe-commits mailing list