From 88d34f9968e0fb6bc7e1ee6e423ddce9c03e7dea Mon Sep 17 00:00:00 2001 From: Keith Seitz Date: Tue, 21 Feb 2017 13:32:51 -0800 Subject: [PATCH] Improved handling for conversion operators. --- gdb/c-exp.y | 12 +++++++++++- gdb/cp-support.c | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gdb/c-exp.y b/gdb/c-exp.y index 2753c6ec5d1..e89a600ed15 100644 --- a/gdb/c-exp.y +++ b/gdb/c-exp.y @@ -1559,7 +1559,17 @@ oper: OPERATOR NEW c_print_type ($2, NULL, &buf, -1, 0, &type_print_raw_options); - $$ = operator_stoken (buf.c_str ()); + + /* This also needs canonicalization. */ + const char *name = buf.c_str (); + std::string canon = cp_canonicalize_string (name); + if (canon.empty ()) + canon = name; + + /* We need a space between "operator" and the + canonicalized type name. */ + canon.insert (0, " "); + $$ = operator_stoken (canon.c_str ()); } ; diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 1b0900e489f..91b3cb08bf2 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -762,6 +762,7 @@ unqualified_name_from_comp (struct demangle_component *comp) case DEMANGLE_COMPONENT_DTOR: case DEMANGLE_COMPONENT_OPERATOR: case DEMANGLE_COMPONENT_EXTENDED_OPERATOR: + case DEMANGLE_COMPONENT_CONVERSION: done = 1; break; default: -- 2.39.5