This is the mail archive of the gcc@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


On Mon, 29 Sep 2003, Mike Stump wrote:
> Naw, this is an intro to C++ question.

Well, GCC up to and including GCC 3.3 gets it wrong ;-) -- that's why
I wondered when encountering this problem in a third-party application
(TaskJuggler).

> Yes, it is correct.  A friend can't claim friendship, the person
> bestowing friendship must make the claim.

...and if the "invited" friend is a member of a class, it must not be
private or protected.  This is the difference between GCC 3.3 and 3.4.

How about the doc patch below? (It may be a bit too oversimplified...)

Gerald

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.4/changes.html,v
retrieving revision 1.49
diff -u -3 -p -r1.49 changes.html
--- changes.html	29 Sep 2003 17:53:08 -0000	1.49
+++ changes.html	29 Sep 2003 23:17:49 -0000
@@ -176,7 +176,12 @@
 	<pre>
 	template &lt;typename T&gt;
 	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>You must use <code>template &lt;&gt;</code> to introduce template
 	specializations, as required by the standard.  For example,
 	<pre>


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