Bug 56494 - code will not compile
code will not compile
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
8.0
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-19 19:09 EST by Rich Graham
Modified: 2007-04-18 12:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-10-01 20:50:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Rich Graham 2001-11-19 19:09:07 EST
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 13:13:10 EST
Confirmed still present in g++ 3.2
Comment 2 Richard Henderson 2004-10-01 20:50:49 EDT
Works as of 3.2.3-20.

Note You need to log in before you can comment on or make changes to this bug.