https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120325
Bug ID: 120325
Summary: [Regression] GCC-15 cannot build LLVM 20.1.5 with
CMAKE_CXX_STANDARD=20
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: calvin at wbinvd dot org
Target Milestone: ---
Created attachment 61457
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61457&action=edit
Two errors
Hello all,
Building llvm-20.1.5 under the C++20 standard fails with gcc-15.1. The same
LLVM source builds successfully as C++20 with gcc-14.2.
I'm filing this for visibility, but per Jonathan Wakely's comment on the LLVM
Github issue, this likely needs to be fixed in LLVM:
https://github.com/llvm/llvm-project/issues/139072#issuecomment-2887806531
--
I ran an overnight git-bisect on gcc, and it landed here in libstdc++:
https://github.com/gcc-mirror/gcc/commit/3abe751ea86e3472fa2c97bf2014f9f93f569019
(full bisect log is in attachments).
The two error messages from GCC are attached: the first is the message I see on
the commit blamed by the bisect; the second is the error I see on the current
gcc-15 release branch. Using LLVM to build itself against libstdc++ results in
nearly identical errors as seen with gcc-15 (both compilers agree).
I'm building GCC as follows:
./configure \
--prefix="${HOME}/gcc-bisect/" \
--disable-multilib \
--enable-default-pie \
--disable-bootstrap
BOOT_CFLAGS="-Os -pipe" make -j33 -s
make install -s
...and building LLVM as follows:
cmake -G Ninja \
-DCMAKE_INSTALL_PREFIX="${HOME}/bisect-llvm-test" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS="-Os -pipe" \
-DCMAKE_C_COMPILER="${HOME}/gcc-bisect/bin/gcc" \
-DCMAKE_CXX_FLAGS="-Os -pipe" \
-DCMAKE_CXX_COMPILER="${HOME}/gcc-bisect/bin/g++" \
-DCMAKE_CXX_STANDARD=20 \
-DLLVM_ENABLE_PROJECTS=all \
-DLLVM_ENABLE_RUNTIMES=all \
../llvm
ninja all