wrong public reference (g++ v2.8.0)
Mark Mitchell
mmitchell@usa.net
Sun Mar 22 12:55:00 GMT 1998
Igor --
typedef const struct {
int x;
} Test, *pTest;
The problem is that if you try to print name list of the object file
using '/usr/ccs/bin/nm' you can see that the public name of 'foo' looks
like 'foo__FPC3._0'
and 'c++filt' demangls it as foo(._0 const *) that is wrong !!!
BUT using g++ v.2.7.2.3 the name looks 'foo__FPCC4Test' and after
demangling 'foo(Test const const *)' that is right.
Actually, I believe that the present behavior is correct. The
standard says this:
If the typedef declaration defines an unnamed class (or enum), the
first typedef-name declared by the declaration to be that class type
(or enum type) is used to denote the class type (or enum type) for
linkage purposes only
There is no such typedef-name in this example, since Test names the
const-qualified version of the struct, and since pTest names a pointer
to same.
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available
More information about the Gcc-bugs
mailing list