1 // RUN: %clang_cc1 -emit-llvm-only -triple %itanium_abi_triple -O1 %s
2 // This used to crash under asan and valgrind.
5 template < typename _Tp
> struct new_allocator
8 template < typename
> struct rebind
{
9 typedef new_allocator other
;
12 template < typename _Tp
> struct allocator
:new_allocator
< _Tp
> {
14 template < typename _Tp
, typename _Alloc
> struct _Vector_base
{
15 typedef typename
_Alloc::template rebind
< _Tp
>::other _Tp_alloc_type
;
17 typename
_Tp_alloc_type::pointer _M_end_of_storage
;
20 foo((int *) this->_M_impl
._M_end_of_storage
);
25 template < typename _Tp
, typename _Alloc
=
26 allocator
< _Tp
> >struct vector
:_Vector_base
< _Tp
, _Alloc
> { };
29 template < class T
> struct HHH
{};
30 struct DDD
{ int x_
;};
33 struct CCC
:DDD
{ virtual void xxx (HHH
< X1
>); };
34 template < class SSS
> struct EEE
:vector
< HHH
< SSS
> > { };
35 template < class SSS
, class = EEE
< SSS
> >class FFF
{ };
36 template < class SSS
, class GGG
= EEE
< SSS
> >class AAA
:FFF
<GGG
> { };
37 class BBB
:virtual CCC
{
38 void xxx (HHH
< X1
>);
39 vector
< HHH
< X1
> >aaa
;
41 class ZZZ
:AAA
< Data
>, BBB
{ virtual ZZZ
*ppp () ; };
42 ZZZ
* ZZZ::ppp () { return new ZZZ
; }