re PR java/12866 (gcj checks `throws' clause on artificial method)
authorJeff Sturm <jsturm@one-point.com>
Mon, 3 Nov 2003 03:58:50 +0000 (03:58 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Mon, 3 Nov 2003 03:58:50 +0000 (03:58 +0000)
Fixes PR java/12866.
* parse.y (resolve_qualified_expression_name): Move test
for outer field access methods from here...
(check_thrown_exceptions) ...to here.

From-SVN: r73210

gcc/java/ChangeLog
gcc/java/parse.y

index 77c171c..fa42410 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-02  Jeff Sturm  <jsturm@one-point.com>
+
+       Fixes PR java/12866.
+       * parse.y (resolve_qualified_expression_name): Move test
+       for outer field access methods from here...
+       (check_thrown_exceptions) ...to here.
+
 2003-11-01  Kelley Cook  <kcook@gcc.gnu.org>
 
        * .cvsignore: Delete.
index 3f63300..448e0c8 100644 (file)
@@ -9601,10 +9601,7 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl,
             instantiation using a primary qualified by a `new' */
          RESTORE_THIS_AND_CURRENT_CLASS;
 
-         /* EH check. No check on access$<n> functions */
-         if (location
-             && !OUTER_FIELD_ACCESS_IDENTIFIER_P
-                   (DECL_NAME (current_function_decl)))
+         if (location)
            {
              tree arguments = NULL_TREE;
              if (TREE_CODE (qual_wfl) == CALL_EXPR
@@ -15783,6 +15780,10 @@ check_thrown_exceptions (int location, tree decl, tree this_expr)
   tree throws;
   int is_array_call = 0;
 
+  /* Skip check within generated methods, such as access$<n>.  */
+  if (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl)))
+    return;
+
   if (this_expr != NULL_TREE
       && TREE_CODE (TREE_TYPE (this_expr)) == POINTER_TYPE
       && TYPE_ARRAY_P (TREE_TYPE (TREE_TYPE (this_expr))))