From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2738 invoked by alias); 14 Nov 2002 12:38:42 -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 2718 invoked by uid 61); 14 Nov 2002 12:38:41 -0000 Date: Wed, 20 Nov 2002 14:47:00 -0000 Message-ID: <20021114123841.2717.qmail@sources.redhat.com> To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, pcarlini@unitus.it, zach@cs.uni-bonn.de From: paolo@gcc.gnu.org Reply-To: paolo@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, pcarlini@unitus.it, zach@cs.uni-bonn.de, gcc-gnats@gcc.gnu.org Subject: Re: c++/8355: befriending a template in another namespace X-SW-Source: 2002-11/txt/msg00670.txt.bz2 List-Id: Synopsis: befriending a template in another namespace State-Changed-From-To: open->analyzed State-Changed-By: paolo State-Changed-When: Thu Nov 14 04:38:33 2002 State-Changed-Why: Confirmed 3.2.1 pre and 3.3 exp. This is an useful link http://www.cuj.com/experts/2101/sutter.htm and these two summarizing test cases which do not compile and should: // Example 1 again // namespace boost { template void checked_delete( T* x ) { // ... other stuff ... delete x; } } class Test { ~Test() { } friend void boost::checked_delete( Test* x ); // the original code }; int main() { boost::checked_delete( new Test ); } /////////////////////////////// // Example 2: The other way to declare friendship // namespace boost { template void checked_delete( T* x ) { // ... other stuff ... delete x; } } class Test { ~Test() { } friend void boost::checked_delete<>( Test* x ); }; int main() { boost::checked_delete( new Test ); } http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8355