1 // PR middle-end/78507
2 // { dg-do compile }
3 // { dg-additional-options "-Wno-return-type" }
4 
5 struct A {
6   template <typename _Iterator1, typename _Iterator2>
7   int operator()(_Iterator1, _Iterator2);
8 };
9 struct B {
10   template <typename _BI1, typename _BI2>
__copy_move_bB11   static _BI2 __copy_move_b(_BI1 p1, _BI2 p2) {
12     _BI1 a;
13     long b = p1 - a;
14     for (; b > 0; --b)
15       *--p2 = *--p1;
16   }
17 };
18 template <int, typename _BI1, typename _BI2>
__copy_move_backward_a(_BI1 p1,_BI2 p2)19 void __copy_move_backward_a(_BI1 p1, _BI2 p2) {
20   B::__copy_move_b(p1, p2);
21 }
22 template <int, typename _BI1, typename _BI2>
__copy_move_backward_a2(_BI1 p1,_BI2 p2)23 void __copy_move_backward_a2(_BI1 p1, _BI2 p2) {
24   __copy_move_backward_a<0>(p1, p2);
25 }
move_backward(_BI1 p1,_BI2 p2)26 template <typename _BI1, typename _BI2> void move_backward(_BI1 p1, _BI2 p2) {
27   __copy_move_backward_a2<0>(p1, p2);
28 }
29 template <typename _RandomAccessIterator, typename _Compare>
__insertion_sort(_RandomAccessIterator,_Compare p2)30 void __insertion_sort(_RandomAccessIterator, _Compare p2) {
31   for (_RandomAccessIterator c;; ++c)
32     if (p2(0, 0))
33       move_backward(c, c + 1);
34 }
35 template <typename _RandomAccessIterator, typename _Compare>
__final_insertion_sort(_RandomAccessIterator,_Compare p2)36 void __final_insertion_sort(_RandomAccessIterator, _Compare p2) {
37   _RandomAccessIterator d;
38   __insertion_sort(d, p2);
39 }
40 template <typename _RandomAccessIterator, typename _Compare>
__sort(_RandomAccessIterator p1,_Compare p2)41 void __sort(_RandomAccessIterator p1, _Compare p2) {
42   __final_insertion_sort(p1, p2);
43 }
44 template <typename _RandomAccessIterator, typename _Compare>
sort(_RandomAccessIterator,_RandomAccessIterator p2,_Compare)45 void sort(_RandomAccessIterator, _RandomAccessIterator p2, _Compare) {
46   A e;
47   __sort(p2, e);
48 }
49 struct C {
50   struct D {
51     int DwarfRegNum;
52   };
53   int parseRegisterLiveOutMask() const;
54 };
parseRegisterLiveOutMask()55 int C::parseRegisterLiveOutMask() const {
56   D f, g;
57   sort(&f, &g, [] {});
58 }
59 
60