From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24867 invoked by alias); 27 Dec 2003 02:22:47 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 24860 invoked by uid 48); 27 Dec 2003 02:22:46 -0000 Date: Sat, 27 Dec 2003 07:46:00 -0000 From: "sstrasser at systemhaus-gruppe dot de" To: gcc-bugs@gcc.gnu.org Message-ID: <20031227022232.13495.sstrasser@systemhaus-gruppe.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13495] New: Impossible "friend"-ship to nested template X-Bugzilla-Reason: CC X-SW-Source: 2003-12/txt/msg02759.txt.bz2 List-Id: Hi. I don´t exactly know what the correct syntax to do this is, since I couldn´t look up in the specification, but it looks like a bug because a) I couldn´t figure out a way to do this with GCC b) I could figure out a way which does work with MSVC but doesn´t with GCC so here it is: a template class which contains a nested class which itself is no template but inherits the template parameter: template class A{ public: class B{}; }; class A::B should be friend of another class: template class OtherClass{ XXX }; A::B is a dependent type, so using it requires the 'typename'-keyword. ("implicit typename deprecated") a) XXX == friend typename A::B; doesn´t work because it requires the 'class'-keyword because it´s a class friendship b) XXX == friend class A::B; doesn´t work because A::B is a dependent typename, which requires the 'typename' keyword. c) XXX == friend typename class A::B; or d) XXX == friend class typename A::B pass out with parse error. MSVC compiles a) (wrongly) and c) (possibly correct) Thank you, Stefan -- Summary: Impossible "friend"-ship to nested template Product: gcc Version: 3.3 Status: UNCONFIRMED Severity: minor Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: sstrasser at systemhaus-gruppe dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13495