diff options
author | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-22 05:03:35 +0000 |
---|---|---|
committer | apbianco <apbianco@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-09-22 05:03:35 +0000 |
commit | 4b424275d18414b66b79a3ba65d7c7298518e866 (patch) | |
tree | ce02214a3f412baa56820b7257afbab217b7a5f3 /gcc/java | |
parent | 7b15bb798f77c082528c7cb3a96284cabb499bdc (diff) | |
download | gcc-4b424275d18414b66b79a3ba65d7c7298518e866.tar.gz |
2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_method_invocation): Build class initialization
when static finals are used to qualify method invocation.
Fixes PR java/4366.
( http://gcc.gnu.org/ml/gcc-patches/2001-09/msg00880.html )
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45743 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/java/parse.y | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index fcfb7eb52f0..837900855ce 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -4,6 +4,12 @@ (build_dtable_decl): Likewise. * expr.c (build_invokevirtual): Likewise. +2001-09-20 Alexandre Petit-Bianco <apbianco@redhat.com> + + * parse.y (patch_method_invocation): Build class initialization + when static finals are used to qualify method invocation. + Fixes PR java/4366. + 2001-09-19 Alexandre Petit-Bianco <apbianco@redhat.com> * parse.h: (WFL_STRIP_BRACKET): Re-written using diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 0c8953e0efe..9a0656a3e62 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -10096,6 +10096,12 @@ patch_method_invocation (patch, primary, where, from_super, qualify_ambiguous_name (wfl); resolved = resolve_field_access (wfl, NULL, NULL); + if (TREE_CODE (resolved) == VAR_DECL && FIELD_STATIC (resolved) + && FIELD_FINAL (resolved) + && !inherits_from_p (DECL_CONTEXT (resolved), current_class) + && !flag_emit_class_files && !flag_emit_xref) + resolved = build_class_init (DECL_CONTEXT (resolved), resolved); + if (resolved == error_mark_node) PATCH_METHOD_RETURN_ERROR (); |