blob: fc090cc42f928be2a52ff8c450cfcb027619825a [file] [log] [blame]
Richard Smith762bb9d2011-10-13 22:29:44 +00001// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
Richard Smith18041742011-05-14 15:04:18 +00002
3template <class _Tp, class _Up>
4struct __allocator_traits_rebind
5{
6 typedef typename _Tp::template rebind<_Up>::other type;
7};
8
9template <class Alloc>
10struct allocator_traits
11{
12 typedef Alloc allocator_type;
13 template <class T> using rebind_alloc = typename
14__allocator_traits_rebind<allocator_type, T>::type;
15 template <class T> using rebind_traits = allocator_traits<rebind_alloc<T>>;
16};
17
18template <class T>
19struct ReboundA {};
20
21template <class T>
22struct A
23{
24 typedef T value_type;
25
26 template <class U> struct rebind {typedef ReboundA<U> other;};
27};
28
29int main()
30{
31 allocator_traits<A<char> >::rebind_traits<double> a;
32}