abseil/abseil-cpp

[Bug]: C++17 support broken by https://github.com/abseil/abseil-cpp/commit/f845e60acd880dbf07788a5a2c0dbad0f9c57231

Closed this issue · 1 comments

wcn3 commented

Describe the issue

This change creates a condition where building with C++ 17 results in compilation errors.

CMakeLists.txt generates a pinned options file that keys off of whether there's at least C++17 support, using the native compiler features when present, and using Abseil's version when not. The cited commit introduces a dependence on C++20 features, creating a corner case where the resulting pinned options now actually require C++20, but only checks for C++17. This effectively breaks any usage of C++17.

Steps to reproduce the problem

Build and install Abseil with C++-17 support

cmake -DCMAKE_PREFIX_PATH=../../abseil-inst -DCMAKE_INSTALL_PREFIX=../../abseil-inst -DABSL_ENABLE_INSTALL=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DABSL_FIND_GOOGLETEST=ON -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON ..

Try to use it, example usage with s2geometry

git clone https://github.com/google/s2geometry
mkdir s2geometry/build
cd s2geometry/build
cmake -DGOOGLETEST_ROOT=/usr/src/googletest -DCMAKE_CXX_STANDARD=17 -DCMAKE_PREFIX_PATH=../abseil-inst ..
make

Sample errors

/home/wcn/code/abseil-inst/include/absl/types/compare.h:60:12: error: ‘partial_ordering’ has not been declared in ‘std’
60 | using std::partial_ordering;
| ^~~~~~~~~~~~~~~~
/home/wcn/code/abseil-inst/include/absl/types/compare.h:61:12: error: ‘strong_ordering’ has not been declared in ‘std’
61 | using std::strong_ordering;
| ^~~~~~~~~~~~~~~
/home/wcn/code/abseil-inst/include/absl/types/compare.h:62:12: error: ‘weak_ordering’ has not been declared in ‘std’
62 | using std::weak_ordering;
| ^~~~~~~~~~~~~

What version of Abseil are you using?

6d21df7

What operating system and version are you using?

Ubuntu variant

What compiler and version are you using?

gcc version 13.2.0 (Debian 13.2.0-5)

What build system are you using?

cmake version 3.27.7

Additional context

No response

Confirmed, thanks for the report.