Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix C++20 incompatibility from using exception specifications #133

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

Lastique
Copy link
Member

@Lastique Lastique commented Apr 7, 2024

C++20 removed support for exception specifications, so at least clang-19 is now emitting errors on them. Replaced exception specifications with BOOST_NOEXCEPT_OR_NOTHROW, which converts throw() to noexcept, but keeps the code formally compatible with C++03.

This has been brought up during Boost 1.85.0 release preparation.

This PR is similar to the following PRs, and once this one or one of those is merged, the others can be closed:

#118 - this PR is similar to that one, but resolves merge conflicts.
#129 - unlike that PR, this one does not remove exception specifications from destructors, which keeps the code formally compatible with C++03.

This PR also updates GitHub Actions config to fix CI failures on clang-13 through 15 due to their incompatibility with libstdc++-13 in C++23 mode. (The failures are unrelated to this PR.)

@Lastique
Copy link
Member Author

Lastique commented Apr 7, 2024

@pdimov Please, take a look.

@Lastique Lastique force-pushed the feature/fix_cxx23_nothrow branch 2 times, most recently from 0617459 to 86e6f81 Compare April 7, 2024 11:13
@Lastique Lastique changed the title Fix C++23 incompatibility from using exception specifications Fix C++20 incompatibility from using exception specifications Apr 7, 2024
@Lastique
Copy link
Member Author

Lastique commented Apr 7, 2024

Actually, throw() was removed even in C++20, so I've updated the description of the PR.

C++20 removed support for `throw()` exception specifications, so at
least clang-19 is now emitting errors on them. Replaced exception
specifications with BOOST_NOEXCEPT_OR_NOTHROW, which converts `throw()`
to `noexcept`, but keeps the code formally compatible with C++03.
@pdimov pdimov merged commit 8f848d8 into boostorg:develop Apr 7, 2024
54 of 55 checks passed
@Lastique Lastique deleted the feature/fix_cxx23_nothrow branch April 7, 2024 20:58
@Lastique
Copy link
Member Author

Lastique commented Apr 7, 2024

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants