RFR: 8255082: HotSpot Style Guide should permit noexcept

Julian Waters jwaters at openjdk.org
Mon Jun 2 08:46:52 UTC 2025


On Mon, 2 Jun 2025 08:20:57 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> I forgot to mention that of course the current code is out of conformance with this, since we're currently using `throw()` to declare allocation functions as being nothrow. Once this style guide is approved, we (probably meaning I) will need to update the code accordingly. Probably not as a big query-replace either, as I've already found one mistake.

If it's easier I can bring the original change to noexcept Pull Request back from the dead and remove the merge mistakes that leaked in from my other branch, which shouldn't really be that difficult to do. Not sure which code is potentially marked throw() wrongly though.

Alternatively, we could just keep throw() alongside noexcept for code that already uses it, to avoid code churn. They do mean the same thing in C++17, after all (I was going to mention that there are papers for static exception specifications that propose reintroducing throw() back into C++ last I remembered, but realized that this likely doesn't mean much for us now, so this point can be ignored)

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25574#issuecomment-2929473632


More information about the hotspot-dev mailing list