1 // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple -emit-llvm-only %s
2 // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple -emit-llvm-only -std=c++98 %s
3 // RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple -emit-llvm-only -std=c++11 %s
4 // Check that we don't crash.
8 template < typename T1
> struct Types1
12 template < typename
> struct Types
;
13 template < template < typename
> class Tmpl
> struct TemplateSel
15 template < typename T
> struct Bind
17 typedef Tmpl
< T
> type
;
20 template < typename
> struct NoneT
;
21 template < template < typename
> class T1
, template < typename
> class > struct Templates2
23 typedef TemplateSel
< T1
> Head
;
25 template < template < typename
> class, template < typename
> class =
26 NoneT
, template < typename
> class = NoneT
, template < typename
> class =
27 NoneT
> struct Templates
;
28 template < template < typename
> class T1
,
29 template < typename
> class T2
> struct Templates
<T1
, T2
>
31 typedef Templates2
< T1
, T2
> type
;
33 template < typename T
> struct TypeList
35 typedef Types1
< T
> type
;
37 template < template < typename
> class, class TestSel
,
38 typename Types
> class TypeParameterizedTest
40 public:static bool Register ()
42 typedef typename
Types::Head Type
;
43 typename
TestSel::template Bind
< Type
>::type TestClass
;
46 template < template < typename
> class Fixture
, typename Tests
,
47 typename Types
> class TypeParameterizedTestCase
49 public:static bool Register (char *, char *, int *)
51 typedef typename
Tests::Head Head
;
52 TypeParameterizedTest
< Fixture
, Head
, Types
>::Register
;
55 template < typename
> class TypedTestP1
59 namespace gtest_case_TypedTestP1_
61 template < typename gtest_TypeParam_
> class A
:TypedTestP1
<
65 template < typename gtest_TypeParam_
> class B
:TypedTestP1
<
69 typedef Templates
< A
>::type gtest_AllTests_
;
72 template < typename
> class TypedTestP2
76 namespace gtest_case_TypedTestP2_
78 template < typename gtest_TypeParam_
> class A
:TypedTestP2
<
82 typedef Templates
< A
>::type gtest_AllTests_
;
85 bool gtest_Int_TypedTestP1
=
86 TypeParameterizedTestCase
< TypedTestP1
,
87 gtest_case_TypedTestP1_::gtest_AllTests_
,
88 TypeList
< int >::type
>::Register ("Int", "TypedTestP1", 0);
89 bool gtest_Int_TypedTestP2
=
90 TypeParameterizedTestCase
< TypedTestP2
,
91 gtest_case_TypedTestP2_::gtest_AllTests_
,
92 TypeList
< Types
< int > >::type
>::Register ("Int", "TypedTestP2", 0);
94 template < typename _Tp
> struct new_allocator
97 template < typename
> struct rebind
{
98 typedef new_allocator other
;
101 template < typename _Tp
> struct allocator
:new_allocator
< _Tp
> {
103 template < typename _Tp
, typename _Alloc
> struct _Vector_base
{
104 typedef typename
_Alloc::template rebind
< _Tp
>::other _Tp_alloc_type
;
105 struct _Vector_impl
{
106 typename
_Tp_alloc_type::pointer _M_end_of_storage
;
109 foo((int *) this->_M_impl
._M_end_of_storage
);
112 _Vector_impl _M_impl
;
114 template < typename _Tp
, typename _Alloc
=
115 allocator
< _Tp
> >struct vector
:_Vector_base
< _Tp
, _Alloc
> { };
118 template < class T
> struct HHH
{};
119 struct DDD
{ int x_
;};
122 struct CCC
:DDD
{ virtual void xxx (HHH
< X1
>); };
123 template < class SSS
> struct EEE
:vector
< HHH
< SSS
> > { };
124 template < class SSS
, class = EEE
< SSS
> >class FFF
{ };
125 template < class SSS
, class GGG
= EEE
< SSS
> >class AAA
:FFF
<GGG
> { };
126 class BBB
:virtual CCC
{
127 void xxx (HHH
< X1
>);
128 vector
< HHH
< X1
> >aaa
;
130 class ZZZ
:AAA
< Data
>, BBB
{ virtual ZZZ
*ppp () ; };
131 ZZZ
* ZZZ::ppp () { return new ZZZ
; }
135 template < class, class > struct pair
;
137 namespace __gnu_cxx
{
138 template < typename
> class new_allocator
;
141 template < typename _Tp
> class allocator
:__gnu_cxx::new_allocator
< _Tp
> {
143 template < typename
, typename
> struct _Vector_base
{
145 template < typename _Tp
, typename _Alloc
= std::allocator
< _Tp
> >class vector
:_Vector_base
< _Tp
,
155 typename
> struct unary_function
;
159 typename
> struct binary_function
;
162 _Tp
> struct equal_to
:
170 _Pair
> struct _Select1st
:
174 _Pair::first_type
> {
197 typedef void key_type
;
205 template < class _Key
, class _Tp
, class _HashFn
=
206 hash
< _Key
>, class _EqualKey
= equal_to
< _Key
>, class _Alloc
=
207 allocator
< _Tp
> >class hash_map
{
223 typedef typename
_Ht::key_type key_type
;
233 template < class > class scoped_ptr
{
243 template < typename
> class EEE
;
244 template < typename CCC
, typename
=
245 typename
CCC::key_equal
, typename
=
246 EEE
< CCC
> >class III
{
314 scoped_ptr
< C1::C3
> context
;