Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation failure with Clang 17 and -std=cpp23 #137

Open
planetmarshall opened this issue Jun 8, 2024 · 2 comments
Open

Compilation failure with Clang 17 and -std=cpp23 #137

planetmarshall opened this issue Jun 8, 2024 · 2 comments

Comments

@planetmarshall
Copy link

Summary

Including <boost/program_options.hpp> causes a compilation failure when compiling with clang 17.0.6 and GNU stdlibc++ 14 with -std=gnu++23

Steps to reproduce

Install boost (a conanfile is provided) and extract the attached archive.

boost-po-test.tar.gz

tar -xf boost-po-test-tgz
cd boost-po-test/
cmake --preset default
cmake --build build/default

Expected result

compilation is successful

Actual result

compilation fails with

/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:956:36: error: no matching function for call to 'get'
  956 |             return __convertible<decltype(std::get<_Is>(std::declval<_UTuple>()))...>();

Workaround

Edit the CMakeLists.txt file and change

set(CMAKE_CXX_STANDARD 23)

to

set(CMAKE_CXX_STANDARD 20)

and recompile.

System Info

Boost 1.85.0 (conan)
Arch Linux
Clang 17.0.6
GCC 14.1.1

@vprus
Copy link
Collaborator

vprus commented Jun 17, 2024

Andrew, thanks for such a nice bug report.

Sadly, I'm far away from C++ these days, so our only hope for a fix is if somebody else, or maybe you, writes a PR.

Thanks again!

@planetmarshall
Copy link
Author

No problem. Thanks for taking the time to look and your hard work on the library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants