RFR: 8331352: error: template-id not allowed for constructor/destructor in C++20

Julian Waters jwaters at openjdk.org
Tue Apr 30 09:17:05 UTC 2024


On Tue, 30 Apr 2024 02:01:01 GMT, Jan Kratochvil <jkratochvil at openjdk.org> wrote:

> When compiling trunk (819f3d6fc70ff6fe54ac5f9033c17c3dd4326aa5 2024-04-29) by gcc-14.0.1-0.15.fc40.x86_64 there are many errors: 
> 
> In file included from src/hotspot/share/memory/allocation.hpp:30,
>                  from src/hotspot/share/ci/ciBaseObject.hpp:29,
>                  from src/hotspot/share/ci/ciMetadata.hpp:28,
>                  from src/hotspot/share/ci/ciType.hpp:28,
>                  from src/hotspot/share/ci/ciKlass.hpp:28,
>                  from src/hotspot/share/ci/ciArrayKlass.hpp:28,
>                  from src/hotspot/share/ci/ciArray.hpp:28,
>                  from src/hotspot/share/ci/compilerInterface.hpp:28,
>                  from src/hotspot/share/compiler/abstractCompiler.hpp:28,
>                  from src/hotspot/share/compiler/abstractCompiler.cpp:25:
> src/hotspot/share/utilities/linkedlist.hpp:85:15: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
>    85 |   NONCOPYABLE(LinkedList<E>);
>       |               ^~~~~~~~~~~~~
> src/hotspot/share/utilities/globalDefinitions.hpp:87:26: note: in definition of macro ‘NONCOPYABLE’
>    87 | #define NONCOPYABLE(C) C(C const&) = delete; C& operator=(C const&) = delete /* next token must be ; */
>       |                          ^
> src/hotspot/share/utilities/linkedlist.hpp:85:15: note: remove the ‘< >’
>    85 |   NONCOPYABLE(LinkedList<E>);
>       |               ^~~~~~~~~~~~~
> src/hotspot/share/utilities/globalDefinitions.hpp:87:26: note: in definition of macro ‘NONCOPYABLE’
>    87 | #define NONCOPYABLE(C) C(C const&) = delete; C& operator=(C const&) = delete /* next token must be ; */
>       |                          ^
> 
> In file included from src/hotspot/share/gc/z/zGranuleMap.inline.hpp:30,
>                  from src/hotspot/share/gc/z/zForwardingTable.inline.hpp:32,
>                  from src/hotspot/share/gc/z/zHeap.inline.hpp:30,
>                  from src/hotspot/share/gc/z/zGeneration.inline.hpp:30,
>                  from src/hotspot/share/gc/z/zBarrier.inline.hpp:30,
>                  from src/hotspot/share/gc/z/zBarrierSet.inline.hpp:31,
>                  from src/hotspot/share/gc/shared/barrierSetConfig.inline.hpp:44,
>                  from src/hotspot/share/oops/access.inline.hpp:31,
>                  from src/hotspot/share/memory/iterator.inline.hpp:32,
>                  from src/hotspot/share/oops/oop.inline.hpp:31,
>                  from src/hotspot/share/compiler/abstractDisassembler.cpp:32:
> src/hotspot/share/gc/z/zArray.inline.hpp:99:21: error: template-id not allowed f...

Seems weird that we're facing C++20 issues when HotSpot is only on C++14. This seems like it should be in the disabled warnings list of HotSpot for erroneous warnings that gcc is giving us, just my 2 cents

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

PR Comment: https://git.openjdk.org/jdk/pull/19009#issuecomment-2084792626


More information about the hotspot-dev mailing list