summaryrefslogtreecommitdiff
path: root/gcc/java/parse.h
diff options
context:
space:
mode:
authorAlexandre Petit-Bianco <apbianco@cygnus.com>2000-06-01 07:44:58 +0000
committerAlexandre Petit-Bianco <apbianco@gcc.gnu.org>2000-06-01 00:44:58 -0700
commit152de068640f04fc98afdd252a828d7f601c5d65 (patch)
tree586253d11f233cbb77aa2d57a0c67ea6ec106370 /gcc/java/parse.h
parent3aac3c2fd48d6b18b196acb1b9ad5cf9a0cd85ac (diff)
downloadgcc-152de068640f04fc98afdd252a828d7f601c5d65.tar.gz
class.c (common_enclosing_context_p): New function.
2000-04-24 Alexandre Petit-Bianco <apbianco@cygnus.com> * class.c (common_enclosing_context_p): New function. * java-tree.h (common_enclosing_context_p): Added prototype. * parse.h (INNER_ENCLOSING_SCOPE_CHECK): Relaxed test to allow classes sharing an outer context with the current instance. * parse.y (build_access_to_thisn): Fixed leading comment. (verify_constructor_super): New local `supper_inner'. Skip enclosing context argument in the case of inner class constructors. (patch_method_invocation): Insert proper context as second parameter to pure inner class constructor super invocations. This fixes the Java PR #177. From-SVN: r34332
Diffstat (limited to 'gcc/java/parse.h')
-rw-r--r--gcc/java/parse.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/gcc/java/parse.h b/gcc/java/parse.h
index 4ffee796e41..24b0b9b8280 100644
--- a/gcc/java/parse.h
+++ b/gcc/java/parse.h
@@ -822,15 +822,17 @@ struct parser_ctxt {
/* Make sure that innerclass T sits in an appropriate enclosing
context. */
-#define INNER_ENCLOSING_SCOPE_CHECK(T) \
- (INNER_CLASS_TYPE_P ((T)) && !ANONYMOUS_CLASS_P ((T)) \
- && ((current_this \
- /* We have a this and it's not the right one */ \
- && (DECL_CONTEXT (TYPE_NAME ((T))) \
- != TYPE_NAME (TREE_TYPE (TREE_TYPE (current_this)))) \
- && !inherits_from_p (TREE_TYPE (TREE_TYPE (current_this)), \
- TREE_TYPE (DECL_CONTEXT (TYPE_NAME (T))))) \
- /* We don't have a this. */ \
+#define INNER_ENCLOSING_SCOPE_CHECK(T) \
+ (INNER_CLASS_TYPE_P ((T)) && !ANONYMOUS_CLASS_P ((T)) \
+ && ((current_this \
+ /* We have a this and it's not the right one */ \
+ && (DECL_CONTEXT (TYPE_NAME ((T))) \
+ != TYPE_NAME (TREE_TYPE (TREE_TYPE (current_this)))) \
+ && !inherits_from_p (TREE_TYPE (TREE_TYPE (current_this)), \
+ TREE_TYPE (DECL_CONTEXT (TYPE_NAME (T)))) \
+ && !common_enclosing_context_p (TREE_TYPE (TREE_TYPE (current_this)), \
+ (T))) \
+ /* We don't have a this. */ \
|| !current_this))
/* Push macro. First argument to PUSH_CPC is a DECL_TYPE, second