public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: jozef.kosoru@pobox.sk
To: gcc-gnats@gcc.gnu.org
Subject: c++/8665: explicit specialization of the member class template of a class template
Date: Sat, 30 Nov 2002 18:16:00 -0000	[thread overview]
Message-ID: <20021121092959.7330.qmail@sources.redhat.com> (raw)


>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:


                 reply	other threads:[~2002-11-21  9:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021121092959.7330.qmail@sources.redhat.com \
    --to=jozef.kosoru@pobox.sk \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).