From -5755003233776310533
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,8a1040c5e2aa56da
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-10-02 15:14:44 PST
Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: johnchx2@yahoo.com (johnchx)
Newsgroups: comp.std.c++
Subject: Re: Is this a Bug in Comeau? (aka befriending classes in anonymous namespaces)
Date: Thu, 2 Oct 2003 22:14:43 +0000 (UTC)
Organization: http://groups.google.com
Lines: 28
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <4fb4137d.0310010935.542ed05a@posting.google.com>
References: <sf79d3e6.083@kumc-smtpout.kumc.edu>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: mail2news.demon.co.uk 1065132884 20190 10.0.0.1 (2 Oct 2003 22:14:44 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Thu, 2 Oct 2003 22:14:44 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 1A5Bid-0005FV-00
	for mail2news@news.news.demon.net; Thu, 02 Oct 2003 22:14:43 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id IAA19466; Fri, 3 Oct 2003 08:14:40 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: Wed, 1 Oct 2003 17:35:45 +0000 (UTC)
X-Spam-Status: No, hits=-2.4 required=5.0
	tests=BAYES_10,FORGED_YAHOO_RCVD,QUOTED_EMAIL_TEXT,REFERENCES
	version=2.55
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
Xref: archiver1.google.com comp.std.c++:21

fvali@kumc.edu ("Faisal Vali") wrote 

> The following did not work either (trying to use Qualified Name lookup
> to prevent the auto-declaration 'feature' of friend declarations)

This seems to be a common confusion.  There is no "auto-declaration
'feature'" and you can't disable it.  A friend declaration *is* a
declaration, always and everywhere.  Put another way, the name
declared as a friend is never "looked up," it is simply declared.

So the problem with this code ...

  namespace { class M; }

  class RD { friend class M; typedef int Q; };

  namespace { class M { RD::Q i; }; }

is that the friend declaration introduces a new class named M, and
there's no way rewrite the friend declaration to explicitly refer to
<unnamed>::M because <unnamed> is...well...unnamed.

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



