Commit 3fb5c0eb by Alexandre Petit-Bianco Committed by Alexandre Petit-Bianco

[multiple changes]

2001-10-09  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (patch_cast): Call patch_string on the first operand of
	the incoming node, update it if necessary. Fixes java/4510.

2001-10-05  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (register_incomplete_type): Set JDEP_SUPER to be given
	a NULL enclosing context if appropriate. Fixes java/4466.

2001-09-17  Alexandre Petit-Bianco  <apbianco@redhat.com>

	* parse.y (patch_method_invocation): Inner class creation context
	check not enforced within constructors. Fixes PR java/1873.

( http://gcc.gnu.org/ml/gcc-patches/2001-10/msg00397.html )

From-SVN: r46133
parent d1d8ed98
2001-10-09 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_cast): Call patch_string on the first operand of
the incoming node, update it if necessary. Fixes java/4510.
2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz> 2001-10-09 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* parse.y (find_as_inner_class): Don't disregard the enclosing scope * parse.y (find_as_inner_class): Don't disregard the enclosing scope
...@@ -16,6 +21,11 @@ ...@@ -16,6 +21,11 @@
* lex.c (java_get_line_col): Likewise. * lex.c (java_get_line_col): Likewise.
* parse.y (build_incdec): Likewise. * parse.y (build_incdec): Likewise.
2001-10-05 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (register_incomplete_type): Set JDEP_SUPER to be given
a NULL enclosing context if appropriate. Fixes java/4466.
2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com> 2001-10-03 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_assignment): Use lvalue's original TYPE when * parse.y (patch_assignment): Use lvalue's original TYPE when
...@@ -72,6 +82,11 @@ ...@@ -72,6 +82,11 @@
* parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout. * parse.y: Use VA_OPEN/VA_CLOSE/VA_FIXEDARG throughout.
* jv-scan.c: Likewise. * jv-scan.c: Likewise.
2001-09-17 Alexandre Petit-Bianco <apbianco@redhat.com>
* parse.y (patch_method_invocation): Inner class creation context
check not enforced within constructors. Fixes PR java/1873.
2001-09-16 Tom Tromey <tromey@redhat.com> 2001-09-16 Tom Tromey <tromey@redhat.com>
* jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call * jcf-write.c (generate_bytecode_insns) [SWITCH_EXPR]: Call
......
...@@ -5200,10 +5200,12 @@ register_incomplete_type (kind, wfl, decl, ptr) ...@@ -5200,10 +5200,12 @@ register_incomplete_type (kind, wfl, decl, ptr)
JDEP_MISC (new) = NULL_TREE; JDEP_MISC (new) = NULL_TREE;
/* For some dependencies, set the enclosing class of the current /* For some dependencies, set the enclosing class of the current
class to be the enclosing context */ class to be the enclosing context */
if ((kind == JDEP_SUPER || kind == JDEP_INTERFACE if ((kind == JDEP_INTERFACE || kind == JDEP_ANONYMOUS)
|| kind == JDEP_ANONYMOUS)
&& GET_ENCLOSING_CPC ()) && GET_ENCLOSING_CPC ())
JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ()); JDEP_ENCLOSING (new) = TREE_VALUE (GET_ENCLOSING_CPC ());
else if (kind == JDEP_SUPER)
JDEP_ENCLOSING (new) = (GET_ENCLOSING_CPC () ?
TREE_VALUE (GET_ENCLOSING_CPC ()) : NULL_TREE);
else else
JDEP_ENCLOSING (new) = GET_CPC (); JDEP_ENCLOSING (new) = GET_CPC ();
JDEP_GET_PATCH (new) = (tree *)NULL; JDEP_GET_PATCH (new) = (tree *)NULL;
...@@ -10255,7 +10257,8 @@ patch_method_invocation (patch, primary, where, from_super, ...@@ -10255,7 +10257,8 @@ patch_method_invocation (patch, primary, where, from_super,
/* Check for inner classes creation from illegal contexts */ /* Check for inner classes creation from illegal contexts */
if (lc && (INNER_CLASS_TYPE_P (class_to_search) if (lc && (INNER_CLASS_TYPE_P (class_to_search)
&& !CLASS_STATIC (TYPE_NAME (class_to_search))) && !CLASS_STATIC (TYPE_NAME (class_to_search)))
&& INNER_ENCLOSING_SCOPE_CHECK (class_to_search)) && INNER_ENCLOSING_SCOPE_CHECK (class_to_search)
&& !DECL_INIT_P (current_function_decl))
{ {
parse_error_context parse_error_context
(wfl, "No enclosing instance for inner class `%s' is in scope%s", (wfl, "No enclosing instance for inner class `%s' is in scope%s",
...@@ -14437,10 +14440,15 @@ patch_cast (node, wfl_op) ...@@ -14437,10 +14440,15 @@ patch_cast (node, wfl_op)
tree wfl_op; tree wfl_op;
{ {
tree op = TREE_OPERAND (node, 0); tree op = TREE_OPERAND (node, 0);
tree op_type = TREE_TYPE (op);
tree cast_type = TREE_TYPE (node); tree cast_type = TREE_TYPE (node);
tree patched, op_type;
char *t1; char *t1;
/* Some string patching might be necessary at this stage */
if ((patched = patch_string (op)))
TREE_OPERAND (node, 0) = op = patched;
op_type = TREE_TYPE (op);
/* First resolve OP_TYPE if unresolved */ /* First resolve OP_TYPE if unresolved */
if (!(cast_type = resolve_type_during_patch (cast_type))) if (!(cast_type = resolve_type_during_patch (cast_type)))
return error_mark_node; return error_mark_node;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment