This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/20350] [4.0/4.1 Regression] extern template and struct initializer and specification for a static variable


------- Additional Comments From carlo at gcc dot gnu dot org  2005-05-31 02:33 -------
If you remove the 'extern', the compiler still crashes:

struct a { int i, j; };
template <int i> struct mutex_tct { static a S_mutex; };
template <int i> a mutex_tct<i>::S_mutex = {0,1};
template <> a mutex_tct<0>::S_mutex;
template <> a mutex_tct<0>::S_mutex = {0,1};
void g() { mutex_tct<0>::S_mutex.i = 0; }

>g++-4.0.0 -v troep.cc
Using built-in specs.
Target: i686-redhat-linux
Configured with: /usr/src/gcc/gcc-4.0.0/configure --prefix=/usr/local/gcc-4.0.0
--enable-shared --with-gnu-as --with-gnu-ld--enable-languages=c++ --enable-debug
--enable-threads=posix --disable-checking --with-system-zlib
--enable-__cxa_atexit --host=i686-redhat-linux
Thread model: posix
gcc version 4.0.0
 /usr/local/gcc-4.0.0/libexec/gcc/i686-redhat-linux/4.0.0/cc1plus -quiet -v
-D_GNU_SOURCE troep.cc -quiet -dumpbase troep.cc -mtune=pentiumpro -auxbase
troep -version -o /tmp/ccDplkLP.s
ignoring nonexistent directory
"/usr/local/gcc-4.0.0/lib/gcc/i686-redhat-linux/4.0.0/../../../../i686-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/gcc-4.0.0/lib/gcc/i686-redhat-linux/4.0.0/../../../../include/c++/4.0.0
 /usr/local/gcc-4.0.0/lib/gcc/i686-redhat-linux/4.0.0/../../../../include/c++/4.0.0/i686-redhat-linux
 /usr/local/gcc-4.0.0/lib/gcc/i686-redhat-linux/4.0.0/../../../../include/c++/4.0.0/backward
 /usr/local/include
 /usr/local/gcc-4.0.0/include
 /usr/local/gcc-4.0.0/lib/gcc/i686-redhat-linux/4.0.0/include
 /usr/include
End of search list.
GNU C++ version 4.0.0 (i686-redhat-linux)
        compiled by GNU C version 4.0.0.
GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=113235
troep.cc:5: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]