Compilation failure with Clang 17 and `-std=cpp23`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
Research direction
Extract the attached archive and run the documented cmake preset with Clang 17, GCC 14 and C++23 to reproduce the failure from boost/program_options.hpp. Compare the build with C++20, then inspect the program_options headers involved in the reported tuple/get diagnostic. Done means the reproduction compiles successfully under the reported C++23 configuration without requiring the workaround.
Written by the indexing model from the issue text.
Description
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.
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
- Dominant language
- C++
- Stars
- 136
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/program_options
-
Provide C++20 module Open
Difficulty 5/5 Over a week Newbie friendliness 45/100
boostorg/program_options#160 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
boostorg/program_options#159 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
boostorg/program_options#147 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
boostorg/program_options#146 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
boostorg/program_options#144 ·
All issues in boostorg/program_options
Similar issues
-
ai_reviewed
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ydb-platform/ydb#53869 · 3 comments ·
-
bug cert blocker needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
project-chip/connectedhomeip#74373 ·
-
upstream update
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
conan-io/conan-center-index#31035 ·
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
documentation
Difficulty 1/5 Under an hour Newbie friendliness 85/100
vllm-project/vllm-ascend#17329 ·