From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24346 invoked by alias); 8 Oct 2010 14:41:46 -0000 Received: (qmail 24335 invoked by uid 22791); 8 Oct 2010 14:41:46 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Oct 2010 14:41:40 +0000 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/45942] class will not get friends with another class X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Fri, 08 Oct 2010 14:41:00 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-10/txt/msg00732.txt.bz2 Message-ID: <20101008144100.uh7bvgrwgfRgHPz8Dca3knNKyGy3XoBA4q4HForXYy4@z> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45942 --- Comment #1 from Jonathan Wakely 2010-10-08 14:41:28 UTC --- It's not entirely clear what you're saying is a bug, because your testcase doesn't give any error. It's more helpful to provide the source code that you claim produces the bug. I assume you this: template class classA; template &instanceA> class classB; template class classA { // incorrect error message: partial specialization claimed but not apparent template friend class classB; private: int for_use_by_classB; }; template &instanceA> class classB { classB (int i) { instanceA.for_use_by_classB = i; } }; // instantiation template class classA; That code is not valid, the error is not incorrect. You have declared classB as a friend, and as a template with one template parameter, instanceA, and the template arguments . That is a partial specialization.