This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug java/8618] call to private constructor allowed for anonymous inner class
- From: "cvs-commit at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jul 2004 05:38:31 -0000
- Subject: [Bug java/8618] call to private constructor allowed for anonymous inner class
- References: <20021117200601.8618.jmr@ugcs.caltech.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-07-10 05:38 -------
Subject: Bug 8618
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: bryce@gcc.gnu.org 2004-07-10 05:38:16
Modified files:
gcc/java : ChangeLog class.c java-tree.h jcf-write.c
parse.h parse.y
Log message:
2004-07-09 Bryce McKinlay <mckinlay@redhat.com>
PR java/8618
* parse.y (create_anonymous_class): Remove 'location' argument. Use
the WFL from TYPE_NAME to get line number for the decl. Fix comment.
(craft_constructor): Inherit access flags for implicit constructor
from the enclosing class.
(create_class): Fix comment typo.
(resolve_qualified_expression_name): Pass type of qualifier to
not_accessible_p, not the type in which target field was found.
(not_accessible_p): Handle inner classes. Expand protected
qualifier-subtype check to enclosing instances, but don't apply this
check to static members. Allow protected access to inner classes
of a subtype. Allow private access within common enclosing context.
(build_super_invocation): Get WFL line number info from current
class decl.
(build_incomplete_class_ref): Update for new create_anonymous_class
signature.
* parse.h (INNER_ENCLOSING_SCOPE_CHECK): Use
common_enclosing_instance_p.
* class.c (common_enclosing_context_p): New. Determine if types
share a common enclosing context, even across static contexts.
(common_enclosing_instance_p): Renamed from
common_enclosing_context_p. Determines if types share a common
non-static enclosing instance.
* java-tree.h (common_enclosing_instance_p): Declare.
* jcf-write.c (get_method_access_flags): New. Surpress private flag
for inner class constructors.
(generate_classfile): Use get_method_access_flags.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/ChangeLog.diff?cvsroot=gcc&r1=1.1408&r2=1.1409
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/class.c.diff?cvsroot=gcc&r1=1.196&r2=1.197
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/java-tree.h.diff?cvsroot=gcc&r1=1.209&r2=1.210
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/jcf-write.c.diff?cvsroot=gcc&r1=1.150&r2=1.151
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.h.diff?cvsroot=gcc&r1=1.97&r2=1.98
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/java/parse.y.diff?cvsroot=gcc&r1=1.490&r2=1.491
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8618