From 8084bf81c782ec5d2831db7fa576089ccb0c5d49 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Fri, 12 Mar 1999 17:16:53 +0000 Subject: 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 --- gcc/cp/ChangeLog | 8 ++++++++ gcc/cp/lex.c | 2 +- gcc/cp/search.c | 4 ++-- gcc/testsuite/g++.old-deja/g++.martin/access1.C | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 2c7eace..e43e9c8 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +1999-03-12 Mark Mitchell + + * 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 * semantics.c (begin_class_definition): Call build_self_reference. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 6d440f4..700597a 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -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); } diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 18269fa..6583e69 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -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) diff --git a/gcc/testsuite/g++.old-deja/g++.martin/access1.C b/gcc/testsuite/g++.old-deja/g++.martin/access1.C index 13db27e..a4e0f63 100644 --- a/gcc/testsuite/g++.old-deja/g++.martin/access1.C +++ b/gcc/testsuite/g++.old-deja/g++.martin/access1.C @@ -1,12 +1,12 @@ // 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){} }; }; -- cgit v1.1