diff options
author | Jason Merrill <jason@redhat.com> | 2002-12-19 17:16:26 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2002-12-19 17:16:26 +0000 |
commit | b3ea0d91bb9f4e32e4f25cb5faeac986e064fe97 (patch) | |
tree | c90067e66827d3f202e02db04548102a5067ac8c /gcc/cp/cp-tree.def | |
parent | 805e6e9645632a47fd1190d7753cf2ce320bc637 (diff) |
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: https://gcc.gnu.org/svn/gcc/trunk@60314 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/cp-tree.def')
-rw-r--r-- | gcc/cp/cp-tree.def | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/cp-tree.def b/gcc/cp/cp-tree.def index 1aae797a4c2..436f8406973 100644 --- a/gcc/cp/cp-tree.def +++ b/gcc/cp/cp-tree.def @@ -89,6 +89,10 @@ DEFTREECODE (THROW_EXPR, "throw_expr", 'e', 1) these to avoid actually creating instances of the empty classes. */ DEFTREECODE (EMPTY_CLASS_EXPR, "empty_class_expr", 'e', 0) +/* A DECL which is really just a placeholder for an expression. Used to + implement non-class scope anonymous unions. */ +DEFTREECODE (ALIAS_DECL, "alias_decl", 'd', 0) + /* A reference to a member function or member functions from a base class. BASELINK_FUNCTIONS gives the FUNCTION_DECL, TEMPLATE_DECL, OVERLOAD, or TEMPLATE_ID_EXPR corresponding to the |