From f9dde0a9db7d3c38f81198f6622171cd1405a270 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Mon, 9 Oct 2006 19:28:14 +0000 Subject: 2006-10-09 Paul Pluzhnikov PR c++/2116 * valops.c (find_overload_match): Check for a NULL name. 2006-10-09 Daniel Jacobowitz PR c++/2116 * gdb.cp/call-c.cc, gdb.cp/call-c.exp, gdb.cp/call-c-1.c: New. --- gdb/valops.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'gdb/valops.c') 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; -- cgit v1.2.1