From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14643 invoked by alias); 17 Jan 2003 08:46:06 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 14629 invoked by uid 71); 17 Jan 2003 08:46:05 -0000 Date: Fri, 17 Jan 2003 08:46:00 -0000 Message-ID: <20030117084605.14628.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Christoph Ludwig Subject: Re: c++/7522: access by friend function's default argument Reply-To: Christoph Ludwig X-SW-Source: 2003-01/txt/msg01031.txt.bz2 List-Id: The following reply was made to PR c++/7522; it has been noted by GNATS. From: Christoph Ludwig To: bangerth@dealii.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Cc: Subject: Re: c++/7522: access by friend function's default argument Date: Fri, 17 Jan 2003 09:37:57 +0100 Hi, On Thu, Oct 31, 2002 at 05:24:55PM -0000, bangerth@dealii.org wrote: > Synopsis: access by friend function's default argument > > State-Changed-From-To: feedback->analyzed > State-Changed-By: bangerth > State-Changed-When: Thu Oct 31 09:24:55 2002 > State-Changed-Why: > One way or other, the example Christoph gave shows a bug, > since treatment is not consistent. So I reset the state > to "analyzed". > > And no, I don't know what is right and wrong here, sorry. A post by John Spicer to comp.std.c++ (Thread: "Req Clarification: private type used in parameter list of friend function") pointed me to 11.0.5 in the standard. There is an example that settles the question, I think: class A { typedef int I; // private member I f(); friend I g(I); static I x; }; A::I A::f() { return 0; } A::I g(A::I p = A::x); gcc 3.2.1 rejects the default argument in the last line, but according to the standard the example is well formed. Regards Christoph > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7522