summaryrefslogtreecommitdiff
path: root/libiberty/cplus-dem.c
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-13 23:09:30 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2000-09-13 23:09:30 +0000
commit78631810ff0768f5d5b5fc82cf8c5f6ac260e0c5 (patch)
tree86b4407658b5168aba27a07662f1ac9c9230e16f /libiberty/cplus-dem.c
parent427d827ed2add2225992cfb22a2be1d6e13c0cac (diff)
downloadgcc-78631810ff0768f5d5b5fc82cf8c5f6ac260e0c5.tar.gz
* testsuite/demangle-expected: Add two tests for anonymous
namespaces. * cplus-dem.c (gnu_special): Handle anonymous namespaces. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@36398 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cplus-dem.c')
-rw-r--r--libiberty/cplus-dem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libiberty/cplus-dem.c b/libiberty/cplus-dem.c
index 79b6dc5ccf7..3fe70b4030d 100644
--- a/libiberty/cplus-dem.c
+++ b/libiberty/cplus-dem.c
@@ -2811,6 +2811,25 @@ gnu_special (work, mangled, declp)
success = 0;
break;
}
+
+ if (n > 10 && strncmp (*mangled, "_GLOBAL_", 8) == 0
+ && (*mangled)[9] == 'N'
+ && (*mangled)[8] == (*mangled)[10]
+ && strchr (cplus_markers, (*mangled)[8]))
+ {
+ /* A member of the anonymous namespace. There's information
+ about what identifier or filename it was keyed to, but
+ it's just there to make the mangled name unique; we just
+ step over it. */
+ string_append (declp, "{anonymous}");
+ (*mangled) += n;
+
+ /* Now p points to the marker before the N, so we need to
+ update it to the first marker after what we consumed. */
+ p = strpbrk (*mangled, cplus_markers);
+ break;
+ }
+
string_appendn (declp, *mangled, n);
(*mangled) += n;
}