gcc 4.3.0 crashes compiling the program below:

$ cat z.C && g++ z.C
template <int> struct A { };
template <class, bool> struct B;
template <class T> struct B<T, true> { typedef T X; };

template <class T>
int foo (typename B<T, __is_empty (T)>::X* = 0) { return 0; }

template <class T>
int foo (typename B<T, !__is_empty (T)>::X* = 0) { return 1; }

int main ()
{
    foo<A<0> >();
}
z.C: In function ‘int foo(typename B<T, __is_empty(T)>::X*) [with T = A<0>]’:
z.C:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


-- 
           Summary: ICE on SFINAE and __is_empty
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sebor at roguewave dot com


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

Reply via email to