https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99285

--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
//bug_a.ii
template<typename... _Tp> struct common_type;

template<> struct common_type<> {};

template<typename _Tp0> struct common_type<_Tp0> {};

template<typename _Tp1, typename _Tp2> struct common_type<_Tp1, _Tp2> {};

//bug_b.ii
import  "bug_a.ii";

template<typename _Rep1, typename _Rep2,
         typename _CRep = typename common_type<_Rep1, _Rep2>::type>
struct X;

./cc1plus -quiet -std=c++20 -fmodule-header bug_a.ii && ./cc1plus -quiet
-std=c++20 -fmodule-header bug_b.ii  
bug_b.ii:4:60: internal compiler error: canonical types differ for identical
types 'common_type<_Rep1, _Rep2>' and 'common_type<_Tp1, _Tp2>'
    4 |          typename _CRep = typename common_type<_Rep1, _Rep2>::type>
      |                                                            ^
0xea4ed7 comptypes(tree_node*, tree_node*, int)
        ../../../src/gcc/cp/typeck.c:1547
0xe4beea fixup_template_type
        ../../../src/gcc/cp/semantics.c:3477
0xe4c1f6 finish_template_type(tree_node*, tree_node*, int)
        ../../../src/gcc/cp/semantics.c:3510
0xd4aa7b cp_parser_template_id
        ../../../src/gcc/cp/parser.c:17444
0xd59426 cp_parser_class_name
        ../../../src/gcc/cp/parser.c:24671
0xd34ebf cp_parser_qualifying_entity
        ../../../src/gcc/cp/parser.c:6994

Reply via email to