summaryrefslogtreecommitdiff
path: root/gcc/java/parse.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/parse.h')
-rw-r--r--gcc/java/parse.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index c11e70d9295..798d1391770 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -844,8 +844,11 @@ struct parser_ctxt {
(TREE_TYPE (DECL_CONTEXT \
(TYPE_NAME (TREE_TYPE (TREE_TYPE (current_this))))),\
TREE_TYPE (DECL_CONTEXT (TYPE_NAME (T))))) \
- /* We don't have a this. */ \
- || !current_this))
+ /* We don't have a this, which is OK if the current function is \
+ static. */ \
+ || (!current_this \
+ && current_function_decl \
+ && ! METHOD_STATIC (current_function_decl))))
/* Push macro. First argument to PUSH_CPC is a DECL_TYPE, second
argument is the unqualified currently parsed class name. */