]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Improved handling for conversion operators.
authorKeith Seitz <keiths@redhat.com>
Tue, 21 Feb 2017 21:32:51 +0000 (13:32 -0800)
committerKeith Seitz <keiths@redhat.com>
Tue, 21 Feb 2017 21:32:51 +0000 (13:32 -0800)
gdb/c-exp.y
gdb/cp-support.c

index 2753c6ec5d17f308addc5e5753cb95be6d590719..e89a600ed1562e67bd135920390dc912b4eb59ff 100644 (file)
@@ -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 ());
                        }
        ;
 
index 1b0900e489f1361b62a6d7528af9501da16da379..91b3cb08bf27240143a7bc3ac32fcfe38a05458a 100644 (file)
@@ -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: