| Issue |
83521
|
| Summary |
Regression: -fnon-call-exceptions Option No Longer Works as Expected from Clang 12 Onwards
|
| Labels |
clang
|
| Assignees |
|
| Reporter |
yanwei1983
|
I've encountered an issue with the `-fnon-call-exceptions` compiler option that seems to have regressed starting from Clang 12. This option was functional up to Clang 11, allowing exceptions to be thrown from signal handlers and caught by C++ catch blocks as expected. However, from Clang 12 onwards, this functionality appears to have been lost or broken.
### Description:
The `-fnon-call-exceptions` option is critical for my projects, as it allows exceptions to be thrown from signal handlers and then caught by surrounding C++ try-catch blocks. This functionality was working as expected up to and including Clang 11, but has ceased to work from Clang 12 onwards.
### Steps to Reproduce:
I have prepared a minimal example to demonstrate this issue, which can be found at [godbolt](https://godbolt.org/z/8fYM5nK91). This example works as expected when compiled with Clang 11 or earlier versions, where the exception thrown in the signal handler is caught by the C++ catch block. However, when compiled with Clang 12 or later, including the latest Clang 16, the exception is no longer caught as expected.
### Expected Behavior:
When compiled with `-fnon-call-exceptions`, any exceptions thrown in signal handlers should be able to be caught by C++ catch blocks.
### Actual Behavior:
Starting from Clang 12, compiling with `-fnon-call-exceptions` no longer allows exceptions thrown in signal handlers to be caught by C++ catch blocks.
### Request:
I am requesting assistance to either restore the previous functionality of `-fnon-call-exceptions` in the latest version of Clang (preferably Clang 17) or to provide guidance on a workaround or alternative approach to achieve the same functionality.
Thank you for your attention to this matter. I am looking forward to your guidance and assistance.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs