aboutsummaryrefslogtreecommitdiff
path: root/libiberty/cp-demangle.h
diff options
context:
space:
mode:
authorccoutant <ccoutant@138bc75d-0d04-0410-961f-82ee72b054a4>2013-11-22 22:25:49 +0000
committerTom Tromey <tromey@redhat.com>2013-11-26 09:35:29 -0700
commit492e19d098f4bf4f22bac22815e9cb117be55b33 (patch)
tree2a7fc9e7efb29c34a12c590303970e6fe6ffbbc4 /libiberty/cp-demangle.h
parent4f14910fa1331398cc695011a6af43a89252b4b1 (diff)
downloadgdb-492e19d098f4bf4f22bac22815e9cb117be55b33.zip
gdb-492e19d098f4bf4f22bac22815e9cb117be55b33.tar.gz
gdb-492e19d098f4bf4f22bac22815e9cb117be55b33.tar.bz2
Fix demangler to handle conversion operators correctly.
libiberty/ PR other/59195 * cp-demangle.c (struct d_info_checkpoint): New struct. (struct d_print_info): Add current_template field. (d_operator_name): Set flag when processing a conversion operator. (cplus_demangle_type): When processing <template-args> for a conversion operator, backtrack if necessary. (d_expression_1): Renamed from d_expression. (d_expression): New wrapper around d_expression_1. (d_checkpoint): New function. (d_backtrack): New function. (d_print_init): Initialize current_template. (d_print_comp): Set current_template. (d_print_cast): Put current_template in scope for printing conversion operator name. (cplus_demangle_init_info): Initialize is_expression and is_conversion. * cp-demangle.h (struct d_info): Add is_expression and is_conversion fields. * testsuite/demangle-expected: New test cases. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205292 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/cp-demangle.h')
-rw-r--r--libiberty/cp-demangle.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libiberty/cp-demangle.h b/libiberty/cp-demangle.h
index ae635be..6fce025 100644
--- a/libiberty/cp-demangle.h
+++ b/libiberty/cp-demangle.h
@@ -122,6 +122,11 @@ struct d_info
mangled name to the demangled name, such as standard
substitutions and builtin types. */
int expansion;
+ /* Non-zero if we are parsing an expression. */
+ int is_expression;
+ /* Non-zero if we are parsing the type operand of a conversion
+ operator, but not when in an expression. */
+ int is_conversion;
};
/* To avoid running past the ending '\0', don't: