diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-16 00:00:43 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-12-16 00:00:43 +0000 |
commit | f8691bddfa6cfee3b1e7d423b6c1ba3f701028ef (patch) | |
tree | e06c0bfb5fa1f496d9e6efbc365804803285a3a4 /gcc/java | |
parent | 16c6b1e73d6be46354b5c25d9b8ecc3c0e5e739f (diff) | |
download | gcc-f8691bddfa6cfee3b1e7d423b6c1ba3f701028ef.tar.gz |
gcc/java:
PR java/25429
* parse.y (resolve_expression_name): Don't generate accessor
methods for constant fields.
libjava:
* testsuite/libjava.compile/rh175833.java: New file.
* testsuite/libjava.compile/pr25429.java: New file.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@108608 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r-- | gcc/java/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/java/parse.y | 11 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 05577d5dc47..9843b6cbedd 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,10 @@ +2005-12-15 Tom Tromey <tromey@redhat.com> + Andrew Haley <aph@redhat.com> + + PR java/25429 + * parse.y (resolve_expression_name): Don't generate accessor + methods for constant fields. + 2005-12-13 Andrew Haley <aph@redhat.com> PR java/25366 diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 056feeaa2c6..a467ff15a79 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9584,8 +9584,15 @@ resolve_expression_name (tree id, tree *orig) /* If we're processing an inner class and we're trying to access a field belonging to an outer class, build - the access to the field. */ - if (nested_member_access_p (current_class, decl)) + the access to the field. + As usual, we have to treat initialized static final + variables as a special case. */ + if (nested_member_access_p (current_class, decl) + && ! (JDECL_P (decl) && CLASS_FINAL_VARIABLE_P (decl) + && DECL_INITIAL (decl) != NULL_TREE + && (JSTRING_TYPE_P (TREE_TYPE (decl)) + || JNUMERIC_TYPE_P (TREE_TYPE (decl))) + && TREE_CONSTANT (DECL_INITIAL (decl)))) { if (!fs && CLASS_STATIC (TYPE_NAME (current_class))) { |