This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [HTML] Add new C++ access check rules to changes.html (PR 14949)


On Thu, 10 Jun 2004, Giovanni Bajo wrote:

> Hello,
>
> this patch implements PR 14949, which is basically adding a brief documentation
> about the change introduced by the fix for PR 11174 (made by Kriang for GCC
> 3.4.0). Since a fair number of persons submitted an invalid bug about this, I
> think it is worth documenting it.
>
> Tested with the validator, OK to commit?
>
> Giovanni Bajo
>
>
> Index: changes.html
> ===================================================================
> RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.4/changes.html,v
> retrieving revision 1.116
> diff -c -3 -p -r1.116 changes.html
> *** changes.html 20 Apr 2004 18:39:01 -0000 1.116
> --- changes.html 10 Jun 2004 12:03:03 -0000
> ***************
> *** 574,582 ****
>      foo(a1);        // OK, a1 is a lvalue
>    }</pre>
>
> !  This might be surprising at first sight, especially since most
>    popular compilers do not correctly implement this rule
> !  (<a href="../bugs.html#cxx_rvalbind">further details</a>).</li>
>     </ul>
>
>     <h4>Runtime Library (libstdc++)</h4>
> --- 578,617 ----
>      foo(a1);        // OK, a1 is a lvalue
>    }</pre>
>
> !  <p>This might be surprising at first sight, especially since most
>    popular compilers do not correctly implement this rule
> !  (<a href="../bugs.html#cxx_rvalbind">further details</a>).</p></li>
> !
> !  <li>When forming a pointer to member or a pointer to member function,
> !  access checks for class visibility (public, protected, private)
> !  are now performed using the qualifying scope of the name itself.
> !  This is better explained with an example:
> !
> !  <pre>
> !  class A
> !  {
> !  public:
> !    void pub_func(void);
> !  protected:
> !    void prot_func(void);
> !  private:
> !    void priv_func(void);
> !  };
> !
> !  class B : public A
> !  {
> !  public:
> !    void foo(void)
> !    {
> !      &amp;A::pub_func;   // OK, pub_func is accessible through A
> !      &amp;A::prot_func;  // error, cannot access prot_func through A
> !      &amp;A::priv_func;  // error, cannot access prot_func through A
I am no expert but isn't there a typo ---------------^^^^ here?

> !
> !      &amp;B::pub_func;   // OK, pub_func is accessible through B
> !      &amp;B::prot_func;  // OK, can access prot_func through B (within B)
> !      &amp;B::priv_func;  // error, cannot access prot_func through B
> !    }
> !  };</pre></li>
>     </ul>
>
>     <h4>Runtime Library (libstdc++)</h4>


VH


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]