[Original Message-ID: <38c95d5b.330845657@busybee>] # 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 Release: unknown Environment: System: Linux mira 2.3.48 #4 Sun Feb 27 23:26:02 CET 2000 i586 unknown Architecture: i586
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed as a bug
From: loewis@gcc.gnu.org To: dvv@dvv.ru, gcc-gnats@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de, nobody@gcc.gnu.org Cc: Subject: Re: c++/12 Date: 9 Mar 2000 07:08:33 -0000 Old Synopsis: [internal] more about template bugs in 2.95.2 and an ICE in 20000228 New Synopsis: more about template bugs in 2.95.2 and an ICE in 20000228 State-Changed-From-To: open->analyzed State-Changed-By: loewis State-Changed-When: Wed Mar 8 23:08:33 2000 State-Changed-Why: Confirmed as a bug http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=12&database=gcc
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in CVS. Current CVS gives:- bash-2.04$ ./g++ -B./ ~/test.c /home/neil/test.c:7: invalid data member initialization /home/neil/test.c:7: (use `=' to initialize static data members) /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[C<T>::N]' Fixing the initialization: bash-2.04$ ./g++ -B./ ~/test.c /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[C<T>::N]' bash-2.04$ ./g++ -B./ ~/test.c -DENUM /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[10]'
From: neil@gcc.gnu.org To: dvv@dvv.ru, gcc-gnats@gcc.gnu.org, martin@loewis.home.cs.tu-berlin.de, nobody@gcc.gnu.org Cc: Subject: Re: c++/12 Date: 25 Nov 2000 15:33:33 -0000 Synopsis: more about template bugs in 2.95.2 and an ICE in 20000228 State-Changed-From-To: analyzed->closed State-Changed-By: neil State-Changed-When: Sat Nov 25 07:33:32 2000 State-Changed-Why: Fixed in CVS. Current CVS gives:- bash-2.04$ ./g++ -B./ ~/test.c /home/neil/test.c:7: invalid data member initialization /home/neil/test.c:7: (use `=' to initialize static data members) /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[C<T>::N]' Fixing the initialization: bash-2.04$ ./g++ -B./ ~/test.c /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[C<T>::N]' bash-2.04$ ./g++ -B./ ~/test.c -DENUM /home/neil/test.c:13: conflicting types for `double C<T>::x[C<T>::N]' /home/neil/test.c:9: previous declaration as `double C<T>::x[10]' http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=12&database=gcc