Bug 52881

Summary: segmentation fault with nested class as parameter to constructor with default value
Product: [Retired] Red Hat Linux Reporter: scott dallamura <scott_dallamura>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
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: 2002-12-15 17:42:40 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 scott dallamura 2001-08-30 14:08:01 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; COM+ 
1.0.2204)

Description of problem:
sorry the summary is so big ;)
when i try to use a nested class as an argument to a constructor for the 
enclosing class, g++ gives a segmentation fault.  if i move the nested 
class outside of the enclosing class, or if i don't use the " = 
ServiceInformation()", or even if i use " = ServiceInformation(0)" it 
works fine.

I guess it's not a huge problem, since it's really easy to work around, 
but i got really scared when gcc segfaulted.

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


How reproducible:
Always

Steps to Reproduce:
1. make the following file "testes.h":
class testes {
public:
	struct ServiceInformation {
		ServiceInformation(long lPID = 0)
			:PID(lPID) {};
		long PID;
	};
	testes(const ServiceInformation &svcinf = ServiceInformation());
};

2. make this file testes.cpp:
#include "testes.h"

testes::testes(const ServiceInformation &svcinf) {
}

testes::~testes() {
}

3. compile the program:
g++ -c testes.cpp
	

Actual Results:  [sdallamura@vader testes]$ g++ testes.cpp
In file included from testes.cpp:1:
testes.h:9: Internal error: Segmentation fault.
Please submit a full bug report.


Expected Results:  it should have worked >:O

Additional info: