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>>; };
Thanks for the report, John. I'll fix the library parts (assuming the corrected versions still compile with G++)
It does, AFAICS.
Author: redi Date: Wed Nov 20 13:39:33 2013 New Revision: 205114 URL: http://gcc.gnu.org/viewcvs?rev=205114&root=gcc&view=rev Log: PR c++/59173 * include/ext/pointer.h (pointer_traits<>::rebind<>): Add template keyword in nested name. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/ext/pointer.h
John, I only found one problem in <ext/pointer.h>. Was the error in <ext/extptr_allocator.h> due to including <ext/pointer.h>? Confirming as a front-end bug anyway.
So this was fixed in 4.9 and then broke again in GCC 10 so it is a regression.
GCC 10.4 is being released, retargeting bugs to GCC 10.5.
The testcase is still accepted.