Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8331352

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

    XMLWordPrintable

Details

    • b23
    • x86_64
    • linux

    Backports

      Description

        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 ‘< >’

        Attachments

          Issue Links

            Activity

              People

                jkratochvil Jan Kratochvil
                jkratochvil Jan Kratochvil
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: