1 /* { dg-do compile } */
2 template <typename _Tp> _Tp *__addressof(_Tp &) {}
3 template <typename _Tp> class A {
7 template <typename _Tp> class M : public A<_Tp> {
21 template <typename _Tp> void _Destroy(_Tp *p1) { p1->~_Tp(); }
23 template <typename _ForwardIterator>
24 static void __destroy(_ForwardIterator p1, _ForwardIterator p2) {
25 for (; p1 != p2; ++p1)
26 _Destroy(__addressof(*p1));
29 template <typename _ForwardIterator>
30 void _Destroy(_ForwardIterator p1, _ForwardIterator p2) {
33 template <typename _ForwardIterator, typename _Tp>
34 void _Destroy(_ForwardIterator p1, _ForwardIterator p2, M<_Tp> &) {
37 template <typename _Alloc> struct F {
38 typedef _Alloc _Tp_alloc_type;
39 typedef typename _Tp_alloc_type::pointer pointer;
40 struct N : _Tp_alloc_type {
44 _Tp_alloc_type &_M_get_Tp_allocator();
47 template <typename _Tp, typename _Alloc = M<_Tp> > class O : F<_Alloc> {
48 using F<_Alloc>::_M_get_Tp_allocator;
51 _Destroy(this->_M_impl._M_start, this->_M_impl._M_finish,
52 _M_get_Tp_allocator());
55 template <class T> void checked_delete(T *p1) { delete p1; }
56 template <class> class I;
57 template <class T> struct J {
66 O<I<int> > databasesM;
73 int atomic_exchange_and_add();
76 virtual void dispose() = 0;
78 if (atomic_exchange_and_add() == 1)
85 void dispose() { checked_delete(px_); }
97 template <class T, class Y> void sp_pointer_construct(I<T> *, Y, H);
98 template <class T> class I {
100 typedef T element_type;
101 template <class Y> I(Y *p1) { sp_pointer_construct(this, 0, 0); }
102 typename J<T>::type operator->();
105 void getNodeContent(const B &) {
106 for (C *n = a.GetChildren(); n; n->GetNext())
109 void parseDatabase(I<P> p1) {
110 I<int> c = p1->addDatabase();
114 void addServer() { I<int>(new P); }