From 13387711b26dfd93e5b00e529df30f0132ec38fd Mon Sep 17 00:00:00 2001 From: Sami Wagiaalla Date: Mon, 15 Mar 2010 17:29:36 +0000 Subject: 2010-03-15 Sami Wagiaalla PR c++/7936: * cp-support.h: Added char *declaration element to using_direct data struct. (cp_add_using): Added char *declaration argument. (cp_add_using_directive): Ditto. (cp_lookup_symbol_imports): made extern. * cp-namespace.c: Updated with the above changes. * dwarf2read.c (read_import_statement): Ditto. (read_namespace): Ditto. (read_import_statement): Support import declarations. * cp-namespace.c (cp_lookup_symbol_imports): Check for imported declarations. Added support for 'declaration_only' search. (cp_lookup_symbol_namespace): Attempt to search for the name as is before consideration of imports. * symtab.c (lookup_symbol_aux_local): Added a 'declaration_only' search at every block level search. Now takes language argument. (lookup_symbol_aux): Updated. 2010-03-15 Sami Wagiaalla * gdb.cp/shadow.exp: Removed kfail; test has been fix. * gdb.cp/nsusing.exp: Ditto. --- gdb/cp-support.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'gdb/cp-support.h') diff --git a/gdb/cp-support.h b/gdb/cp-support.h index e10f5a9..f2f202f 100644 --- a/gdb/cp-support.h +++ b/gdb/cp-support.h @@ -44,6 +44,11 @@ struct demangle_component; Eg: namespace C = A::B; ALIAS = "C" + DECLARATION is the name of the imported declaration, if this import + statement represents one. + Eg: + using A::x; + Where x is variable in namespace A. DECLARATION is set to x. */ struct using_direct @@ -52,6 +57,7 @@ struct using_direct char *import_dest; char *alias; + char *declaration; struct using_direct *next; @@ -91,6 +97,7 @@ extern int cp_is_anonymous (const char *namespace); extern void cp_add_using_directive (const char *dest, const char *src, const char *alias, + const char *declaration, struct obstack *obstack); extern void cp_initialize_namespace (void); @@ -113,8 +120,14 @@ extern struct symbol *cp_lookup_symbol_nonlocal (const char *name, extern struct symbol *cp_lookup_symbol_namespace (const char *namespace, const char *name, const struct block *block, - const domain_enum domain, - const int search_parents); + const domain_enum domain); + +extern struct symbol *cp_lookup_symbol_imports (const char *scope, + const char *name, + const struct block *block, + const domain_enum domain, + const int declaration_only, + const int search_parents); extern struct type *cp_lookup_nested_type (struct type *parent_type, const char *nested_name, -- cgit v1.1