public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/10574: Partial specialization selection failure involving a default template parameter from inside a template
@ 2003-04-30 23:46 gccbugs
  0 siblings, 0 replies; 2+ messages in thread
From: gccbugs @ 2003-04-30 23:46 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10574
>Category:       c++
>Synopsis:       Partial specialization selection failure involving a default template parameter from inside a template
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 30 23:46:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Eelis van der Weegen
>Release:        gcc version 3.2.2
>Organization:
>Environment:
Configured with: ../gcc-3.2.2/configure --prefix=/usr --enable-shared --enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i386-slackware-linux --host=i386-slackware-linux
Thread model: posix
>Description:
Consider the following code:

  template <typename>
  struct A
  {
    struct B {};

    template <typename, typename T = B>
    struct C
    {
      typename T::x y;
    };

    template <typename T>
    struct C<T, B> {};
  };

  A<int>::C<int> t;

The last statement should instantiate C's partial specialization. However, the nonspecialized version is instantiated, resulting in a compiler error:

  no type named `x' in `struct A<int>::B

When considering the specialization, it seems G++ fails to identify the automatically selected default parameter and the formal parameter of the specialization as the same B. Moving B outside A resolves the issue.

Comeau compiles the code without problems.

This problem seems to be related to PR9737, which was suspended due to possible change in the next version of the C++ standard. I think this problem is different enough for examination, especially since the current patch for 9737 does not cover this issue (it deals with template template parameter problems).
>How-To-Repeat:
Try compiling the code from the description.
>Fix:
No idea.
>Release-Note:
>Audit-Trail:
>Unformatted:


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: c++/10574: Partial specialization selection failure involving a default template parameter from inside a template
@ 2003-05-01  0:12 giovannibajo
  0 siblings, 0 replies; 2+ messages in thread
From: giovannibajo @ 2003-05-01  0:12 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, gccbugs, nobody

Synopsis: Partial specialization selection failure involving a default template parameter from inside a template

State-Changed-From-To: open->analyzed
State-Changed-By: bajo
State-Changed-When: Thu May  1 00:12:19 2003
State-Changed-Why:
    Confirmed on every GCC up to mainline 20030430.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10574


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-01  0:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-30 23:46 c++/10574: Partial specialization selection failure involving a default template parameter from inside a template gccbugs
2003-05-01  0:12 giovannibajo

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).