The following code crashes g++. If operator B is removed, g++ will no longer crash. The output is provided at the bottom. --- BEGIN bug.cpp --- struct A { typedef float (&B)[4][4]; typedef const float (&C)[4][4]; A() { } ~A() { } operator C() const; operator B(); }; void TestFunc() { (A::C)A(); } --- END bug.cpp --- --- begin output.txt --- bug.cpp: In function `void TestFunc ()': bug.cpp:14: Internal error: Segmentation fault. Please submit a full bug report. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. --- END output.txt ---
Reproduced with both gcc-c++-2.96-70 and current mainline CVS C++, will try to debug this.
I've just posted a patch for this to gcc-patches, waiting for approval. http://gcc.gnu.org/ml/gcc-patches/2001-02/msg00019.html
The fix is in gcc-c++-2.96-74.