Integrated: 8367051: Build failure with clang on linux and AIX after switch to C++17

Kim Barrett kbarrett at openjdk.org
Tue Sep 9 15:07:07 UTC 2025


On Tue, 9 Sep 2025 01:00:30 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

> 8367051: Build failure with clang on linux and AIX after switch to C++17
> 
> Please review this change to work around build failures with clang on some
> platforms after the switch to C++17.
> 
> C++17 made the exception specification part of a function's type. Some
> standard libraries declare C library functions as noexcept. If HotSpot has a
> forbidding declaration for such a function (without a noexcept spec) before
> including the standard library header, clang reports this as an error (not
> just a warning that could be suppressed, a hard error). If the standard
> library header containing the noexpect declaration is first, then clang
> does *not* complain about the following forbidding declaration that doesn't
> have an exception spec. gcc permits either order.
> 
> So the workaround consists of ensuring all the standard library headers for
> forbidden functions are included before the forbidding declarations.
> 
> Exploration of other approaches to follow, but for now we need to fix the
> build errors.
> 
> Testing: mach5 tier1
> GHA saniticy checks in progress

This pull request has now been integrated.

Changeset: b653ae92
Author:    Kim Barrett <kbarrett at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/b653ae92d5941202780873fad1a7cefd51e4e7a8
Stats:     9 lines in 1 file changed: 9 ins; 0 del; 0 mod

8367051: Build failure with clang on linux and AIX after switch to C++17

Reviewed-by: dholmes, ayang, mbaesken, mdoerr

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

PR: https://git.openjdk.org/jdk/pull/27154


More information about the hotspot-dev mailing list