https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123879
Bug ID: 123879
Summary: [16 Regression] -std=c++26 --compile-std-module
-fmodules fails with installed GCC
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: ppalka at gcc dot gnu.org
Target Milestone: ---
$ g++ -flang-info-include-translate --compile-std-module -fmodules -std=c++26
...
In file included from
/scratchpad/gcc-build-prefix/include/c++/16.0.1/bits/std.compat.cc:26:
/scratchpad/gcc-build-prefix/include/c++/16.0.1/stdbit.h:34:10: note: include
‘/scratchpad/gcc-build-prefix/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/stdc++.h’
translated to import
34 | #include <bit>
| ^~~~~
/scratchpad/gcc-build-prefix/include/c++/16.0.1/stdbit.h:57:1: error:
redefinition of ‘template<class _Tp> unsigned int
__gnu_cxx::stdc_leading_zeros(_Tp)’
57 | stdc_leading_zeros(_Tp __value)
| ^~~~~~~~~~~~~~~~~~
In file included from
/scratchpad/gcc-build-prefix/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/stdc++.h:240,
of module
/scratchpad/gcc-build-prefix/include/c++/16.0.1/x86_64-pc-linux-gnu/bits/stdc++.h,
imported at /scratchpad/gcc-build-prefix/include/c++/16.0.1/stdbit.h:34:
/scratchpad/gcc-build-prefix/include/c++/16.0.1/stdbit.h:57:1: note:
‘template<class _Tp> unsigned int __gnu_cxx::stdc_leading_zeros(_Tp)’
previously declared here
57 | stdc_leading_zeros(_Tp __value)
| ^~~~~~~~~~~~~~~~~~
Marking as a regression despite --compile-std-module being new to GCC 16
because the equivalent g++ command line to compile std.compat.cc previously
worked in GCC 15.