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