From e333a61815b7ced28c4bc1337040b123c54c488f Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 8 Feb 2004 23:41:55 -0800 Subject: [PATCH] parse.y (resolve_qualified_expression_name): In case of inaccessible class don't use not_accessible_field_error... * parse.y (resolve_qualified_expression_name): In case of inaccessible class don't use not_accessible_field_error, which can get confused. From-SVN: r77525 --- gcc/java/ChangeLog | 5 +++++ gcc/java/parse.y | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 23a2cdb..2132bc4 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2004-02-08 Per Bothner + + * parse.y (resolve_qualified_expression_name): In case of inaccessible + class don't use not_accessible_field_error, which can get confused. + 2004-02-05 Kelley Cook Make-lang.in (po-generated): Delete. diff --git a/gcc/java/parse.y b/gcc/java/parse.y index 93755ea..390b8cd 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -9869,7 +9869,14 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl, } if (not_accessible_p (TREE_TYPE (decl), decl, type, 0)) - return not_accessible_field_error (qual_wfl, decl); + { + parse_error_context + (qual_wfl, "Can't access %s class '%s' from '%s'", + java_accstring_lookup (get_access_flags_from_decl (decl)), + IDENTIFIER_POINTER (DECL_NAME (decl)), + IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (current_class)))); + return 1; + } check_deprecation (qual_wfl, decl); type = TREE_TYPE (decl); -- 2.7.4