[Bug c++/38712] New: [c++0x] ICE: Segmentation fault in auto function when decltype uses parameter pack expansion

cfairles at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jan 3 02:12:00 GMT 2009


Could probably reduce this further:

template<class... T> struct Y {}; 

template<int... N> struct X {}; 

template<int N, class... T>
int g(Y<T...>) { return 0; } 

template<class F, class... A, int... N> 
auto foo(F f, Y<A...> t, X<N...>) -> decltype(f(g<N>(t)...))
{ return f(g<N>(t)...); }

void bar(int) { }

int main() { 
  Y<int> y;
  foo(bar, y, X<0>()); //line 16
}

Compile with -std=c++0x gives:

seg.cpp:16: internal compiler error: Segmentation fault


-- 
           Summary: [c++0x] ICE: Segmentation fault in auto function when
                    decltype uses parameter pack expansion
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cfairles at gcc dot gnu dot org
 GCC build triplet: x86_64-redhat-linux
  GCC host triplet: x86_64-redhat-linux
GCC target triplet: x86_64-redhat-linux


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



More information about the Gcc-bugs mailing list