aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBryce McKinlay <bryce@albatross.co.nz>2001-01-11 03:00:56 +0000
committerBryce McKinlay <bryce@gcc.gnu.org>2001-01-11 03:00:56 +0000
commit7e1376a14cd5b2a8d1bd75524262b725ffe07f86 (patch)
tree7fa704f6c81f6c4555be28b85e5282bc03c4f793 /gcc
parentada6635f2b69135e1eb4c02691f67c316f916df4 (diff)
downloadgcc-7e1376a14cd5b2a8d1bd75524262b725ffe07f86.zip
gcc-7e1376a14cd5b2a8d1bd75524262b725ffe07f86.tar.gz
gcc-7e1376a14cd5b2a8d1bd75524262b725ffe07f86.tar.bz2
parse.y (resolve_expression_name): Permit instance variables from enclosing context in super constructor call.
* parse.y (resolve_expression_name): Permit instance variables from enclosing context in super constructor call. (resolve_qualified_expression_name): Permit enclosing class's qualified "this" in super constructor call. From-SVN: r38892
Diffstat (limited to 'gcc')
-rw-r--r--gcc/java/ChangeLog7
-rw-r--r--gcc/java/parse.y6
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index bf0b323..9b9dd58 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,10 @@
+2001-01-11 Bryce McKinlay <bryce@albatross.co.nz>
+
+ * parse.y (resolve_expression_name): Permit instance variables from
+ enclosing context in super constructor call.
+ (resolve_qualified_expression_name): Permit enclosing class's qualified
+ "this" in super constructor call.
+
2001-01-10 Mark Mitchell <mark@codesourcery.com>
* class.c (build_utf8_ref): Remove last argument in call to
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index a59e198..873de30 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -8954,7 +8954,8 @@ resolve_expression_name (id, orig)
}
/* Instance variables can't appear as an argument of
an explicit constructor invocation */
- if (!fs && ctxp->explicit_constructor_p)
+ if (!fs && ctxp->explicit_constructor_p
+ && !enclosing_context_p (DECL_CONTEXT (decl), current_class))
{
parse_error_context
(id, "Can't reference `%s' before the superclass constructor has been called", IDENTIFIER_POINTER (name));
@@ -9320,7 +9321,8 @@ resolve_qualified_expression_name (wfl, found_decl, where_found, type_found)
(wfl, "Keyword `this' used outside allowed context");
return 1;
}
- if (ctxp->explicit_constructor_p)
+ if (ctxp->explicit_constructor_p
+ && type == current_class)
{
parse_error_context (wfl, "Can't reference `this' before the superclass constructor has been called");
return 1;