david@tera.com (David Callahan) (12/16/89)
Running 1.36.1, config sun-nfp-0S4, there is bug with static elements if structures. Here is a transcript. The source file has two structure definitions. The first has a static array and the second is conditionally defined based on the preprocessor value BUG. When this second structure is not defined, g++ correctly allocates storage for the static array but fails to allocate storage when the second struct is define. --------------------- dactyl% cat temp.c struct node { static const int type_size = 6 ; static const int stmt_map[type_size] ; protected: node() { } ; } ; const int node::stmt_map[node::type_size] = { 0, 0, 0, 1, 1, 0 } ; #ifdef BUG struct expr : public node { protected: expr() { } ; } ; #endif dactyl% g++ -v -S temp.c gcc version 1.36.1 (based on GCC 1.36) /usr/local/lib/g++-1.36.1/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68020 temp.c /usr/tmp/cca09539.cpp GNU CPP version 1.36 /usr/local/lib/g++-1.36.1/gcc-cc1plus /usr/tmp/cca09539.cpp -quiet -dumpbase temp.c -version -o temp.s GNU C++ version 1.36.1 (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36. default target switches: -m68020 -mc68020 -mbitfield dactyl% cat temp.s #NO_APP gcc_compiled.: .globl _node$stmt_map .text .even _node$stmt_map: .long 0 .long 0 .long 0 .long 1 .long 1 .long 0 .globl _node$type_size .even _node$type_size: .long 6 dactyl% g++ -v -S -DBUG temp.c gcc version 1.36.1 (based on GCC 1.36) /usr/local/lib/g++-1.36.1/gcc-cpp -+ -v -DBUG -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68020 temp.c /usr/tmp/cca09543.cpp GNU CPP version 1.36 /usr/local/lib/g++-1.36.1/gcc-cc1plus /usr/tmp/cca09543.cpp -quiet -dumpbase temp.c -version -o temp.s GNU C++ version 1.36.1 (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36. default target switches: -m68020 -mc68020 -mbitfield dactyl% cat temp.s #NO_APP gcc_compiled.: dactyl% ------------------