From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7756 invoked by alias); 27 Apr 2006 16:28:07 -0000 Received: (qmail 7661 invoked by uid 48); 27 Apr 2006 16:28:03 -0000 Date: Thu, 27 Apr 2006 16:28:00 -0000 Subject: [Bug c++/27339] New: defining out-of-class specialization of value template parameter with private type X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "dirkmoermans at gmail dot com" 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 X-SW-Source: 2006-04/txt/msg02429.txt.bz2 List-Id: Following code does not compile with gcc 4.1. It compiles with gcc 3.4.0 and gcc 4.0.2 and comeau online. ============================= class A { private: enum private_enum {a}; template // OK struct B { void bm(); }; public: void am() { B instance; //OK instance.bm(); } }; template // FAIL void A::B::bm(){} ============================= The error message is: a.cc:4: error: 'enum A::private_enum' is private a.cc:19: error: within this context If the member template function gets defined inline, the code compiles. I don't have the c++ standard available, but a technicality like an inline/outline definition should have no impact on the validity of the code imho. The same error occurrs if the enum gets replaced by a function template typedef, or if the inner-class gets replaced by a member-function-template. A related bug is 10849 -- Summary: defining out-of-class specialization of value template parameter with private type Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: dirkmoermans at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27339