RFR: 8314488: Compile the JDK as C++17 [v2]

Kim Barrett kbarrett at openjdk.org
Fri Dec 15 16:22:48 UTC 2023


On Fri, 15 Dec 2023 08:08:10 GMT, Julian Waters <jwaters at openjdk.org> wrote:

>> Implementation of [JEP draft: Compile the JDK as C++17](https://bugs.openjdk.org/browse/JDK-8310260)
>
> Julian Waters has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Merge branch 'openjdk:master' into patch-7
>  - Revert vm_version_linux_riscv.cpp
>  - vm_version_linux_riscv.cpp
>  - allocation.cpp
>  - 8310260

I agree that before throwing this switch, we need to look at some specific
issues that might need to be addressed, discuss the benefits, and also the
costs.

As was discussed for the change to C++14, there is *never* a good time to
start introducing the use of new language features as far as backporting is
concerned, unless one is going to backport the language change too. We didn't
do that for C++14, and I don't think we are going to (nor should) do it for
C++17 either.  But backporting concerns can't be all powerful, as that will
forever prevent potentially significant improvements.

I started to make a list of new language features that seem particularly
beneficial or otherwise important.  I was going to write style guide updates
for these, but haven't gotten very far with that yet.

P0035R4: Dynamic memory allocation for over-aligned data
P0135R1: Guaranteed copy elision
P0145R3: Refining Expression Evaluation Order for Idiomatic C++
P0292R2: constexpr if
P0091R3/P0512R0: Template argument deduction for class templates

Here are some others that might be of interest to us.
N4268: Allow constant evaluation for all non-type template arguments
N3928: Extending static_assert
P0118R1: [[fallthrough]] attribute
P0189R1: [[nodiscard]] attribute
P0212R1: [[maybe_unused]] attribute
P0170R1: Wording for constexpr lambda
P0283R2: Ignoring unsupported non-standard attributes 
P0061R1: __has_include for C++17
P0386R2: Inline variables

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

PR Comment: https://git.openjdk.org/jdk/pull/14988#issuecomment-1858136247


More information about the build-dev mailing list