https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103118
Bug ID: 103118
Summary: [modules] ICE tree check in get_merge_kind at
cp/module.cc
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: johelegp at gmail dot com
CC: johelegp at gmail dot com
Target Milestone: ---
Including `<chrono>` in the following source results in an ICE.
std.hpp:
```C++
#include <algorithm>
#include <array>
#include <bit>
#include <chrono>
#include <concepts>
#include <cstddef>
#include <cstdint>
#include <exception>
#include <fstream>
#include <iostream>
#include <optional>
#include <string>
#include <type_traits>
#include <utility>
```
Command:
```
g++ -std=c++23 -fmodules-ts -x c++-header -c std.hpp
```
Output:
```
std.hpp: internal compiler error: tree check: expected var_decl or
function_decl or field_decl or type_decl or concept_decl or template_decl, have
namespace_decl in get_merge_kind, at cp/module.cc:10072
0x208bafd internal_error(char const*, ...)
???:0
0x8b1d90 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0xabf5dd trees_out::decl_value(tree_node*, depset*)
???:0
0xac077b trees_out::decl_node(tree_node*, walk_kind)
???:0
0xac17aa trees_out::tree_node(tree_node*)
???:0
0xac1b02 trees_out::chained_decls(tree_node*)
???:0
0xac2ab1 trees_out::core_vals(tree_node*)
???:0
0xac5748 trees_out::tree_value(tree_node*)
???:0
0xac1608 trees_out::tree_node(tree_node*)
???:0
0xac5870 trees_out::write_function_def(tree_node*)
???:0
0xac7b6c depset::hash::find_dependencies(module_state*)
???:0
0xac7fba module_state::write(elf_out*, cpp_reader*)
???:0
0xac968e finish_module_processing(cpp_reader*)
???:0
0xa5739c c_parse_final_cleanups()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://bugs.archlinux.org/> for instructions.
```