public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/8665: explicit specialization of the member class template of a class template
@ 2002-11-30 18:16 jozef.kosoru
0 siblings, 0 replies; only message in thread
From: jozef.kosoru @ 2002-11-30 18:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 8665
>Category: c++
>Synopsis: explicit specialization of the member class template of a class template
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Thu Nov 21 01:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Jozef Kosoru
>Release: g++-3.2
>Organization:
>Environment:
Linux
>Description:
The following code does not compile on g++-3.2 and gives a very strange error message.
But according ISO explicit specialization of the member class template of a class template is allowed.
--------------------------------------------------------
template<class T_>
struct A
{
template<class X_>
struct B
{
typedef X_ my_type;
};
template<>
struct B<char>
{
typedef int my_type;
};
};
int main()
{
A<int>::B<double>::my_type i;
A<int>::B<char>::my_type c;
}
--------------------------------------------------------
refer 14.7.3 (Explicit specialization):
An explicit specialization of any of the following:
...
- member class template of a class template
...
can be declared by a declaration introduced by template<>...
exptmpl.cpp:15: explicit specialization in non-namespace scope `struct A<T_>'
exptmpl.cpp:15: enclosing class templates are not explicitly specialized
exptmpl.cpp:17: template parameters not used in partial specialization:
exptmpl.cpp:17: `T_'
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-11-21 9:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-30 18:16 c++/8665: explicit specialization of the member class template of a class template jozef.kosoru
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).