public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8806: gcc accepts bad argument for template template parameter
@ 2002-12-04 6:18 catherin
0 siblings, 0 replies; 4+ messages in thread
From: catherin @ 2002-12-04 6:18 UTC (permalink / raw)
To: gcc-gnats
>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 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...
>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>".
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/8806: gcc accepts bad argument for template template parameter
@ 2002-12-19 7:04 lerdsuwa
0 siblings, 0 replies; 4+ messages in thread
From: lerdsuwa @ 2002-12-19 7:04 UTC (permalink / raw)
To: catherin, gcc-bugs, gcc-prs, lerdsuwa, nobody
Synopsis: gcc accepts bad argument for template template parameter
Responsible-Changed-From-To: unassigned->lerdsuwa
Responsible-Changed-By: lerdsuwa
Responsible-Changed-When: Thu Dec 19 07:04:36 2002
Responsible-Changed-Why:
I will fix this in the trunk after new parser merge.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8806
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/8806: gcc accepts bad argument for template template parameter
@ 2002-12-04 6:46 Wolfgang Bangerth
0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Bangerth @ 2002-12-04 6:46 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8806; it has been noted by GNATS.
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: c++/8806: gcc accepts bad argument for template template parameter
@ 2002-12-04 6:31 reichelt
0 siblings, 0 replies; 4+ messages in thread
From: reichelt @ 2002-12-04 6:31 UTC (permalink / raw)
To: catherin, gcc-bugs, gcc-prs, nobody
Synopsis: gcc accepts bad argument for template template parameter
State-Changed-From-To: open->analyzed
State-Changed-By: reichelt
State-Changed-When: Wed Dec 4 06:31:52 2002
State-Changed-Why:
Confirmed.
gcc wrongly accepts this at least since gcc 2.95.x.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8806
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2002-12-19 15:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-04 6:18 c++/8806: gcc accepts bad argument for template template parameter catherin
2002-12-04 6:31 reichelt
2002-12-04 6:46 Wolfgang Bangerth
2002-12-19 7:04 lerdsuwa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).