public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/22114] Incorrect diagnostic for specialization of a nested class template
Date: Sat, 23 Jul 2005 20:59:00 -0000	[thread overview]
Message-ID: <20050723205641.20326.qmail@sourceware.org> (raw)
In-Reply-To: <20050618141304.22114.cpp@tempest-sw.com>


------- Additional Comments From bangerth at dealii dot org  2005-07-23 20:56 -------
You can't specialize an inner template without specializing its outer 
template as well. 
 
As per /18: 
 
18In  an  explicit  specialization  declaration  for a member of a class 
  template or a member template that appears  in  namespace  scope,  the 
  member  template  and some of its enclosing class templates may remain 
  unspecialized,  except  that  the  declaration  shall  not  explicitly 
  specialize  a  class  member template if its enclosing class templates 
  are  not  explicitly  specialized   as   well.    In   such   explicit 
  specialization   declaration,  the  keyword  template  followed  by  a 
  template-parameter-list shall be provided instead  of  the  template<> 
  preceding  the explicit specialization declaration of the member.  The 
  types of the template-parameters in the template-parameter-list  shall 
  be  the  same  as  those specified in the primary template definition. 
  [Example: 
 
     template<class T1> class A { 
             template<class T2> class B { 
                     template<class T3> void mf1(T3); 
                     void mf2(); 
             }; 
     }; 
     template<> template<class X> 
       class A<int>::B { }; 
     template<> template<> template<class T> 
       void A<int>::B<double>::mf1(T t) { } 
     template<class Y> template<> 
       void A<Y>::B<double>::mf2() { }   // ill-formed; B<double> is 
specialized but 
                                         // its enclosing class template A is 
not 
 
   --end example] 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22114


      parent reply	other threads:[~2005-07-23 20:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-18 14:13 [Bug c++/22114] New: " cpp at tempest-sw dot com
2005-06-18 14:13 ` [Bug c++/22114] " cpp at tempest-sw dot com
2005-06-18 14:47 ` giovannibajo at libero dot it
2005-06-18 15:20 ` pinskia at gcc dot gnu dot org
2005-07-23 20:59 ` bangerth at dealii dot org [this message]

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=20050723205641.20326.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).