1 // { dg-do run }
2 // { dg-options "-O2" }
3 
4 extern "C" int printf (const char*, ...);
5 
6 struct _Deque_iterator {
7   int _M_cur;
8   int x[2];
9   int* _M_node;
10 
_Deque_iterator_Deque_iterator11   _Deque_iterator() : _M_cur(0), _M_node(0) {}
_Deque_iterator_Deque_iterator12   _Deque_iterator(const _Deque_iterator& __x)
13     : _M_cur(__x._M_cur),
14       _M_node(__x._M_node) {}
15 };
16 
17 class _Deque_base
18 {
19 public:
20   int yy;
21 
_Deque_base()22   _Deque_base()
23     : _M_start()
24     { _M_initialize_map(); }
25   ~_Deque_base();
26 
27   void _M_initialize_map();
28   _Deque_iterator _M_start;
29 };
30 
31 
~_Deque_base()32 _Deque_base::~_Deque_base() {
33   printf ("bb %x %x\n", this, *_M_start._M_node);
34 }
35 
36 void
_M_initialize_map()37 _Deque_base::_M_initialize_map()
38 {
39   yy = 0x123;
40   printf ("aa %x %x\n", this, yy);
41 
42   _M_start._M_node = &yy;
43   _M_start._M_cur = yy;
44 }
45 
46 
47 class deque : protected _Deque_base
48 {
49 public:
deque()50   deque () {}
deque(const deque & __x)51   deque(const deque& __x) {}
~deque()52   ~deque() {
53     _Deque_iterator i = _M_start;
54   }
55 };
56 
57 
58 
59 class GeometryAddress {
60 public:
GeometryAddress(deque addressStack)61   GeometryAddress(deque addressStack) {}
62 };
63 
yyy(const GeometryAddress & gb)64 void yyy (const GeometryAddress& gb)
65 {
66 }
67 
68 deque temp1;
69 
main()70 int main()
71 {
72   yyy (GeometryAddress (temp1));
73   return 0;
74 }
75