Bug 23584

Summary: g++ crash on conversion operator
Product: [Retired] Red Hat Linux Reporter: Need Real Name <vaughn_cato>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-01 15:28:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Need Real Name 2001-01-08 16:44:22 UTC
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 ---

Comment 1 Jakub Jelinek 2001-01-12 13:05:27 UTC
Reproduced with both gcc-c++-2.96-70 and current mainline CVS C++, will try
to debug this.

Comment 2 Jakub Jelinek 2001-02-01 15:28:39 UTC
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

Comment 3 Jakub Jelinek 2001-02-05 21:09:12 UTC
The fix is in gcc-c++-2.96-74.