[Bug ada/49785] New: [C++0x] ICE in coerce_template_parms

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 19 13:38:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49785

           Summary: [C++0x] ICE in coerce_template_parms
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org
                CC: jason@gcc.gnu.org


template <typename, typename ...> struct B;
template <typename> class A;

template <typename R, typename ... S>
struct A <R (S ...)> : public B <R, , S ...>
{
  struct C {};
  template <typename D> A (D, C = C ());
  R operator () (...);
};

template <typename R, typename ... S, typename T>
auto operator >> (A <R (S ...)>, T)->A <decltype ((*((R *) nullptr))) (S ...)>
{
  []() {};
}

int
main ()
{
  A <int (int, int)> a = [](int, int) {};
  auto b = [](){};
  (a >> b) (3, 5);
}

ICEs with -std=c++0x:
rh720161.ii: In instantiation of ‘A<decltype (*(R*)(nullptr))(S ...)>
operator>>(A<R(S ...)>, T) [with R = int, S = {int, int}, T =
main()::<lambda()>, decltype (*(R*)(nullptr)) = int&]’:
rh720161.ii:23:9:   required from here
rh720161.ii:15:9: internal compiler error: tree check: accessed elt 6 of
tree_vec with 3 elts in coerce_template_parms, at cp/pt.c:6695

No idea whether I've reduced it correctly, the original is from
https://bugzilla.redhat.com/720161 attachment.



More information about the Gcc-bugs mailing list