Uploaded image for project: 'XalanC'
  1. XalanC
  2. XALANC-786

Compilation error with C++20 standard: cause by deleted operator<< in std::basic_ostream

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.11
    • None
    • XalanC, XPathC
    • None
    • Ubuntu 18.04 / SLES 12

    Description

      There is a compilation problem when building against the C+20 standard. I am using gcc 10.0.1 with the option -std=gnu+2a. This is due to the change described here (https://en.cppreference.com/w/cpp/io/basic_ostream/operator_ltlt2).

      Here is the error message:

      g++ -std=gnu++2a -fno-working-directory -ggdb3 -flto -ffat-lto-objects -fuse-linker-plugin -g -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/ICU/uc/latest/osp/include -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/ICU/i18n/latest/osp/include -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/ICU/data/latest/osp/include -pthread -D_REENTRANT -fno-elide-constructors -Wall -fPIC -DLINUX -D_REENTRANT -DXALAN_INMEM_MSG_LOADER -c -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/src -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/include -I../nls/include -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/Xerces/latest/osp/src/ -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/Xerces/latest/osp/include/xercesc -I/home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/DEPS/osp/Xerces/latest/osp/include/ -o ../obj/Parameters.o /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/Parameters.cpp
      In file included from /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/backward/strstream:50,
       from /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/src/xalanc/Harness/XalanFileUtility.hpp:32,
       from /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/Parameters.cpp:50:
      /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. [-Wcpp]
       32 | #warning \
       | ^~~~~~~
      In file included from /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/Parameters.hpp:39,
       from /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/Parameters.cpp:54:
      /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/TestHarness.hpp: In member function 'void TestHarness<Processor>::executeTestCase(const TestCaseType&)':
      /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/TestHarness.hpp:244:49: error: use of deleted function 'std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char16_t*) [with _Traits = std::char_traits<char>]'
       244 | << testCase.inputMode.c_str()
       | ^
      In file included from /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/istream:39,
       from /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/sstream:38,
       from /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/bits/quoted_string.h:38,
       from /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/iomanip:45,
       from /home/jenkins/workspace/htly-ncegcolnx338_release_20.0.0/workdir/components/xalan/BUILD/xalan-c-1.11/c/Tests/Performance/Parameters.cpp:26:
      /opt/1A/toolchain/x86_64-v20.0.8/include/c++/10.0.1/ostream:645:5: note: declared here
       645 | operator<<(basic_ostream<char, _Traits>&, const char16_t*) = delete;
       | ^~~~~~~~

      Attachments

        1. fix_cxx20_ostream_operator.patch
          4 kB
          Laurent Stacul

        Activity

          People

            ggregory Gary D. Gregory
            stac47 Laurent Stacul
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: