- char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
- int is_full_physname_constructor =
- ((physname[0] == '_' && physname[1] == '_'
- && strchr ("0123456789Qt", physname[2]))
- || STREQN (physname, "__ct__", 6)
- || DESTRUCTOR_PREFIX_P (physname)
- || STREQN (physname, "__dt__", 6));
+ const char *real_physname;
+ char *physname, *p;
+ int is_full_physname_constructor;
+
+ real_physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+
+ /* The physname will contain the return type
+ after the final closing parenthesis. Strip it off. */
+ p = strrchr (real_physname, ')');
+ gdb_assert (p != NULL);
+ ++p; /* Keep the trailing ')'. */
+ physname = alloca (p - real_physname + 1);
+ memcpy (physname, real_physname, p - real_physname);
+ physname[p - real_physname] = '\0';
+
+ is_full_physname_constructor
+ = (TYPE_FN_FIELD_CONSTRUCTOR (f, j)
+ || is_constructor_name (physname)
+ || is_destructor_name (physname));