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;
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.
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
"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."