const struct symbol *const symbol,
struct objfile *const objfile)
{
const struct symbol *const symbol,
struct objfile *const objfile)
{
lang_this = lookup_language_this (langdef, block);
if (lang_this.symbol == NULL)
lang_this = lookup_language_this (langdef, block);
if (lang_this.symbol == NULL)
type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this.symbol)));
/* If TYPE_NAME is NULL, abandon trying to find this symbol.
This can happen for lambda functions compiled with clang++,
which outputs no name for the container class. */
type = check_typedef (TYPE_TARGET_TYPE (SYMBOL_TYPE (lang_this.symbol)));
/* If TYPE_NAME is NULL, abandon trying to find this symbol.
This can happen for lambda functions compiled with clang++,
which outputs no name for the container class. */
/* Look for symbol NAME in this class. */
sym = cp_lookup_nested_symbol (type, name, block, domain);
/* Look for symbol NAME in this class. */
sym = cp_lookup_nested_symbol (type, name, block, domain);
if (scope_sym.symbol == NULL)
scope_sym = lookup_global_symbol (scope.c_str (), block, VAR_DOMAIN);
if (scope_sym.symbol == NULL)
if (scope_sym.symbol == NULL)
scope_sym = lookup_global_symbol (scope.c_str (), block, VAR_DOMAIN);
if (scope_sym.symbol == NULL)
struct type *scope_type = SYMBOL_TYPE (scope_sym.symbol);
/* If the scope is a function/method, then look up NESTED as a local
static variable. E.g., "print 'function()::static_var'". */
struct type *scope_type = SYMBOL_TYPE (scope_sym.symbol);
/* If the scope is a function/method, then look up NESTED as a local
static variable. E.g., "print 'function()::static_var'". */
- if (TYPE_CODE (scope_type) == TYPE_CODE_FUNC
- || TYPE_CODE (scope_type) == TYPE_CODE_METHOD)
+ if ((scope_type->code () == TYPE_CODE_FUNC
+ || scope_type->code () == TYPE_CODE_METHOD)
+ && domain == VAR_DOMAIN)
/* First, try to find the symbol in the given namespace if requested. */
if (search_scope_first)
sym = cp_lookup_symbol_in_namespace (scope, name,
/* First, try to find the symbol in the given namespace if requested. */
if (search_scope_first)
sym = cp_lookup_symbol_in_namespace (scope, name,
fprintf_unfiltered (gdb_stdlog,
"cp_lookup_nested_symbol (%s, %s, %s, %s)\n",
fprintf_unfiltered (gdb_stdlog,
"cp_lookup_nested_symbol (%s, %s, %s, %s)\n",