1 // PR c++/77337
2 // { dg-do compile { target c++14 } }
3 
4 template<typename Functor>
5 struct fix_type {
6   Functor functor;
7 
operatorfix_type8   decltype(auto) operator()()
9   { return functor(*this); }
10 };
11 
12 template<typename Functor>
fix(Functor functor)13 fix_type<Functor> fix(Functor functor)
14 { return { functor }; }
15 
main()16 int main()
17 {
18   auto zero = fix
19     ([](auto& self) -> int // N.B. non-deduced, non-dependent return type
20      {
21        return 0;
22 
23        self(); // { dg-bogus "use of \[^\n\r]* before deduction of 'auto'" }
24      });
25 
26   return zero();
27 }
28