Disable std::exception formatter when exceptions are disabled. - #4904
Disable std::exception formatter when exceptions are disabled.#4904cjacek wants to merge 1 commit into
Conversation
dca523d to
f1c4546
Compare
vitaut
left a comment
There was a problem hiding this comment.
Thanks for the PR, but I don’t think we should disable the std::exception formatter itself. Instead, please disable only the minimal part that relies on try/catch. Also, could you post the full compiler error message?
…tions are disabled. Fixes building with Clang 20 and older with -fno-exceptions, which treats try/catch usage as an error.
f1c4546 to
af6e646
Compare
|
Thanks for the review. The new version disables only minimal part of The error message is: Here is a compiler explorer repro: https://godbolt.org/z/7jKncahEK It's specific to usage in templates that's now allowed. Outside templates it's always an error. |
| } | ||
| }; | ||
|
|
||
| #if FMT_USE_EXCEPTIONS |
There was a problem hiding this comment.
Presence of std::exception_ptr doesn't depend on whether exceptions are enabled or disabled and in general we prefer not to make formatter availability depend on configuration. Let's move this to the format function and only guard try/catch block there giving "unknown exception" if exceptions are disabled.
Fixes building with Clang 20 and older with -fno-exceptions, which treats try/catch usage as an error.
Fixes FEX builds: FEX-Emu/FEX#5870