This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
// -------------------------------------------- template < template <class A> class B> class foo{}; template < class C > class bar { foo<bar> x; }; bar<int> 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<int> the reference bar is actually bar<int> which does not match the template template parameter in class foo... Release: unknown Environment: GNU C++ version 3.2 (powerpc-suse-linux) How-To-Repeat: // -------------------------------------------- template < template <class A> class B> class foo{}; template < class C > class bar { foo<bar> x; }; bar<int> 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<int>" 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<int>".
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. gcc wrongly accepts this at least since gcc 2.95.x.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu> To: gcc-bugs@gcc.gnu.org, <gcc-gnats@gcc.gnu.org>, Volker Reichelt <reichelt@igpm.rwth-aachen.de>, <catherin@ca.ibm.com> Cc: Subject: Re: c++/8806: gcc accepts bad argument for template template parameter Date: Wed, 4 Dec 2002 08:36:05 -0600 (CST) This is actually kind of a funny problem (an oversight in the standard?), and the only way I can think of to make this go the intended way would be to write foo< ::bar> or maybe foo<template bar> The first is accepted by newer compilers, the latter is not. Regards Wolfgang ------------------------------------------------------------------------- Wolfgang Bangerth email: bangerth@ticam.utexas.edu www: http://www.ticam.utexas.edu/~bangerth
Responsible-Changed-From-To: unassigned->lerdsuwa Responsible-Changed-Why: I will fix this in the trunk after new parser merge.
From: Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, lerdsuwa@gcc.gnu.org, catherin@ca.ibm.com, gcc-prs@gcc.gnu.org Cc: Subject: Re: c++/8806: [2003-01-22] gcc accepts bad argument for template template parameter Date: Mon, 27 Jan 2003 17:23:10 +0700 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8806 Patch submitted: http://gcc.gnu.org/ml/gcc-patches/2003-01/msg02100.html
From: Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> To: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org, lerdsuwa@gcc.gnu.org, catherin@ca.ibm.com Cc: Subject: Re: c++/8806: [2003-01-22] gcc accepts bad argument for template template parameter Date: Fri, 16 May 2003 22:39:51 +0700 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8806 A revised patch is just submitted: http://gcc.gnu.org/ml/gcc-patches/2003-05/msg01475.html
New revised patch submitted: http://gcc.gnu.org/ml/gcc-patches/2003-07/msg01960.html
Fixed in GCC 3.4.