diff options
author | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-25 16:55:34 +0000 |
---|---|---|
committer | lerdsuwa <lerdsuwa@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-25 16:55:34 +0000 |
commit | 1fadf2c820097b85041a933084e94a9ee64243c9 (patch) | |
tree | 09d2e60d7ceba6434ad38c297762a3642c26dfda /gcc/cp/name-lookup.h | |
parent | 6338935c9c4842afb5e62b889b025d326bab5f99 (diff) | |
download | ppe42-gcc-1fadf2c820097b85041a933084e94a9ee64243c9.tar.gz ppe42-gcc-1fadf2c820097b85041a933084e94a9ee64243c9.zip |
Friend class name lookup 2/n, PR c++/14513, c++/15410
* name-lookup.c (lookup_name_real): Simplify.
(lookup_type_scope): Add SCOPE parameter. Handle friend class
lookup.
* name-lookup.h (tag_scope): New enum type.
(lookup_type_scope): Adjust declaration.
* decl.c (lookup_and_check_tag, xref_tag, xref_tag_from_type):
Change bool parameter GLOBALIZED to TAG_SCOPE parameter SCOPE.
(start_enum): Likewise. Add assertion test that NAME is
IDENTIFIER_NODE. Use anonymous name for dummy ENUMERAL_TYPE in
case of error.
* cp-tree.h (xref_tag, xref_tag_from_type): Adjust declarations.
* parser.c (cp_parser_elaborated_type_specifier,
cp_parser_class_head): Adjust call to xref_tag.
* pt.c (lookup_template_class, instantiate_class_template):
Likewise.
* rtti.c (init_rtti_processing, build_dynamic_cast_1,
tinfo_base_init, emit_support_tinfos): Likewise.
* g++.dg/lookup/friend2.C: New test.
* g++.dg/template/friend31.C: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91299 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/name-lookup.h')
-rw-r--r-- | gcc/cp/name-lookup.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h index b43fa1e4f32..08a9ba504b9 100644 --- a/gcc/cp/name-lookup.h +++ b/gcc/cp/name-lookup.h @@ -125,6 +125,22 @@ typedef enum scope_kind { "template <>", this scope is always empty. */ } scope_kind; +/* The scope where the class/struct/union/enum tag applies. */ +typedef enum tag_scope { + ts_current = 0, /* Current scope only. This is for the + class-key identifier; + case mentioned in [basic.lookup.elab]/2, + or the class/enum definition + class-key identifier { ... }; */ + ts_global = 1, /* All scopes. This is the 3.4.1 + [basic.lookup.unqual] lookup mentioned + in [basic.lookup.elab]/2. */ + ts_within_enclosing_non_class = 2 /* Search within enclosing non-class + only, for friend class lookup + according to [namespace.memdef]/3 + and [class.friend]/9. */ +} tag_scope; + typedef struct cp_class_binding GTY(()) { cxx_binding base; @@ -303,7 +319,7 @@ extern tree lookup_tag (enum tree_code, tree, cxx_scope *, int); extern tree lookup_tag_reverse (tree, tree); extern tree lookup_name (tree, int); extern tree lookup_name_real (tree, int, int, bool, int, int); -extern tree lookup_type_scope (tree); +extern tree lookup_type_scope (tree, tag_scope); extern tree namespace_binding (tree, tree); extern void set_namespace_binding (tree, tree, tree); extern tree lookup_namespace_name (tree, tree); |