diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-13 19:20:22 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-13 19:20:22 +0000 |
commit | de423c677d91eab51bbf225036ec74439c1ae3aa (patch) | |
tree | 43d19766aaba73926ee2ae577243e6ab28129ad7 /gcc/java | |
parent | 1dcfcddb755a731dc859a7651687a6d9bfd878a0 (diff) | |
download | gcc-de423c677d91eab51bbf225036ec74439c1ae3aa.tar.gz |
PR java/21844:
* parse.y (nested_field_access_p): Handle case where outer field
is inherited by enclosing class.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100893 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/parse.y | 14 |
2 files changed, 13 insertions, 7 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index c16e1ef849b..52196e49a36 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,9 @@ +2005-06-13 Tom Tromey <tromey@redhat.com> + + PR java/21844: + * parse.y (nested_field_access_p): Handle case where outer field + is inherited by enclosing class. + 2005-06-12 Per Bothner <per@bothner.com> * class.c (inherits_from_p): Do load_class if needed. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index ebaede8ab12..11087192bec 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -8389,13 +8389,6 @@ nested_field_access_p (tree type, tree decl) { if (type_root == decl_type) return 1; - - /* Before we give up, see whether it is a non-static field - inherited from the enclosing context we are considering. */ - if (!DECL_CONTEXT (TYPE_NAME (type_root)) - && !is_static - && inherits_from_p (type_root, decl_type)) - return 1; } if (TREE_CODE (decl_type) == RECORD_TYPE @@ -8416,6 +8409,13 @@ nested_field_access_p (tree type, tree decl) if (type_root == decl_type_root) return 1; + /* Before we give up, see whether it is a non-static field + inherited from the enclosing context we are considering. */ + if (!DECL_CONTEXT (TYPE_NAME (type_root)) + && !is_static + && inherits_from_p (type_root, decl_type)) + return 1; + return 0; } |