diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-05-06 14:12:18 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2011-05-06 14:12:18 +0000 |
commit | d8228535f5e83861361a366e2298a4d8c79e78d8 (patch) | |
tree | 161d3b918d124eda579d6b711262fde26ffa4d2b /gdb/cp-namespace.c | |
parent | 1976171a47ef25e0b893222c5d704c89a8678ed7 (diff) | |
download | gdb-d8228535f5e83861361a366e2298a4d8c79e78d8.zip gdb-d8228535f5e83861361a366e2298a4d8c79e78d8.tar.gz gdb-d8228535f5e83861361a366e2298a4d8c79e78d8.tar.bz2 |
gdb/
* c-exp.y (qualified_name): Call destructor_name_p with $1.type.
(classify_inner_name): Call cp_lookup_nested_type with
yylval.tsym.type.
* cp-namespace.c (cp_lookup_nested_type): New variable
saved_parent_type. Call CHECK_TYPEDEF for parent_type. Call
type_name_no_tag_or_error with saved_parent_type.
* dwarf2read.c (load_partial_dies): Read in any children of
DW_TAG_typedef with complaint in such case.
* gdbtypes.c (type_name_no_tag_or_error): New function.
* gdbtypes.h (type_name_no_tag_or_error): New prototype.
* valops.c (destructor_name_p): New comment for parameter type. Remove
type const. Make dname and cp const. Call type_name_no_tag_or_error.
* value.h (destructor_name_p): Remove type const.
Diffstat (limited to 'gdb/cp-namespace.c')
-rw-r--r-- | gdb/cp-namespace.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index 030cfb9..00c68b3 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -630,6 +630,12 @@ cp_lookup_nested_type (struct type *parent_type, const char *nested_name, const struct block *block) { + /* type_name_no_tag_required provides better error reporting using the + original type. */ + struct type *saved_parent_type = parent_type; + + CHECK_TYPEDEF (parent_type); + switch (TYPE_CODE (parent_type)) { case TYPE_CODE_STRUCT: @@ -643,7 +649,7 @@ cp_lookup_nested_type (struct type *parent_type, just like members of namespaces; in particular, lookup_symbol_namespace works when looking them up. */ - const char *parent_name = TYPE_TAG_NAME (parent_type); + const char *parent_name = type_name_no_tag_or_error (saved_parent_type); struct symbol *sym = cp_lookup_symbol_in_namespace (parent_name, nested_name, block, VAR_DOMAIN); |