gdb/fortran: Nested subroutine support
[deliverable/binutils-gdb.git] / gdb / cp-namespace.c
index 5b352d1d77be8f092719c3926af170947ce313f8..e15b77e701ddd832ad12b33a4ee6ef2203423a55 100644 (file)
@@ -278,8 +278,9 @@ cp_search_static_and_baseclasses (const char *name,
 
   /* 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 ((TYPE_CODE (scope_type) == TYPE_CODE_FUNC
+       || TYPE_CODE (scope_type) == TYPE_CODE_METHOD)
+      && domain == VAR_DOMAIN)
     return lookup_symbol (nested, SYMBOL_BLOCK_VALUE (scope_sym.symbol),
                          VAR_DOMAIN, NULL);
 
This page took 0.025542 seconds and 4 git commands to generate.