Fix -Wdeprecated-declarations warnings from gtest by clang23

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P4
    • 27
    • Affects Version/s: 27
    • Component/s: hotspot
    • Environment:
    • x86_64
    • linux

      This compiler warning only observed by combination clang23+gcc12(ubuntu22). And googletest-1.17 also has this issue.

      configure and make command:
      bash configure --with-toolchain-type=clang --with-toolchain-path=/date/yansendao/software/llvm-binary-23/bin --with-gtest=/date/yansendao/git/googletest-v1.14.0 --with-conf-name=googletest-1.14
      make images test-image CONF=googletest-1.14

      compile result:
      === Output from failing command(s) repeated here ===
      * For target hotspot_variant-server_libjvm_libgtest_objs_gtest-all.o:
      In file included from /date/yansendao/git/googletest-v1.14.0/googletest/src/gtest-all.cc:38:
      In file included from /date/yansendao/git/googletest-v1.14.0/googletest/include/gtest/gtest.h:56:
      In file included from /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/memory:66:
      /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8: error: 'get_temporary_buffer<testing::TestInfo *>' is deprecated [-Werror,-Wdeprecated-declarations]
        263 | std::get_temporary_buffer<value_type>(_M_original_len));
            | ^
      /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:4996:15: note: in instantiation of member function 'std::_Temporary_buffer<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, testing::TestInfo *>::_Temporary_buffer' requested here
       4996 | _TmpBuf __buf(__first, (__last - __first + 1) / 2);
            | ^
      /usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_algo.h:5070:23: note: in instantiation of function template specialization 'std::__stable_sort<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, __gnu_cxx::__ops::_Iter_comp_iter<(lambda at /date/yansendao/git/googletest-v1.14.0/googletest/src/gtest.cc:2987:20)>>' requested here
       5070 | _GLIBCXX_STD_A::__stable_sort(__first, __last,
            | ^
      /date/yansendao/git/googletest-v1.14.0/googletest/src/gtest.cc:2986:8: note: in instantiation of function template specialization 'std::stable_sort<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, (lambda at /date/yansendao/git/googletest-v1.14.0/googletest/src/gtest.cc:2987:20)>' requested here
       2986 | std::stable_sort(test_info_list_.begin(), test_info_list_.end(),
            | ^
         ... (rest of output omitted)

      clang version:
      > clang -v
      clang version 23.0.0git (/home/yansendao/git/llvm-project/clang 48ce7bb0388e26eeae149ee23db2308dcc1e3c4a)
      Target: x86_64-unknown-linux-gnu
      Thread model: posix
      InstalledDir: /date/yansendao/software/llvm-binary-23/bin
      Build config: +assertions
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
      Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
      Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
      Candidate multilib: .;@m64
      Candidate multilib: 32;@m32
      Candidate multilib: x32;@mx32
      Selected multilib: .;@m64

      gcc version:
      > gcc -v
      Using built-in specs.
      COLLECT_GCC=gcc
      COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/12/lto-wrapper
      OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa
      OFFLOAD_TARGET_DEFAULT=1
      Target: x86_64-linux-gnu
      Configured with: ../src/configure -v --with-pkgversion='Ubuntu 12.3.0-1ubuntu1~22.04.2' --with-bugurl=file:///usr/share/doc/gcc-12/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-12 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-12-dNWB6h/gcc-12-12.3.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-12-dNWB6h/gcc-12-12.3.0/debian/tmp-gcn/usr --enable-offload-defaulted --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
      Thread model: posix
      Supported LTO compression algorithms: zlib zstd
      gcc version 12.3.0 (Ubuntu 12.3.0-1ubuntu1~22.04.2)

            Assignee:
            Sendao Yan
            Reporter:
            Sendao Yan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: