diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/PCH/cxx-templates.cpp | 6 | ||||
-rw-r--r-- | clang/test/PCH/cxx-templates.h | 26 |
2 files changed, 32 insertions, 0 deletions
diff --git a/clang/test/PCH/cxx-templates.cpp b/clang/test/PCH/cxx-templates.cpp index d27e9ca93c4..ddebae4df24 100644 --- a/clang/test/PCH/cxx-templates.cpp +++ b/clang/test/PCH/cxx-templates.cpp @@ -79,3 +79,9 @@ namespace TestNestedExpansion { Int &g(Int, int, double); Int &test = NestedExpansion<char, char, char>().f(0, 1, 2, Int(3), 4, 5.0); } + +namespace rdar13135282 { + void test() { + __mt_alloc<> mt = __mt_alloc<>(); + } +} diff --git a/clang/test/PCH/cxx-templates.h b/clang/test/PCH/cxx-templates.h index 756f208b76f..3dda0590264 100644 --- a/clang/test/PCH/cxx-templates.h +++ b/clang/test/PCH/cxx-templates.h @@ -220,3 +220,29 @@ template<typename...A> struct NestedExpansion { template<typename...B> auto f(A...a, B...b) -> decltype(g(a + b...)); }; template struct NestedExpansion<char, char, char>; + +namespace rdar13135282 { +template < typename _Alloc > +void foo(_Alloc = _Alloc()); + +template < bool > class __pool; + +template < template < bool > class _PoolTp > +struct __common_pool { + typedef _PoolTp < 0 > pool_type; +}; + +template < template < bool > class _PoolTp > +struct __common_pool_base : __common_pool < _PoolTp > {}; + +template < template < bool > class _PoolTp > +struct A : __common_pool_base < _PoolTp > {}; + +template < typename _Poolp = A < __pool > > +struct __mt_alloc { + typedef typename _Poolp::pool_type __pool_type; + __mt_alloc() { + foo<__mt_alloc<> >(); + } +}; +} |