https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116804
Bug ID: 116804
Summary: module order dependency with chrono and vector
Product: gcc
Version: 15.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at richy dot net
Target Milestone: ---
Created attachment 59170
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59170&action=edit
Collection of *.ii files
richard@microserver:~/scratch/broken> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/richard/gcc/lib/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../configure --host=x86_64-pc-linux-gnu
--prefix=/home/richard/gcc --enable-threads --enable-language=c,c++
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240917 (experimental) (GCC)
Commands and output below, *.ii files attached.
richard@microserver:~/scratch/broken> g++ -std=c++2b -fmodules-ts -fconcepts
-fno-module-lazy -pthread -Wall -O3 -g -fPIC -save-temps -x c++-system-header
vector
richard@microserver:~/scratch/broken> g++ -std=c++2b -fmodules-ts -fconcepts
-fno-module-lazy -pthread -Wall -O3 -g -fPIC -save-temps -x c++-system-header
chrono
/home/richard/gcc/include/c++/15.0.0/chrono:2981:39: error: wrong number of
template arguments (1, should be 2)
2981 | _GLIBCXX_STD_C::vector<time_zone_link> links;
| ^
In file included from /home/richard/gcc/include/c++/15.0.0/ostream:43,
from /home/richard/gcc/include/c++/15.0.0/istream:41,
from /home/richard/gcc/include/c++/15.0.0/sstream:40,
from /home/richard/gcc/include/c++/15.0.0/chrono:49:
/home/richard/gcc/include/c++/15.0.0/format:2642:36: note: provided for
‘template<class, class> class std::vector’
2642 | template<typename, typename> class vector;
| ^~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:2981:23: error: ‘<expression
error>’ in namespace ‘std’ does not name a type
2981 | _GLIBCXX_STD_C::vector<time_zone_link> links;
| ^~~~~~~~~~~~~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:2982:44: error: wrong number of
template arguments (1, should be 2)
2982 | _GLIBCXX_STD_C::vector<leap_second> leap_seconds;
| ^
/home/richard/gcc/include/c++/15.0.0/format:2642:36: note: provided for
‘template<class, class> class std::vector’
2642 | template<typename, typename> class vector;
| ^~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:2982:23: error: ‘<expression
error>’ in namespace ‘std’ does not name a type
2982 | _GLIBCXX_STD_C::vector<leap_second> leap_seconds;
| ^~~~~~~~~~~~~~~~~~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:2983:41: error: wrong number of
template arguments (1, should be 2)
2983 |
| ^
/home/richard/gcc/include/c++/15.0.0/format:2642:36: note: provided for
‘template<class, class> class std::vector’
2642 | template<typename, typename> class vector;
| ^~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:2983:23: error: ‘<expression
error>’ in namespace ‘std’ does not name a type
2983 |
| ^
/home/richard/gcc/include/c++/15.0.0/chrono: In function
‘std::chrono::leap_second_info
std::chrono::__detail::__get_leap_second_info(std::chrono::sys_seconds, bool)’:
/home/richard/gcc/include/c++/15.0.0/chrono:3271:32: error: ‘const struct
std::chrono::tzdb’ has no member named ‘leap_seconds’
3271 | auto __last = __db->leap_seconds.end();
| ^~~~~~~~~~~~
/home/richard/gcc/include/c++/15.0.0/chrono:3272:31: error: ‘const struct
std::chrono::tzdb’ has no member named ‘leap_seconds’
3272 | auto __pos = std::upper_bound(__first, __last, __ss);
| ^~~~~~~~~~~~
Issue does not occur if chrono is compiled first.
Note this also breaks on 14.2.0 as provided via the docker container. This
15.0.0 is a hand-build for testing if the bug appeared on the trunk.