lex.c (do_identifier): Correct call to enforce_access.
authorMark Mitchell <mark@markmitchell.com>
Fri, 12 Mar 1999 17:16:53 +0000 (17:16 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Fri, 12 Mar 1999 17:16:53 +0000 (17:16 +0000)
* 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
gcc/cp/lex.c
gcc/cp/search.c
gcc/testsuite/g++.old-deja/g++.martin/access1.C

index 2c7eace4e641c7c919aa0e612dcbc9248c61766a..e43e9c88113d54fd5d00cc3b276a713902639ff8 100644 (file)
@@ -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.
index 6d440f424741d9f37facfa3fc47903d0d7584e53..700597ab547cf622b2a197b40769fef1ad350516 100644 (file)
@@ -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);
     }
index 18269fa16fffa8e452b7d5bba2e6d0a7da09e0d4..6583e696935976b1e3d3f461abb25e7b2b1ca319 100644 (file)
@@ -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)
index 13db27ec9b72c84af39cabd0b5531d9effc46608..a4e0f63168d9bfcfe2d2650823b3afb640d4fca9 100644 (file)
@@ -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){} 
     };
 };