[clang] [clang][seh]: Fix c++ destructors when c++ exceptions are disabled (PR #151836)

via cfe-commits cfe-commits at lists.llvm.org
Sun Aug 3 05:07:01 PDT 2025


Qwinci wrote:

> Is the problem happening when enabling async-exceptions but not cxx-exceptions on c++ objects? I'm not sure if it's a valid scenario. The designed requires `cxx-exceptions`, see descriptions in [797ad70](https://github.com/llvm/llvm-project/commit/797ad701522988e212495285dade8efac41a24d4)
> 
> Maybe we can emit an error for such case instead?
Actually yeah my bad, looks like its invalid on MSVC to have objects with destructors in a function where __try/__except are used. Ill see if I can change this to be a check for that instead (and this is unrelated to exceptions being enabled, at least in my experience the C style seh __try/__except work just fine with async-exceptions + cxx exceptions disabled, I'd like to keep it that way as I use them in bare-metal C++ code where enabling c++ exceptions is undesirable plus async-exceptions should be usable in C code too).

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


More information about the cfe-commits mailing list