microsoft / proxy

Proxy: Next Generation Polymorphism in C++
https://wg21.link/p3086
MIT License
2.1k stars 127 forks source link

Compile warnings in clang 18 #152

Closed tian-lt closed 1 month ago

tian-lt commented 2 months ago

When the google test version bumps to the lates, we can see below warnings when we compile tests with clang 18

In file included from /home/runner/work/proxy/proxy/build-clang-18/_deps/googletest-src/googletest/src/gtest-all.cc:38:
In file included from /home/runner/work/proxy/proxy/build-clang-18/_deps/googletest-src/googletest/include/gtest/gtest.h:55:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/memory:66:
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:263:8: warning: 'get_temporary_buffer<testing::TestInfo *>' is deprecated [-Wdeprecated-declarations]
  263 |                 std::get_temporary_buffer<value_type>(_M_original_len));
      |                      ^
/usr/bin/../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/bin/../lib/gcc/x[86](https://github.com/microsoft/proxy/actions/runs/10312728530/job/28548416779#step:8:87)_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 /home/runner/work/proxy/proxy/build-clang-18/_deps/googletest-src/googletest/src/gtest.cc:3009:20)>>' requested here
 5070 |       _GLIBCXX_STD_A::__stable_sort(__first, __last,
      |                       ^
/home/runner/work/proxy/proxy/build-clang-18/_deps/googletest-src/googletest/src/gtest.cc:3008:8: note: in instantiation of function template specialization 'std::stable_sort<__gnu_cxx::__normal_iterator<testing::TestInfo **, std::vector<testing::TestInfo *>>, (lambda at /home/runner/work/proxy/proxy/build-clang-18/_deps/googletest-src/googletest/src/gtest.cc:3009:20)>' requested here
 3008 |   std::stable_sort(test_info_list_.begin(), test_info_list_.end(),
      |        ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/bits/stl_tempbuf.h:99:5: note: 'get_temporary_buffer<testing::TestInfo *>' has been explicitly marked deprecated here
   99 |     _GLIBCXX17_DEPRECATED
      |     ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12/bits/c++config.h:119:34: note: expanded from macro '_GLIBCXX17_DEPRECATED'
  119 | # define _GLIBCXX17_DEPRECATED [[__deprecated__]]
      |                                  ^
tian-lt commented 2 months ago

One hypothesis is that the root cause might because we are using libstdc++ with clang, while libc++ is the standard library for LLVM.

frederick-vs-ja commented 2 months ago

I believe the warning is totally unrelated to proxy. We're not using any related standard utilities.