This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Java: fixes to java/4510, java/4466 and java/1873.
- To: gcc-patches at gcc dot gnu dot org
- Subject: [PATCH] Java: fixes to java/4510, java/4466 and java/1873.
- From: Alexandre Petit-Bianco <apbianco at cygnus dot com>
- Date: Tue, 9 Oct 2001 15:53:08 -0700
- Reply-to: apbianco at cygnus dot com
This patch fixes a couple of PRs:
http://gcc.gnu.org/ml/java-prs/2001-q4/msg00013.html
http://gcc.gnu.org/ml/java-prs/2001-q4/msg00001.html
http://gcc.gnu.org/ml/java-prs/2001-q1/msg00023.html
It's been tested. I'm checking this in.
./A
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.
Index: parse.y
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/parse.y,v
retrieving revision 1.317
diff -u -p -r1.317 parse.y
--- parse.y 2001/10/07 16:51:06 1.317
+++ parse.y 2001/10/09 21:45:41
@@ -5211,10 +5211,12 @@ register_incomplete_type (kind, wfl, dec
JDEP_MISC (new) = NULL_TREE;
/* For some dependencies, set the enclosing class of the current
class to be the enclosing context */
- if ((kind == JDEP_SUPER || kind == JDEP_INTERFACE
- || kind == JDEP_ANONYMOUS)
+ if ((kind == JDEP_INTERFACE || kind == JDEP_ANONYMOUS)
&& 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
JDEP_ENCLOSING (new) = GET_CPC ();
JDEP_GET_PATCH (new) = (tree *)NULL;
@@ -10266,7 +10268,8 @@ patch_method_invocation (patch, primary,
/* Check for inner classes creation from illegal contexts */
if (lc && (INNER_CLASS_TYPE_P (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
(wfl, "No enclosing instance for inner class `%s' is in scope%s",
@@ -14448,9 +14451,14 @@ patch_cast (node, wfl_op)
tree wfl_op;
{
tree op = TREE_OPERAND (node, 0);
- tree op_type = TREE_TYPE (op);
tree cast_type = TREE_TYPE (node);
+ tree patched, op_type;
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 */
if (!(cast_type = resolve_type_during_patch (cast_type)))