diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-02 20:33:55 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-01-02 20:33:55 +0000 |
commit | f2c17d01513786ba2e312afa3d07f6a6337662cb (patch) | |
tree | 183e17ac3dbfe84ac13438b5694f1dc0c39c96cf /libiberty/cp-demangle.c | |
parent | b93f372142b53666a979e0780aa6aa6bc1def308 (diff) | |
download | gcc-f2c17d01513786ba2e312afa3d07f6a6337662cb.tar.gz |
* cp-demangle.c (d_encoding): When DMGL_PARAMS is not set, strip
CV-qualifiers from D_COMP_LOCAL_NAME right subtree.
* cplus-dem.c (demangle_arm_hp_template): Set DMGL_PARAMS when
demangling template parameters.
* testsuite/test-demangle.c (fail): New static function.
(main): Support new options in input file: --no-params,
--is-v3-ctor, and --is-v3-dtor.
* testsuite/demangle-expected: Add --no-params to most tests, and
add the correct result when parameters are not demangled. Add
some simple tests for V3 constructor/destructor recognition.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@75336 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.c')
-rw-r--r-- | libiberty/cp-demangle.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c index 16871abaad3..a5d18170536 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; } |