public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: sneechy@hotmail.com
To: gcc-gnats@gcc.gnu.org
Subject: c++/9057: partial template specialization appears to be ignored
Date: Wed, 25 Dec 2002 07:26:00 -0000	[thread overview]
Message-ID: <20021225152001.3745.qmail@sources.redhat.com> (raw)


>Number:         9057
>Category:       c++
>Synopsis:       partial template specialization appears to be ignored
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 25 07:26:05 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     sneechy@hotmail.com
>Release:        gcc version 3.2 (mingw special 20020817-1)
>Organization:
>Environment:
gcc version 3.2 (mingw special 20020817-1)
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared
Thread model: win32
>Description:
Compiling the following code:

  template <typename T>
  struct A
  {
    template <int, typename U>
    struct B;

    enum { i = 0 };

    template <typename U>
    struct B<i, U> {};
  };

  int j = sizeof(A<void>::B<0, void>);

results in the following error (on the 'int j = ..' line):

  `sizeof' applied to incomplete type `A<void>::B<0, void>'

I've lozalized and simplified the problem as much as I could. Everything that is left somehow contributes to the conditions that create this problem. Somehow the B partial specialization appears to be ignored because it was specialized using an enumeration value from this particular context. G++ does accept the code if the enumeration is moved outside A.

Comeau compiles the code without problems.
>How-To-Repeat:
See description.
>Fix:
No idea.
>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2002-12-25 15:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-25  7:26 sneechy [this message]
2002-12-29 10:09 lerdsuwa
2003-01-06 12:56 Volker Reichelt
2003-01-22 22:25 bangerth

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=20021225152001.3745.qmail@sources.redhat.com \
    --to=sneechy@hotmail.com \
    --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).