diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 17:16:26 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-12-19 17:16:26 +0000 |
commit | e657e37cec7eef18fa89712083ad48c76a10fab6 (patch) | |
tree | c90067e66827d3f202e02db04548102a5067ac8c /gcc/cp/typeck.c | |
parent | e433ac65859384c3d7fef182a1a4dda5f3446d33 (diff) | |
download | ppe42-gcc-e657e37cec7eef18fa89712083ad48c76a10fab6.tar.gz ppe42-gcc-e657e37cec7eef18fa89712083ad48c76a10fab6.zip |
Handle anonymous unions at the tree level.
C++ ABI change: Mangle anonymous unions using the name of their
first named field (by depth-first search). Should not cause
binary compatibility problems, though, as the compiler previously
didn't emit anything for affected unions.
* cp-tree.def (ALIAS_DECL): New tree code.
* decl2.c (build_anon_union_vars): Build ALIAS_DECLs. Return the
first field, not the largest.
(finish_anon_union): Don't mess with RTL. Do set DECL_ASSEMBLER_NAME,
push the decl, and write it out at namespace scope.
* decl.c (lookup_name_real): See through an ALIAS_DECL.
(pushdecl): Add namespace bindings for ALIAS_DECLs.
* rtti.c (unemitted_tinfo_decl_p): Don't try to look at the name
of a decl which doesn't have one.
* typeck.c (build_class_member_access_expr): Don't recurse if
we already have the type we want.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/typeck.c')
-rw-r--r-- | gcc/cp/typeck.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 769702b8a1d..9285ec01686 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -1987,7 +1987,8 @@ build_class_member_access_expr (tree object, tree member, OBJECT so that it refers to the class containing the anonymous union. Generate a reference to the anonymous union itself, and recur to find MEMBER. */ - if (ANON_AGGR_TYPE_P (DECL_CONTEXT (member))) + if (ANON_AGGR_TYPE_P (DECL_CONTEXT (member)) + && !same_type_p (object_type, DECL_CONTEXT (member))) { tree anonymous_union; |