RFR: 8331352: error: template-id not allowed for constructor/destructor in C++20
Jan Kratochvil
jkratochvil at openjdk.org
Tue Apr 30 02:06:28 UTC 2024
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 for destructor in C++20 [-Werror=template-id-cdtor]
99 | ZActivatedArray<T>::~ZActivatedArray<T>() {
| ^
src/hotspot/share/gc/z/zArray.inline.hpp:99:21: note: remove the ‘< >’
In file included from src/hotspot/share/opto/bytecodeInfo.cpp:38:
src/hotspot/share/utilities/events.hpp:102:18: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
102 | EventLogBase<T>(const char* name, const char* handle, int length = LogEventsBufferEntries):
| ^
src/hotspot/share/utilities/events.hpp:102:18: note: remove the ‘< >’
In file included from src/hotspot/share/classfile/metadataOnStackMark.hpp:29,
from src/hotspot/share/classfile/classLoaderDataGraph.cpp:30:
src/hotspot/share/utilities/chunkedList.hpp:47:20: error: template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
47 | ChunkedList<T, F>() : _top(_values), _next_used(nullptr), _next_free(nullptr) {}
| ^
src/hotspot/share/utilities/chunkedList.hpp:47:20: note: remove the ‘< >’
-------------
Commit messages:
- 8331352: error: template-id not allowed for constructor/destructor in C++20
Changes: https://git.openjdk.org/jdk/pull/19009/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19009&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8331352
Stats: 4 lines in 4 files changed: 0 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/19009.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/19009/head:pull/19009
PR: https://git.openjdk.org/jdk/pull/19009
More information about the hotspot-dev
mailing list