diff options
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 7d1b7d83e70..15c407c0af2 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1889,10 +1889,15 @@ find_overload_match (struct type **arg_types, int nargs, char *name, int method, else { const char *qualified_name = SYMBOL_CPLUS_DEMANGLED_NAME (fsym); - func_name = cp_func_name (qualified_name); - /* If the name is NULL this must be a C-style function. - Just return the same symbol. */ + /* If we have a C++ name, try to extract just the function + part. */ + if (qualified_name) + func_name = cp_func_name (qualified_name); + + /* If there was no C++ name, this must be a C-style function. + Just return the same symbol. Do the same if cp_func_name + fails for some reason. */ if (func_name == NULL) { *symp = fsym; |