blob: a34f99c12287b7521ae318a7f57db8658c165d7a [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 Smithaff37b42011-05-12 00:06:17 +00003
4template <class _Tp, class _Up, bool = false>
5struct __allocator_traits_rebind
6{
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_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
23template <class T>
24struct allocator {};
25
26int main()
27{
28 allocator_traits<allocator<char>>::rebind_alloc<int> a;
29}