Bug 56494

Summary: code will not compile
Product: [Retired] Red Hat Linux Reporter: Rich Graham <rlgraham>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-10-02 00:50:49 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 Rich Graham 2001-11-20 00:09:07 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.9-xfs i686)

Description of problem:
test code:
#include <stdio.h>

class A {
 public:
  A(){ printf(" hi from A() \n"); }
 ~A(){ printf(" hi from ~A() \n"); }
};

template < class T >  
class B {
 public:
  B(){ printf(" hi from B() \n"); }
 ~B(){ printf(" hi from ~B() \n"); C->A::~A();}
// ~B(){ printf(" hi from ~B() \n"); C->~A();}
  A* C;
};

int main()
{
 B<double> V;
}


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.g++ testcode.cc
2.
3.
	

Actual Results:  j3.cc: In method `void B<T>::B () [with T = double]':
j3.cc:20:   instantiated from here
j3.cc:3: Internal error: Segmentation fault.
Please submit a full bug report.
See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions.


When 
~B(){ printf(" hi from ~B() \n"); C->A::~A();}
is replaced with
~B(){ printf(" hi from ~B() \n"); C->~A();}
code compiles are runs ok.

Additional info:

Comment 1 Alan Cox 2002-12-15 18:13:10 UTC
Confirmed still present in g++ 3.2


Comment 2 Richard Henderson 2004-10-02 00:50:49 UTC
Works as of 3.2.3-20.