more about template bugs in 2.95.2 and an ICE in 20000228

Dima Volodin dvv@dvv.ru
Wed Mar 1 10:18:00 GMT 2000


# cat 00.cc
template <typename T>
class C {
public:
#ifdef ENUM
        enum {N = 10};
#else
        static unsigned const N (10);
#endif
        static double x [N];
};

template <typename T>
double C <T>::x [C <T>::N] = {1, 2, 3};


# g++ -S -B /usr/local/lib/gcc-lib/i586--solaris2.7/2.95.2/ 00.cc
00.cc:13: conflicting types for `double C<T>::x[C<T>::N]'
00.cc:9: previous declaration as `double C<T>::x[C<T>::N]'


# g++ -S -B /usr/local/lib/gcc-lib/i586--solaris2.7/2.95.2/ -DENUM 00.cc
######## this one passed !!!

# g++ -S -B /archive/egcs-20000228/gcc/ 00.cc
00.cc:7: Internal compiler error.
00.cc:7: Please submit a full bug report.
00.cc:7: See <URL: http://www.gnu.org/software/gcc/bugs.html > for
00.cc:7: instructions.

# g++ -S -B /archive/egcs-20000228/gcc/ -DENUM 00.cc
00.cc:13: conflicting types for `double C<T>::x[C<T>::N]'
00.cc:9: previous declaration as `double C<T>::x[10]'


Cheers!

Dima


More information about the Gcc-bugs mailing list