https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124782
Bug ID: 124782
Summary: [modules] internal compiler error: in sort_cluster, at
cp/module.cc:16281
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: marcel at laverdet dot com
Target Milestone: ---
module;
#include <type_traits>
export module foo;
template <class Type>
struct foo {};
template <class Type>
struct bar {
auto fn(auto&&... args) -> foo<std::invoke_result_t<Type,
decltype(args)...>> {
if constexpr (std::is_void_v<std::invoke_result_t<Type,
decltype(args)...>>) {
}
}
};
-----------
root[15:57:00] [/workspace] $ /root/gcc-16/bin/g++ -std=c++26 -Wall -fmodules
-c a.cc
a.cc:3:8: internal compiler error: in sort_cluster, at cp/module.cc:16281
3 | export module foo;
| ^~~~~~
0x26d01f3 internal_error(char const*, ...)
/gcc-out/../gcc/gcc/diagnostic-global-context.cc:787
0x88a747 fancy_abort(char const*, int, char const*)
/gcc-out/../gcc/gcc/diagnostics/context.cc:1813
0xa978b7 sort_cluster
/gcc-out/../gcc/gcc/cp/module.cc:16281
0xa978b7 module_state::write_begin(elf_out*, cpp_reader*, module_state_config&,
unsigned int&)
/gcc-out/../gcc/gcc/cp/module.cc:21132
0xa97f2f finish_module_processing(cpp_reader*)
/gcc-out/../gcc/gcc/cp/module.cc:23855
0x9eef03 c_parse_final_cleanups()
/gcc-out/../gcc/gcc/cp/decl2.cc:6122
0xd3c0b7 c_common_parse_file()
/gcc-out/../gcc/gcc/c-family/c-opts.cc:1448
/root/gcc-16/libexec/gcc/aarch64-unknown-linux-gnu/16.0.1/cc1plus -quiet
-imultiarch aarch64-linux-gnu -D_GNU_SOURCE a.cc -quiet -dumpbase a.cc
-dumpbase-ext .cc -mlittle-endian -mabi=lp64 -Wall -std=c++26 -fmodules -o
/tmp/ccWRc7CD.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.