public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jhs at edg dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/59173] New: Alias template in partial specialization finds name from primary template
Date: Mon, 18 Nov 2013 13:34:00 -0000	[thread overview]
Message-ID: <bug-59173-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 59173
           Summary: Alias template in partial specialization finds name
                    from primary template
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jhs at edg dot com

In code such as the following, which is present in the <ext/extptr_allocator.h>
and <ext/pointer.h> headers, the type in the alias template definition finds
the rebind from the primary template.  The correct behavior is to give an error
because "rebind<_Up>" should be preceded by the "template" keyword for
syntactic disambiguation.

This is also a defect in those two headers as the template keyword should be
added there.

template<typename _Ptr>
struct pointer_traits
{
  template<typename _Up> struct rebind {};
};

template<typename T> struct P {};

template<typename T>
struct pointer_traits<P<T> >
{
  template<typename _Up>
     using rebind = P<typename pointer_traits<T>::rebind<_Up>>;
};


             reply	other threads:[~2013-11-18 13:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 13:34 jhs at edg dot com [this message]
2013-11-18 14:43 ` [Bug c++/59173] " redi at gcc dot gnu.org
2013-11-18 14:44 ` paolo.carlini at oracle dot com
2013-11-20 13:40 ` redi at gcc dot gnu.org
2013-11-20 13:42 ` redi at gcc dot gnu.org
2021-08-02  2:47 ` [Bug c++/59173] [10/11 Regression] " pinskia at gcc dot gnu.org
2022-06-28 10:30 ` jakub at gcc dot gnu.org
2023-07-07  7:26 ` [Bug c++/59173] [11/12/13/14 " rguenth at gcc dot gnu.org
2023-07-07  7:26 ` rguenth at gcc dot gnu.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=bug-59173-4@http.gcc.gnu.org/bugzilla/ \
    --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).