aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2004-01-02 21:11:34 +0000
committerDJ Delorie <dj@redhat.com>2004-01-02 21:11:34 +0000
commit820542c970da46f15f9b691e77e7404a5c6fd734 (patch)
tree9cc0530445d6f32d76928f5b14b957d415c3978e /libiberty/cp-demangle.c
parent0bc2134ec99a5955ec83265212ed3e4cf212f45d (diff)
downloadgdb-820542c970da46f15f9b691e77e7404a5c6fd734.zip
gdb-820542c970da46f15f9b691e77e7404a5c6fd734.tar.gz
gdb-820542c970da46f15f9b691e77e7404a5c6fd734.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r--libiberty/cp-demangle.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index 16871ab..a5d1817 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1,5 +1,5 @@
/* Demangler for g++ V3 ABI.
- Copyright (C) 2003 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004 Free Software Foundation, Inc.
Written by Ian Lance Taylor <ian@wasabisystems.com>.
This file is part of the libiberty library, which is part of GCC.
@@ -1109,6 +1109,23 @@ d_encoding (di, top_level)
|| dc->type == D_COMP_VOLATILE_THIS
|| dc->type == D_COMP_CONST_THIS)
dc = d_left (dc);
+
+ /* If the top level is a D_COMP_LOCAL_NAME, then there may
+ be CV-qualifiers on its right argument which really apply
+ here; this happens when parsing a class which is local to
+ a function. */
+ if (dc->type == D_COMP_LOCAL_NAME)
+ {
+ struct d_comp *dcr;
+
+ dcr = d_right (dc);
+ while (dcr->type == D_COMP_RESTRICT_THIS
+ || dcr->type == D_COMP_VOLATILE_THIS
+ || dcr->type == D_COMP_CONST_THIS)
+ dcr = d_left (dcr);
+ dc->u.s_binary.right = dcr;
+ }
+
return dc;
}