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