Bug 464018

Summary: typedef of unnamed struct debug info lost in C++
Product: Red Hat Enterprise Linux 5 Reporter: Hiroto Shibuya <hiroto.shibuya>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED WONTFIX QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: law, ohudlick, tao
Target Milestone: rc   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-13 14:47:01 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:
Attachments:
Description Flags
foo.cc which reproduces the problem none

Description Hiroto Shibuya 2008-09-25 21:33:06 UTC
Created attachment 317733 [details]
foo.cc which reproduces the problem

Description of problem:

When C++ code includes typedefed unamed struct, typedefed type name
is not included in the object file.  It works fine if the struct
is named or compiled in C.  It was working fine with
g++ (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3).

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

g++ (GCC) 4.1.2 20071124 (Red Hat 4.1.2-42)

How reproducible:

always

Steps to Reproduce:
1. Compile the attached source:
   $ g++ -g -c foo.cc
2. Load the object into gdb
   $ gdb foo.o
3. Try to use the typedefed name "FooT"
   gdb> p sizeof(FooT)

  
Actual results:
No symbol "FooT" in current context.

Expected results:
$1 = 4

Additional info:

gdb> info types
All defined types:

File foo.cc:
._0;
typedef ._0;
typedef ::;
typedef int;
typedef int;

When compiled with gcc 3.4, it will show:
(gdb) info types
All defined types:

File foo.cc:
typedef ::;
FooT;
typedef FooT;
typedef int;

Comment 1 Hiroto Shibuya 2008-09-26 21:02:27 UTC
This seems to be the corresponding GCC bug. 

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35463

As I noted there, I confirmed this to have regressed between 4.0.4 and 4.1.0.

Comment 2 Hiroto Shibuya 2009-04-30 13:19:49 UTC
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35463#c4 is updated

------- Comment #4 From Jakub Jelinek 2009-04-30 13:05 [reply] -------
I think this has been fixed by
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146137
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146290
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146897
on the trunk

Comment 3 Jeff Law 2013-11-13 14:47:01 UTC
"This Bugzilla has been reviewed by Red Hat and is not planned on being
addressed in Red Hat Enterprise Linux 5, and therefore will be closed.
If this bug is critical to production systems, please contact your Red
Hat support representative and provide sufficient business
justification. Issue is already fixed in RHEL-6/7."