summaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-10 20:34:20 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2011-10-10 20:34:20 +0000
commit94dcf771e93845c49f1e228030910f0b3b32a937 (patch)
tree4a566dbff6b04c89e85d40174e4517b0789d6853 /libiberty/cp-demangle.c
parentea2885f433bdc2b9c2e14b76172200197c706fb5 (diff)
downloadgcc-94dcf771e93845c49f1e228030910f0b3b32a937.tar.gz
PR c++/48665
* cp-demangle.c (d_cv_qualifiers): If qualifiers are applied to a function type, change them to apply to the "this" parameter. * testsuite/demangle-expected: Add test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179772 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 32318e89fd8..c7afef01f6d 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -2294,8 +2294,10 @@ static struct demangle_component **
d_cv_qualifiers (struct d_info *di,
struct demangle_component **pret, int member_fn)
{
+ struct demangle_component **pstart;
char peek;
+ pstart = pret;
peek = d_peek_char (di);
while (peek == 'r' || peek == 'V' || peek == 'K')
{
@@ -2332,6 +2334,28 @@ d_cv_qualifiers (struct d_info *di,
peek = d_peek_char (di);
}
+ if (!member_fn && peek == 'F')
+ {
+ while (pstart != pret)
+ {
+ switch ((*pstart)->type)
+ {
+ case DEMANGLE_COMPONENT_RESTRICT:
+ (*pstart)->type = DEMANGLE_COMPONENT_RESTRICT_THIS;
+ break;
+ case DEMANGLE_COMPONENT_VOLATILE:
+ (*pstart)->type = DEMANGLE_COMPONENT_VOLATILE_THIS;
+ break;
+ case DEMANGLE_COMPONENT_CONST:
+ (*pstart)->type = DEMANGLE_COMPONENT_CONST_THIS;
+ break;
+ default:
+ break;
+ }
+ pstart = &d_left (*pstart);
+ }
+ }
+
return pret;
}