PR c++/7539

PR c++/10541

This patch fixes some namespace alias bugs reported in the above bugs.
Links to all mailing list discussion:

https://sourceware.org/ml/gdb-patches/2013-07/msg00649.html
https://sourceware.org/ml/gdb-patches/2013-09/msg00557.html
https://sourceware.org/ml/gdb-patches/2013-11/msg00156.html
This commit is contained in:
Keith Seitz
2013-11-13 12:33:34 -08:00
parent 793156e672
commit 74921315b6
7 changed files with 460 additions and 7 deletions

View File

@@ -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