diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-10 17:02:52 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-10 17:02:52 +0000 |
commit | 4ef84ecb8d5b6e12918092e5b9d563d4fd72b233 (patch) | |
tree | 90c3e3ac2cad752705cfdb425242698390bb7199 /libiberty | |
parent | 3e426b86d2ef51d0abcee1ec27167a3d9bfe3037 (diff) | |
download | gcc-4ef84ecb8d5b6e12918092e5b9d563d4fd72b233.tar.gz |
* cp-demangle.c (d_print_comp) [DEMANGLE_COMPONENT_OPERATOR]:
Omit a trailing space in the operator name.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183072 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty')
-rw-r--r-- | libiberty/ChangeLog | 5 | ||||
-rw-r--r-- | libiberty/cp-demangle.c | 13 | ||||
-rw-r--r-- | libiberty/testsuite/demangle-expected | 3 |
3 files changed, 16 insertions, 5 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 8587ee2eabd..e6060a76309 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2012-01-10 Jason Merrill <jason@redhat.com> + + * cp-demangle.c (d_print_comp) [DEMANGLE_COMPONENT_OPERATOR]: + Omit a trailing space in the operator name. + 2012-01-06 Jason Merrill <jason@redhat.com> PR c++/6057 diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 2dfd67ceb77..18b84a126e8 100644 --- a/libiberty/cp-demangle.c +++ b/libiberty/cp-demangle.c @@ -4357,14 +4357,17 @@ d_print_comp (struct d_print_info *dpi, int options, case DEMANGLE_COMPONENT_OPERATOR: { - char c; + const struct demangle_operator_info *op = dc->u.s_operator.op; + int len = op->len; d_append_string (dpi, "operator"); - c = dc->u.s_operator.op->name[0]; - if (IS_LOWER (c)) + /* Add a space before new/delete. */ + if (IS_LOWER (op->name[0])) d_append_char (dpi, ' '); - d_append_buffer (dpi, dc->u.s_operator.op->name, - dc->u.s_operator.op->len); + /* Omit a trailing space. */ + if (op->name[len-1] == ' ') + --len; + d_append_buffer (dpi, op->name, len); return; } diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected index 3f3960a4093..408c4f47794 100644 --- a/libiberty/testsuite/demangle-expected +++ b/libiberty/testsuite/demangle-expected @@ -4058,6 +4058,9 @@ decltype ((::delete {parm#1}),(+{parm#1})) f<int>(int*) _Z1fIiEDTcmdafp_psfp_EPT_ decltype ((delete[] {parm#1}),(+{parm#1})) f<int>(int*) --format=gnu-v3 +_ZN1AdlEPv +A::operator delete(void*) +--format=gnu-v3 _Z2f1IiEDTppfp_ET_ decltype ({parm#1}++) f1<int>(int) --format=gnu-v3 |