1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s 2 // expected-no-diagnostics 3 4 template <class _Tp, class _Up, bool = false> 5 struct __allocator_traits_rebind 6 { 7 }; 8 9 template <template <class, class...> class _Alloc, class _Tp, class ..._Args, 10 class _Up> 11 struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false> 12 { 13 typedef _Alloc<_Up, _Args...> type; 14 }; 15 16 template <class Alloc> 17 struct allocator_traits 18 { 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 23 template <class T> 24 struct allocator {}; 25 26 int main() 27 { 28 allocator_traits<allocator<char>>::rebind_alloc<int> a; 29 } 30