blob: ec76789b96570bc9fc9f790360398c419294afc6 [file] [log] [blame]
Richard Smithaff37b42011-05-12 00:06:17 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++0x %s
2
3template <class _Tp, class _Up, bool = false>
4struct __allocator_traits_rebind
5{
6};
7
8template <template <class, class...> class _Alloc, class _Tp, class ..._Args,
9class _Up>
10struct __allocator_traits_rebind<_Alloc<_Tp, _Args...>, _Up, false>
11{
12 typedef _Alloc<_Up, _Args...> type;
13};
14
15template <class Alloc>
16struct allocator_traits
17{
18 template <class T> using rebind_alloc = typename __allocator_traits_rebind<Alloc, T>::type;
19 template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
20};
21
22template <class T>
23struct allocator {};
24
25int main()
26{
27 allocator_traits<allocator<char>>::rebind_alloc<int> a;
28}