summaryrefslogtreecommitdiff
path: root/gdb/cp-namespace.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2011-05-06 14:12:16 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2011-05-06 14:12:16 +0000
commitc78accd4892845c87c218ebd5c1dc064ae426306 (patch)
tree939923d57d5aab59daa725d2e8f7c2281c38a353 /gdb/cp-namespace.c
parentbd4c18e3d77747215cfc8130d6dec07c2de6c924 (diff)
downloadgdb-c78accd4892845c87c218ebd5c1dc064ae426306.tar.gz
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.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
index 030cfb9a4f0..00c68b3bb28 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);