diff options
author | Tom Tromey <tromey@redhat.com> | 2004-12-06 15:32:38 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2004-12-06 15:32:38 +0000 |
commit | a58d74533c0b06903094936b4d3ba3712fe10ca9 (patch) | |
tree | c828f6f61d900bf37c9c5909e2bd3852aef32c0a /gcc/java/check-init.c | |
parent | 0bc371d376f3fe74f0be50edd9d7b1dc82d22598 (diff) | |
download | gcc-a58d74533c0b06903094936b4d3ba3712fe10ca9.zip gcc-a58d74533c0b06903094936b4d3ba3712fe10ca9.tar.gz gcc-a58d74533c0b06903094936b4d3ba3712fe10ca9.tar.bz2 |
re PR java/14853 (Assignment to final field permitted when compiling to native)
PR java/14853:
* java-tree.h (extract_field_decl): Declare.
* parse.y (extract_field_decl): Renamed from
strip_out_static_field_access_decl. No longer static.
* check-init.c (get_variable_decl): Unwrap COMPOUND_EXPRs.
From-SVN: r91778
Diffstat (limited to 'gcc/java/check-init.c')
-rw-r--r-- | gcc/java/check-init.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/java/check-init.c b/gcc/java/check-init.c index 05692b0..e124ffc 100644 --- a/gcc/java/check-init.c +++ b/gcc/java/check-init.c @@ -164,6 +164,11 @@ static void check_final_reassigned (tree, words); static tree get_variable_decl (tree exp) { + /* A static field can be wrapped in a COMPOUND_EXPR where the first + argument initializes the class. */ + if (TREE_CODE (exp) == COMPOUND_EXPR) + exp = extract_field_decl (exp); + if (TREE_CODE (exp) == VAR_DECL) { if (! TREE_STATIC (exp) || FIELD_FINAL (exp)) |