https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103279
Bug ID: 103279 Summary: [12 regression] ICE on llvm-compiler-rt-13: internal compiler error: canonical types differ for identical types Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: slyfox at gcc dot gnu.org Target Milestone: --- Initially observed ICE on llvm-13's compiler-rt build attempt. cvise managed to reduce it down to: $ cat a.c.cpp template <typename> struct __noexcept_move_assign_container; template <class _Allocator> struct basic_string { basic_string &operator=(basic_string &&) noexcept( __noexcept_move_assign_container<_Allocator>::value); basic_string &assign(basic_string &&) noexcept( __noexcept_move_assign_container<_Allocator>::value); }; template <class _Allocator> basic_string<_Allocator> & basic_string<_Allocator>::operator=(basic_string &&) noexcept( __noexcept_move_assign_container<_Allocator>::value) {} $ g++-12.0.0 -O3 -fPIC -fno-exceptions -std=c++20 -c a.c.cpp a.c.cpp:11:60: internal compiler error: canonical types differ for identical types 'basic_string<_Allocator>& (basic_string<_Allocator>::)(basic_string<_Allocator>&&) noexcept (__noexcept_move_assign_container<_Allocator>::value)' and 'basic_string<_Allocator>& (basic_string<_Allocator>::)(basic_string<_Allocator>&&) noexcept (__noexcept_move_assign_container<_Allocator>::value)' 11 | __noexcept_move_assign_container<_Allocator>::value) {} | ^ 0x20cfe97 internal_error(char const*, ...) ???:0 0xc3166f comptypes(tree_node*, tree_node*, int) ???:0 0xa6b3bc duplicate_decls(tree_node*, tree_node*, bool, bool) ???:0 0xa778a0 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ???:0 0xa7c7c6 start_function(cp_decl_specifier_seq*, cp_declarator const*, tree_node*) ???:0 0xb834cd c_parse_file() ???:0 0xcb23dd c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ g++-12.0.0 -v Using built-in specs. COLLECT_GCC=/nix/store/59jdmdy3ylrpmap1bjxic1fjaq8wf96s-gcc-12.0.0/bin/g++ COLLECT_LTO_WRAPPER=/nix/store/59jdmdy3ylrpmap1bjxic1fjaq8wf96s-gcc-12.0.0/libexec/gcc/x86_64-unknown-linux-gnu/12.0.0/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.0.0 20211114 (experimental) (GCC)