diff options
author | Mark Mitchell <mark@markmitchell.com> | 1999-03-12 17:16:53 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-03-12 17:16:53 +0000 |
commit | 8084bf81c782ec5d2831db7fa576089ccb0c5d49 (patch) | |
tree | 324eaa07599158fe54d16bb0b75f220356b2318d | |
parent | 7e21fe59b2a6fdd9b5ac1f11f554fd64a7285bbd (diff) | |
download | gcc-8084bf81c782ec5d2831db7fa576089ccb0c5d49.zip gcc-8084bf81c782ec5d2831db7fa576089ccb0c5d49.tar.gz gcc-8084bf81c782ec5d2831db7fa576089ccb0c5d49.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/lex.c | 2 | ||||
-rw-r--r-- | gcc/cp/search.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.martin/access1.C | 4 |
4 files changed, 13 insertions, 5 deletions
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 <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. 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){} }; }; |