aboutsummaryrefslogtreecommitdiff
path: root/gdb/cp-support.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cp-support.c')
-rw-r--r--gdb/cp-support.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 86f19de..b91bcdc 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -198,8 +198,9 @@ inspect_type (struct demangle_parse_info *info,
return 0;
}
- /* If the type is a typedef, replace it. */
- if (TYPE_CODE (otype) == TYPE_CODE_TYPEDEF)
+ /* If the type is a typedef or namespace alias, replace it. */
+ if (TYPE_CODE (otype) == TYPE_CODE_TYPEDEF
+ || TYPE_CODE (otype) == TYPE_CODE_NAMESPACE)
{
long len;
int is_anon;
@@ -210,6 +211,13 @@ inspect_type (struct demangle_parse_info *info,
/* Get the real type of the typedef. */
type = check_typedef (otype);
+ /* If the symbol is a namespace and its type name is no different
+ than the name we looked up, this symbol is not a namespace
+ alias and does not need to be substituted. */
+ if (TYPE_CODE (otype) == TYPE_CODE_NAMESPACE
+ && strcmp (TYPE_NAME (type), name) == 0)
+ return 0;
+
is_anon = (TYPE_TAG_NAME (type) == NULL
&& (TYPE_CODE (type) == TYPE_CODE_ENUM
|| TYPE_CODE (type) == TYPE_CODE_STRUCT