* parse.y (lookup_field_wrapper): Unified returned value to NULL
or the searched field decl.
Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (fold_constant_for_init): Convert numerical constant
values to the type of the assigned field.
Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* expr.c (lookup_field): Relaxed the test on class loading error
detection.
* parse.y (fold_constant_for_init): Enabeled old code.
Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
decide the validity of the cast of a java.lang.Cloneable reference
to an array.
(patch_conditional_expr): Fixed first argument passed to
binary_numeric_promotion.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@27229
138bc75d-0d04-0410-961f-
82ee72b054a4
+Fri May 28 18:22:45 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (lookup_field_wrapper): Unified returned value to NULL
+ or the searched field decl.
+
+Fri May 28 11:34:05 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (fold_constant_for_init): Convert numerical constant
+ values to the type of the assigned field.
+
+Thu May 27 19:57:40 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * expr.c (lookup_field): Relaxed the test on class loading error
+ detection.
+ * parse.y (fold_constant_for_init): Enabeled old code.
+
+Wed May 26 18:06:02 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
+
+ * parse.y (valid_ref_assignconv_cast_p): Let `_Jv_CheckCast'
+ decide the validity of the cast of a java.lang.Cloneable reference
+ to an array.
+ (patch_conditional_expr): Fixed first argument passed to
+ binary_numeric_promotion.
+
Wed May 26 15:33:06 1999 Alexandre Petit-Bianco <apbianco@cygnus.com>
* parse.y (qualify_ambiguous_name): Take into account that a
if (CLASS_P (*typep) && !CLASS_LOADED_P (*typep))
{
load_class (*typep, 1);
- if (TREE_CODE (TYPE_SIZE (*typep)) == ERROR_MARK)
+ if (!TYPE_SIZE (*typep) || TREE_CODE (TYPE_SIZE (*typep)) == ERROR_MARK)
return error_mark_node;
}
do
java_parser_context_save_global ();
decl = lookup_field (&type, name);
java_parser_context_restore_global ();
- return decl;
+ return decl == error_mark_node ? NULL : decl;
}
/* Find duplicate field within the same class declarations and report
return source == dest || interface_of_p (dest, source);
}
else /* Array */
- return 0;
+ return (cast ?
+ (DECL_NAME (TYPE_NAME (source)) == java_lang_cloneable) : 0);
}
if (TYPE_ARRAY_P (source))
{
/* Otherwise, binary numeric promotion is applied and the
resulting type is the promoted type of operand 1 and 2 */
else
- resulting_type = binary_numeric_promotion (t2, t2,
+ resulting_type = binary_numeric_promotion (t1, t2,
&TREE_OPERAND (node, 1),
&TREE_OPERAND (node, 2));
}
tree op0, op1, val;
enum tree_code code = TREE_CODE (node);
- if (code == INTEGER_CST || code == REAL_CST || code == STRING_CST)
+ if (code == STRING_CST)
return node;
+
+ if (code == INTEGER_CST || code == REAL_CST)
+ return convert (TREE_TYPE (context), node);
if (TREE_TYPE (node) != NULL_TREE && code != VAR_DECL)
return NULL_TREE;
}
else
{
-#if 0
/* Wait until the USE_COMPONENT_REF re-write. FIXME. */
qualify_ambiguous_name (node);
if (resolve_field_access (node, &decl, NULL)
&& decl != NULL_TREE)
return fold_constant_for_init (decl, decl);
-#endif
return NULL_TREE;
}
}
java_parser_context_save_global ();
decl = lookup_field (&type, name);
java_parser_context_restore_global ();
- return decl;
+ return decl == error_mark_node ? NULL : decl;
}
/* Find duplicate field within the same class declarations and report
return source == dest || interface_of_p (dest, source);
}
else /* Array */
- return 0;
+ return (cast ?
+ (DECL_NAME (TYPE_NAME (source)) == java_lang_cloneable) : 0);
}
if (TYPE_ARRAY_P (source))
{
/* Otherwise, binary numeric promotion is applied and the
resulting type is the promoted type of operand 1 and 2 */
else
- resulting_type = binary_numeric_promotion (t2, t2,
+ resulting_type = binary_numeric_promotion (t1, t2,
&TREE_OPERAND (node, 1),
&TREE_OPERAND (node, 2));
}
tree op0, op1, val;
enum tree_code code = TREE_CODE (node);
- if (code == INTEGER_CST || code == REAL_CST || code == STRING_CST)
+ if (code == STRING_CST)
return node;
+
+ if (code == INTEGER_CST || code == REAL_CST)
+ return convert (TREE_TYPE (context), node);
if (TREE_TYPE (node) != NULL_TREE && code != VAR_DECL)
return NULL_TREE;
}
else
{
-#if 0
/* Wait until the USE_COMPONENT_REF re-write. FIXME. */
qualify_ambiguous_name (node);
if (resolve_field_access (node, &decl, NULL)
&& decl != NULL_TREE)
return fold_constant_for_init (decl, decl);
-#endif
return NULL_TREE;
}
}