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

            Bug ID: 88146
           Summary: ice in tsubst_copy, at cp/pt.c:16014
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this C++ code:

template < typename a, a b > struct c { static constexpr a d = b; };
 template < typename > auto aa(0);
 template < typename... > struct ac;
 template < typename e > using f = typename e::g;
 template < typename > struct ay { using g = void; };
 template < typename az, typename ba > struct ay< ac< az, ba > > {   using g =
b
a; };
 template < typename... h > using bc = f< ay< ac< h... > > >;
 template < bool... > using bd = c< bool, true >;
 template < typename... > using be = bd<>;
 template < typename > using bt = int;
 enum bu { bw };
 template < typename > struct bx;
 template < typename by, bu = bx< by >::d > struct bz;
 template < typename e > struct cb { e d; };
 template < typename cd > using cf = cd;
 template < typename i > struct chain { using g = i; };
 template < typename i > class cm : f< chain< i > > {   using cn = f< chain< i
>
 >;   cn::cn; };
 namespace co { template < typename > struct cp {   template < typename... h >
c
onstexpr cp(...) noexcept(be< h... >::d); }; template < typename... > using cq
=
 cp< int >; }
 using co::cq;
 template < typename... > using cr = cm< cq<> >;
 struct ct : cr<> {   using cn = cr<>;   cn::cn; };
 struct cu {   template < typename cv > static auto cw(cv cx) ->
decltype(cx.cw(
)); };
 template < typename > struct cy;
 struct cz {   template < typename cd, typename = decltype(cd().begin()) > void 
da(cd, int);   template < typename cd > auto operator()(cd j) -> decltype(da(j, 
2)); };
 struct db {   template < typename e > using dc = decltype(cb< cz >::d(e()));
};
 struct dd : db {   template < typename e > using cf = cf< dc< e > >; };
 template < typename cv > using de = dd::cf< cv >;
 c< bu, bw > k;
 template < typename > struct bx : bc< c< bool, true >, decltype(k) > {};
 template < typename df > using dg = bt< decltype(cu::cw(df())) >;
 template < typename df > using dh = cy< dg< df > >;
 template < typename df, int > struct di {   template < typename ao = df > dh<
a
o > begin(); };
 template < typename > struct dl : ct { ct::ct; };
 struct dm : dl< int > {   dl::dl; };
 struct dn : dm {   using cn = dm;   cn::cn; };
 template < typename > using l = dn;
 struct m;
 template < typename, bu n > struct bz : di< m, n > {   template < typename ao
>
   static ao begin_cursor_(ao) noexcept(noexcept(l< ao >{0}));   template <
type
name ao = m >   auto cw() noexcept(decltype(begin_cursor_(aa< ao >))()) ->
declt
ype(0); };
 struct m : bz< int > {};
 template < typename, typename p, typename > using o = c< bu, p::d >;
 template < typename r > using s = o< r, bx< de< r > >, bc<> >;
 di< int, s< m >::d >;

recent gcc trunk does this:

bug484.cc:35:42: internal compiler error: in tsubst_copy, at cp/pt.c:16014
   35 |  struct dn : dm {   using cn = dm;   cn::cn; };
      |                                          ^~
0x6420b0 tsubst_copy
        ../../trunk/gcc/cp/pt.c:16014
0x9b07fb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../trunk/gcc/cp/pt.c:19363
0x9bbb48 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../trunk/gcc/cp/pt.c:18058

This bug seems to have occurred sometime before revision 265318.

Reply via email to