* 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
+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.
{
/* 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);
}
/* 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){}
};
};