[Bug c++/94100] ICE: tree check: accessed elt 1 of 'tree_vec' with 0 elts in tsubst_pack_expansion, at cp/pt.c:12765

hstong at ca dot ibm.com gcc-bugzilla@gcc.gnu.org
Thu Jul 2 23:12:41 GMT 2020


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

--- Comment #2 from Hubert Tong <hstong at ca dot ibm.com> ---
The following ICEs in a similar fashion:
internal compiler error: tree check: accessed elt 2 of 'tree_vec' with 1 elts
in tsubst, at cp/pt.c:15334

### SOURCE:
template <typename... T> struct ValListWithTypes {
  template <T... Members> struct WithVals {
    using TypeList = ValListWithTypes;
  };
};

template <typename ValList, typename ValTypeList = typename ValList::TypeList>
struct Widget;

template <typename ValList, typename... ValTypes>
struct Widget<ValList, ValListWithTypes<ValTypes...>> {
  template <typename = ValList> struct Impl {};
};

template <typename ValList, typename... ValTypes>
template <ValTypes... Vals>
struct Widget<ValList, ValListWithTypes<ValTypes...>>::Impl<
    typename ValListWithTypes<ValTypes...>::template WithVals<Vals...>> {};

int main(void) { Widget<ValListWithTypes<int>::WithVals<0>>::Impl<> impl; }


More information about the Gcc-bugs mailing list