From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12385 invoked by alias); 22 Jun 2005 19:31:12 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 12234 invoked by uid 22791); 22 Jun 2005 19:30:46 -0000 Received: from bay101-f26.bay101.hotmail.com (HELO hotmail.com) (64.4.56.36) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 22 Jun 2005 19:30:46 +0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 22 Jun 2005 12:30:44 -0700 Message-ID: Received: from 64.4.56.200 by by101fd.bay101.hotmail.msn.com with HTTP; Wed, 22 Jun 2005 19:30:44 GMT X-Originating-Email: [jayrusman@hotmail.com] X-Sender: jayrusman@hotmail.com From: "Jason Mancini" To: gcc@gcc.gnu.org Cc: shelly@interrasystems.com Bcc: Subject: RE: gcc template error? Date: Wed, 22 Jun 2005 19:31:00 -0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-SW-Source: 2005-06/txt/msg00980.txt.bz2 I suspect this line is the source of your problems: friend T* func(T* p); Y isn't a template parameter here, but a (concrete?) class named "Y". The below compiles with 3.4.3 anyways... Regards, -Jason // Line 1 class A { public: A() { }; ~A() { }; }; class B { public: B(); B(const A& a) { }; ~B(); }; template class T; template T* func(T* p); template class T { X* m_; public: T(X* x) : m_(x) { }; ~T() { }; friend T* func(T* p); }; template T* func(T* p) { return (new T(new X(*p->m_))); } int main() { A* a = new A(); T* p = new T(a); T* q = func(p); return 0; }