diff options
author | Devang Patel <dpatel@apple.com> | 2005-07-26 22:10:14 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2005-07-26 22:10:14 +0000 |
commit | 63ff7283d9d4f329db7433097d0500e351d52c9d (patch) | |
tree | 74ed8d1358af0bde9bdb23f8f0eb6f558326f28a /gcc/cp/decl.c | |
parent | 0758050e611e373c50683ac74cf5a97b43a4b178 (diff) |
Radar 4184203
Undo PR c++/1016 patch.
2005-03-13 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
* cp-tree.h (pushtag): Adjust declaration.
* decl.c (lookup_and_check_tag): Call lookup_type_scope if
lookup_name fails.
(xref_tag): Adjust call to pushtag. Make hidden class visible.
(start_enum): Adjust call to pushtag.
* name-lookup.c (ambiguous_decl): Ignore hidden names.
(qualify_lookup): Change return type to bool.
(hidden_name_p): New function.
(lookup_namespace_name, unqualified_namespace_lookup,
lookup_name_real): Use it.
(lookup_type_scope): Update comments.
(maybe_process_template_type_declaration): Change parameter name
from globalize to is_friend.
(pushtag): Change globalize parameter of type int to tag_scope.
Hide name if introduced by friend declaration.
* name-lookup.h (hidden_name_p): Add declaration.
* parser.c (cp_parser_lookup_name): Don't deal with hidden name
here.
* pt.c (push_template_decl_real): Make hidden class template
visible.
(lookup_template_class, instantiate_class_template): Adjust call
to pushtag.
* semantics.c (begin_class_definition): Likewise.
* rtti.c (init_rtti_processing, build_dynamic_cast_1,
tinfo_base_init, emit_support_tinfos): Use ts_current instead of
ts_global.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@102402 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 39 |
1 files changed, 10 insertions, 29 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 014540f02b4..f928ece442c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9237,19 +9237,8 @@ lookup_and_check_tag (enum tag_types tag_code, tree name, tree t; tree decl; if (scope == ts_global) - { - /* First try ordinary name lookup, ignoring hidden class name - injected via friend declaration. */ - decl = lookup_name (name, 2); - /* If that fails, the name will be placed in the smallest - non-class, non-function-prototype scope according to 3.3.1/5. - We may already have a hidden name declared as friend in this - scope. So lookup again but not ignoring hidden name. - If we find one, that name will be made visible rather than - creating a new tag. */ - if (!decl) - decl = lookup_type_scope (name, ts_within_enclosing_non_class); - } + /* APPLE LOCAL 4184203 */ + decl = lookup_name (name, 2); else decl = lookup_type_scope (name, scope); @@ -9409,7 +9398,10 @@ xref_tag (enum tag_types tag_code, tree name, { t = make_aggr_type (code); TYPE_CONTEXT (t) = context; - t = pushtag (name, t, scope); + /* APPLE LOCAL begin 4184203 */ + /* pushtag only cares whether SCOPE is zero or not. */ + t = pushtag (name, t, scope != ts_current); + /* APPLE LOCAL end 4184203 */ } } else @@ -9423,20 +9415,8 @@ xref_tag (enum tag_types tag_code, tree name, error ("redeclaration of %qT as a non-template", t); t = error_mark_node; } - - /* Make injected friend class visible. */ - if (scope != ts_within_enclosing_non_class - && hidden_name_p (TYPE_NAME (t))) - { - DECL_ANTICIPATED (TYPE_NAME (t)) = 0; - DECL_FRIEND_P (TYPE_NAME (t)) = 0; - - if (TYPE_TEMPLATE_INFO (t)) - { - DECL_ANTICIPATED (TYPE_TI_TEMPLATE (t)) = 0; - DECL_FRIEND_P (TYPE_TI_TEMPLATE (t)) = 0; - } - } + /* APPLE LOCAL 4184203 */ + /* Remove code to make friend class visible */ } POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t); @@ -9678,7 +9658,8 @@ start_enum (tree name) name = make_anon_name (); enumtype = make_node (ENUMERAL_TYPE); - enumtype = pushtag (name, enumtype, /*tag_scope=*/ts_current); + /* APPLE LOCAL 4184203 */ + enumtype = pushtag (name, enumtype, 0); } return enumtype; |