This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
g++ bug
- To: bug-gcc at gnu dot org
- Subject: g++ bug
- From: Guido Macchi <guido at fceia dot unr dot edu dot ar>
- Date: Tue, 7 Mar 2000 03:27:25 -0300 (ART)
Dear Sir:
The program that follows,
----------------------------------------------------------------------
1 class C {
2 static const int j;
3 int a[j];
4 public:
5 C f(C &c) {
6 C tmp;
7 return tmp;
8 }
9 };
10 class D {
11 static const int j;
12 int a[j];
13 public:
14 D() {}
15 D f(D &c) {
16 D tmp;
17 return tmp;
18 }
19 };
----------------------------------------------------------------------
crash the compiler with the following log (-v flag used).
---------------------------------------------------------------------
Reading specs from /usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/specs
gcc version 2.95.2 19991024 (release)
/usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/cpp -lang-c++ -v -D__GNUC__=2 -D__GNUG__=2 -D__GNUC_MINOR__=95 -D__cplusplus -D__ELF__ -Dunix -D__i386__ -Dlinux -D__ELF__ -D__unix__ -D__i386__ -D__linux__ -D__unix -D__linux -Asystem(posix) -D__EXCEP
TIONS -Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -Di486 -D__i486 -D__i486__ bug1.cc /tmp/cccQq9vW.ii
GNU CPP version 2.95.2 19991024 (release) (i386 Linux/ELF)
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/qt/include
/usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/../../../../include/g++-3
/usr/local/include
/usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/../../../../i486-pc-linux-gnulibc1/include
/usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/include
/usr/include
End of search list.
The following default directories have been omitted from the search path:
End of omitted list.
/usr/local/lib/gcc-lib/i486-pc-linux-gnulibc1/2.95.2/cc1plus /tmp/cccQq9vW.ii -quiet -dumpbase bug1.cc -version -o /tmp/ccIBW6RN.s
GNU C++ version 2.95.2 19991024 (release) (i486-pc-linux-gnulibc1) compiled by GNU C version 2.95.2 19991024 (release).
bug1.cc: In method `class D D::f(D &)':
bug1.cc:17: Internal compiler error in `find_function_data', at function.c:542
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for instructions.
-------------------------------------------------------------------
The only difference between class C (which succeed) and class D (which not)
is the class constructor D(). The error is not reproducible without using
a convoluted declaration like
2 static const int j;
3 int a[j];
guido
........................................................................
"One of the symptoms of an approaching nervous breakdown is the belief
that one's work is terribly important."
- Bertrand Russell (1872-1970)
"If you assume that there's no hope, you guarantee that there will be no
hope. If you assume that there is an instinct for freedom, there are
opportunities to change things, there's a chance you may contribute to
making a better world. That's your choice"
- Noam Chomsky
........................................................................