From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15727 invoked by alias); 3 Sep 2008 14:07:34 -0000 Received: (qmail 2876 invoked by uid 48); 3 Sep 2008 14:06:14 -0000 Date: Wed, 03 Sep 2008 14:07:00 -0000 Subject: [Bug c++/37350] New: Specialized template base class name not accepted X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ian at airs dot com" 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: 2008-09/txt/msg00357.txt.bz2 C++98 [temp.local] says "Within the scope of a class template specialization or partial specialization, when the name of the template is neither qualified nor followed by <, it is equivalent to the name of the template followed by the template-arguments enclosed in <>." That does not work when a template specialization is used as a base class. In that case g++ does not accept the unqualified base class name as a type. This test case: template struct base {}; struct derived : base { typedef base b; base* p; }; gives these errors: foo.cc:5: error: invalid use of template-name ‘base’ without an argument list foo.cc:6: error: ISO C++ forbids declaration of ‘base’ with no type foo.cc:6: error: expected ‘;’ before ‘*’ token I believe this is an incorrect rejection of valid C++ code. At least, I can't find anything in the C++ standard which says that this code is invalid. -- Summary: Specialized template base class name not accepted Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: ian at airs dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37350