public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59173] New: Alias template in partial specialization finds name from primary template
@ 2013-11-18 13:34 jhs at edg dot com
  2013-11-18 14:43 ` [Bug c++/59173] " redi at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: jhs at edg dot com @ 2013-11-18 13:34 UTC (permalink / raw)
  To: gcc-bugs

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>>;
};


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

end of thread, other threads:[~2023-07-07  7:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-18 13:34 [Bug c++/59173] New: Alias template in partial specialization finds name from primary template jhs at edg dot com
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

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