This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ language lawyer question
- From: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org,Mike Stump <mrs at apple dot com>
- Date: Thu, 2 Oct 2003 23:02:51 +0200 (CEST)
- Subject: Re: C++ language lawyer question
- References: <E23F868D-F2CF-11D7-8F0D-003065A77310@apple.com><Pine.BSF.4.56.0309300106340.66215@acrux.dbai.tuwien.ac.at><m3pthi20td.fsf@uniton.integrable-solutions.net>
- Reply-to: Gerald Pfeifer <gerald at pfeifer dot com>,gcc-patches at gcc dot gnu dot org
[ 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 <></code> to introduce template
specializations, as required by the standard. For example,