2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr61554.C
blob90f8e85e3033458150fbebe39f144650e8bb4357
1 // { dg-do compile }
2 // { dg-additional-options "-Wno-return-type" }
4 struct A
6   A ();
7 };
8 const unsigned long &min (const unsigned long &, const unsigned long &) {}
10 template <typename _InputIterator1, typename _InputIterator2,
11           typename _OutputIterator, typename _BinaryOperation>
12 void transform (_InputIterator1 p1, _InputIterator2, _OutputIterator,
13                 _BinaryOperation p4)
15   for (; p1;)
16     p4 (0, 0);
19 class multi_array
21 public:
22   multi_array (int &, int &);
23   int &resize_ranges;
24   int resize___trans_tmp_1;
25   void m_fn1 ()
26   {
27     multi_array a (resize_ranges, this->m_fn2 ());
28     const unsigned long &(*b)(const unsigned long &, const unsigned long &)
29       = min;
30     transform (&resize___trans_tmp_1, 0, 0, b);
31     A c;
32   }
33   ~multi_array ()
34   {
35     for (int i; &base_;)
36       ;
37   }
38   int base_;
39   int &m_fn2 ();
42 class B
44   void m_fn3 (const int &, const int &);
45   multi_array _bookingSnapshotBlock;
47 void B::m_fn3 (const int &, const int &) { _bookingSnapshotBlock.m_fn1 (); }