From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23710 invoked by alias); 4 Dec 2002 14:18:20 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 23601 invoked by uid 71); 4 Dec 2002 14:16:49 -0000 Resent-Date: 4 Dec 2002 14:16:49 -0000 Resent-Message-ID: <20021204141649.23593.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, catherin@ca.ibm.com Received: (qmail 23058 invoked by uid 61); 4 Dec 2002 14:12:14 -0000 Message-Id: <20021204141214.23057.qmail@sources.redhat.com> Date: Wed, 04 Dec 2002 06:18:00 -0000 From: catherin@ca.ibm.com Reply-To: catherin@ca.ibm.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8806: gcc accepts bad argument for template template parameter X-SW-Source: 2002-12/txt/msg00196.txt.bz2 List-Id: >Number: 8806 >Category: c++ >Synopsis: gcc accepts bad argument for template template parameter >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Wed Dec 04 06:16:29 PST 2002 >Closed-Date: >Last-Modified: >Originator: Catherine Morton >Release: unknown-1.0 >Organization: >Environment: GNU C++ version 3.2 (powerpc-suse-linux) >Description: // -------------------------------------------- template < template class B> class foo{}; template < class C > class bar { foo x; }; bar test; // --------------------------------------------- This is invalid according to section 14.6.1 paragraph 2 "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 <>." So, in the specialization bar the reference bar is actually bar which does not match the template template parameter in class foo... >How-To-Repeat: // -------------------------------------------- template < template class B> class foo{}; template < class C > class bar { foo x; }; bar test; // --------------------------------------------- g++ small.cpp > > no errors should issue an error message such as: "small.cpp", line 5.8: 1540-0716 (S) The template argument "bar" does not match the template parameter "template class B". "small.cpp", line 8.10: 1540-0700 (I) The previous message was produced while processing "class bar". >Fix: >Release-Note: >Audit-Trail: >Unformatted: