c++/4526: ICE in g++ 3.0.1 when using typeof() as template parameter

Wolfgang Bangerth bangerth@ticam.utexas.edu
Thu Oct 31 14:08:00 GMT 2002


This is a reduced testcase:
----------------------------------
template<class T> struct A {
    typedef typename T::type type;
};

template<class T> struct B {
    void foo() {
        typedef A<typeof(BOGUS)> A;
        typename A::type i;
      }
};

template class B<int>;
----------------------------------

In the original report, BOGUS was actually something valid, but I believe 
that the failure is the same:
tmp/g> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc
x.cc: In instantiation of `A<__typeof (BOGUS)>':
x.cc:8:   instantiated from here
x.cc:2: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

W.

-------------------------------------------------------------------------
Wolfgang Bangerth              email:           bangerth@ticam.utexas.edu
                               www: http://www.ticam.utexas.edu/~bangerth




More information about the Gcc-bugs mailing list