From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25707 invoked by alias); 27 Jan 2004 09:31:30 -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 25697 invoked by uid 48); 27 Jan 2004 09:31:29 -0000 Date: Tue, 27 Jan 2004 09:31:00 -0000 From: "lifshitz at post dot tau dot ac dot il" To: gcc-bugs@gcc.gnu.org Message-ID: <20040127093124.13879.lifshitz@post.tau.ac.il> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/13879] New: Error when doing an explicit specilization within a class X-Bugzilla-Reason: CC X-SW-Source: 2004-01/txt/msg03372.txt.bz2 List-Id: code is (in file fact.cc): // meta factorial - example for generative programming by James O. Coplien // the Test class was added to demonstrate the gcc compilation error. #include class Test { public: template struct Fact { enum {RET = Fact::RET*n}; }; template<> struct Fact<0> { enum{RET = 1}; }; void Print() { printf("Fact<7>=%d\n", Fact<7>::RET); } }; int main() { Test t; t.Print(); return 0; } command line: gcc fact.cc compilation error: fact.cc:14: explicit specialization in non-namespace scope 'Test' Note: the same code was compiled using sun compiler: cc fact.cc Both compilation and execution were successful. -- Summary: Error when doing an explicit specilization within a class Product: gcc Version: 2.95.3 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lifshitz at post dot tau dot ac dot il CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: sparc-ultra5_10-sunOS5.8 GCC host triplet: sparc-ultra5_10-sunOS5.8 GCC target triplet: sparc-ultra5_10-sunOS5.8 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13879