public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gdr at integrable-solutions dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/13640] [3.3/3.4 regression] Failing to reject class template partial specialization which can never be selected
Date: Sat, 10 Jan 2004 23:25:00 -0000	[thread overview]
Message-ID: <20040110232541.22351.qmail@sources.redhat.com> (raw)
In-Reply-To: <20040110200828.13640.giovannibajo@libero.it>


------- Additional Comments From gdr at integrable-solutions dot net  2004-01-10 23:25 -------
Subject: Re:  New: [3.3/3.4 regression] Failing to reject class template partial specialization which can never be selected

"giovannibajo at libero dot it" <gcc-bugzilla@gcc.gnu.org> writes:

| This is basically c++/7033, cleaned and simplified. Comment 6 (quoting myself):
| 
| ---------------------------------------------------------------------------
|  I'm confident that defining a partial template
|  specialization whose arguments can't be fully deduced from the arguments of
|  the original template is ill-formed. In fact, GCC correctly rejects this:

I disagree.  Declaring/defining a partial specialization that can
never be selected by partial ordering is not ill-formed.

|  -----------------------------------------------
|  template <class> struct K;
|  
|  template <class T>
|  struct K<int> {};
|  -----------------------------------------------
|  pr7033.cpp:4: error: template parameters not used in partial specialization:
|  pr7033.cpp:4: error:         `T'

That situation is different.  There is a note somewhere in the standard
saying that every template parameter shall be used in a partial
specialization.  However, that note does not imply that the resulting
partial specialization could ever be selected by partial ordering or
template argument deduction.

|  but it fails to reject this:
|  
|  -----------------------------------------------
|  template <typename, typename> struct S;
|  
|  template <template <typename> class C,
|  typename T,
|  typename V>
|  struct S<C<T>,typename C<T>::template it<V> > {};
|  -----------------------------------------------

I'm well aware of this example -- as I used it to discuss related
topics on the committee reflector.

|  which is currently accepted by 3.3 and 3.4, even if "V" is used only in

And that is allowed by the standard.

|  non-deduced contexts. This is a regression (rechecked on CVS 20050305 for
|  both 3.3 and 3.4) with respect to 2.95 which was rejecting the code:
|  
|  pr7033.cpp:6: template parameters not used in partial specialization:
|  pr7033.cpp:6:         `V'

That is a bogus behaviour.

|  (actually, the error message could be "template parameter used in
|  non-decuded context", but anyway).
|  
|  This is an accepts-invalid regression, and I now flagged it as such.

I disagree: it is not accepts-invalid.  

-- Gaby


-- 


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


  parent reply	other threads:[~2004-01-10 23:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-10 20:08 [Bug c++/13640] New: " giovannibajo at libero dot it
2004-01-10 20:10 ` [Bug c++/13640] " giovannibajo at libero dot it
2004-01-10 20:44 ` pinskia at gcc dot gnu dot org
2004-01-10 22:24 ` steven at gcc dot gnu dot org
2004-01-10 23:25 ` gdr at integrable-solutions dot net [this message]
2004-01-10 23:26 ` gdr at integrable-solutions dot net
2004-01-10 23:34 ` pinskia at gcc dot gnu dot org
2004-01-11  0:11 ` giovannibajo at libero dot it
2004-01-11  0:11 ` [Bug c++/13640] " giovannibajo at libero dot it
2004-01-11  0:11 ` giovannibajo at libero dot it
2004-01-11  0:19 ` gdr at integrable-solutions dot net
2004-01-11  0:19 ` gdr at integrable-solutions dot net
2004-01-11  0:45 ` giovannibajo at libero dot it
2004-01-11  3:12 ` pinskia at gcc dot gnu dot org
2004-01-12 15:56 ` bangerth at dealii dot org
2004-01-15 19:49 ` theodore dot papadopoulo at sophia dot inria dot fr
2004-03-01  0:48 ` gdr at gcc dot gnu dot org
2004-03-01  1:14 ` giovannibajo at libero dot it
2004-03-01  1:31 ` gdr at integrable-solutions dot net
2005-06-13  3:38 ` pinskia at gcc dot gnu dot org

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=20040110232541.22351.qmail@sources.redhat.com \
    --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).