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: C++ language lawyer question


[ Reply-To: gcc-patches ]

On Tue, 30 Sep 2003, Gabriel Dos Reis wrote:
> Despite what has been claimed about the simplicy of the issue, it is
> not as clear cut some would like to believe.

Thanks, at least my intuition wasn't completely off-base. ;-)

> http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#209
>
> I believe your addition to changes.html should include that link.

Definitely, thanks for the pointer.

On Tue, 30 Sep 2003, Gabriel Dos Reis wrote:
> "need to be public" is both too strong and incomplete.
> What is required is that every name used in the friend declaration be
> accessible at the point of declaration.

I was aware of the fact that my wording was a bit sloopy, but you are
right, it was in fact too sloppy (and, worse, I even committed the bad
version as part of a different patch today, unintentionally of course.)

What do you think about the rewrite below? (Not installed yet.)

Gerald

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.4/changes.html,v
retrieving revision 1.51
diff -u -3 -p -r1.51 changes.html
--- changes.html	2 Oct 2003 10:14:48 -0000	1.51
+++ changes.html	2 Oct 2003 20:58:38 -0000
@@ -177,10 +177,13 @@
 	template <typename T>
 	void f(T);</pre></li>

-    <li>In case of friend declarations that refer to members of a class,
-        these members need to be <code>public</code>, whereas G++ used to
-        accept <code>private</code>/<code>protected</code> members as well.
-        </li>
+    <li>In case of friend declarations, every name used in the friend
+        declaration must be accessible at the point of that declaration.
+        Previous versions of G++ used to be less strict about this and
+        allowed friend declarations for <code>private</code> class members,
+        for example.  See the ISO C++ Standard Committee's <a
+        href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#209";>defect
+        report #209.</a> for details.</li>

     <li>You must use <code>template &lt;&gt;</code> to introduce template
 	specializations, as required by the standard.  For example,


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