Commit 8084bf81 by Mark Mitchell Committed by Mark Mitchell

lex.c (do_identifier): Correct call to enforce_access.

	* lex.c (do_identifier): Correct call to enforce_access.
	* search.c (accessible_p): Tweak comment.
	* decl2.c (validate_nonmember_using_decl): Issue sensible
	error-messages on bogus qualifiers.

From-SVN: r25732
parent 7e21fe59
1999-03-12 Mark Mitchell <mark@markmitchell.com>
* lex.c (do_identifier): Correct call to enforce_access.
* search.c (accessible_p): Tweak comment.
* decl2.c (validate_nonmember_using_decl): Issue sensible
error-messages on bogus qualifiers.
1999-03-10 Mark Mitchell <mark@markmitchell.com>
* semantics.c (begin_class_definition): Call build_self_reference.
......
......@@ -3045,7 +3045,7 @@ do_identifier (token, parsing, args)
{
/* Check access. */
if (IDENTIFIER_CLASS_VALUE (token) == id)
enforce_access (current_class_type, id);
enforce_access (DECL_REAL_CONTEXT(id), id);
if (!processing_template_decl || DECL_TEMPLATE_PARM_P (id))
id = DECL_INITIAL (id);
}
......
......@@ -849,8 +849,8 @@ dfs_accessible_p (binfo, data)
/* DECL is a declaration from a base class of TYPE, which was the
classs used to name DECL. Return non-zero if, in the current
context, DECL is accessible. If TYPE is actually a BINFO node,
then the most derived class along the path indicated by BINFO is
the one used to name the DECL. */
then we can tell in what context the access is occurring by looking
at the most derived class along the path indicated by BINFO. */
int
accessible_p (type, decl)
......
// Build don't link:
class A{
public:
enum Foo{f1,f2}; // gets bogus error - XFAIL
enum Foo{f1,f2};
class B{
friend class A;
Foo f;
public:
B():f(f1){} // gets bogus error (inaccessible) - XFAIL
B():f(f1){}
};
};
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