* testsuite/demangle-expected: Add two tests for anonymous

namespaces.
	* cplus-dem.c (gnu_special): Handle anonymous namespaces.
This commit is contained in:
Hans-Peter Nilsson 2000-09-13 22:59:40 +00:00
parent 064002de2b
commit d3e8500506
3 changed files with 33 additions and 1 deletions

View file

@ -2812,6 +2812,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;
}