diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2005-08-08 14:56:18 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2005-08-08 14:56:18 +0000 |
commit | 063fb392d218bfecd0d60dc790a94cf7208b92aa (patch) | |
tree | 286bf4d6e59159e3c998a456c121a115c046e034 /gcc/java/parse.y | |
parent | f303a996311673f8c9178f6593bf4c804077a8ec (diff) | |
download | gcc-063fb392d218bfecd0d60dc790a94cf7208b92aa.zip gcc-063fb392d218bfecd0d60dc790a94cf7208b92aa.tar.gz gcc-063fb392d218bfecd0d60dc790a94cf7208b92aa.tar.bz2 |
class.c (build_class_ref): Wrap the primary class type in a NOP_EXPR.
* class.c (build_class_ref): Wrap the primary class type in a
NOP_EXPR.
* parse.y (java_complete_lhs) <COMPONENT_REF case>: Extract the
primary class type from the NOP_EXPR in which it was placed.
From-SVN: r102859
Diffstat (limited to 'gcc/java/parse.y')
-rw-r--r-- | gcc/java/parse.y | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 10a37e0..82c156e 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -12382,26 +12382,30 @@ java_complete_lhs (tree node) case COMPONENT_REF: /* The first step in the re-write of qualified name handling. FIXME. - So far, this is only to support PRIMTYPE.class -> PRIMCLASS.TYPE. */ - TREE_OPERAND (node, 0) = java_complete_tree (TREE_OPERAND (node, 0)); - if (TREE_CODE (TREE_OPERAND (node, 0)) == RECORD_TYPE) - { - tree name = TREE_OPERAND (node, 1); - tree field = lookup_field_wrapper (TREE_OPERAND (node, 0), name); - if (field == NULL_TREE) - { - error ("missing static field %qs", IDENTIFIER_POINTER (name)); - return error_mark_node; - } - if (! FIELD_STATIC (field)) - { - error ("not a static field %qs", IDENTIFIER_POINTER (name)); - return error_mark_node; - } - return field; - } - else - abort (); + So far, this is only to support PRIMTYPE.class -> + PRIMCLASS.TYPE. */ + { + tree prim_class = TREE_OPERAND (node, 0); + tree name = TREE_OPERAND (node, 1); + tree field; + + gcc_assert (TREE_CODE (prim_class) == NOP_EXPR); + prim_class = java_complete_tree (TREE_TYPE (prim_class)); + gcc_assert (TREE_CODE (prim_class) == RECORD_TYPE); + field = lookup_field_wrapper (prim_class, name); + + if (field == NULL_TREE) + { + error ("missing static field %qs", IDENTIFIER_POINTER (name)); + return error_mark_node; + } + if (! FIELD_STATIC (field)) + { + error ("not a static field %qs", IDENTIFIER_POINTER (name)); + return error_mark_node; + } + return field; + } break; case THIS_EXPR: |