30 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s2// expected-no-diagnostics3 4template <class _Tp, class _Up, bool = false>5struct __allocator_traits_rebind6{7};8 9template <template <class, class...> class _Alloc, class _Tp, class ..._Args,10class _Up>11struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>12{13 typedef _Alloc<_Up, _Args...> type;14};15 16template <class Alloc>17struct allocator_traits18{19 template <class T> using rebind_alloc = typename __allocator_traits_rebind<Alloc, T>::type;20 template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;21};22 23template <class T>24struct allocator {};25 26int main()27{28 allocator_traits<allocator<char>>::rebind_alloc<int> a;29}30