1 // PR c++/77890
2 // { dg-options -std=c++17 }
3 
SS4 template<class F> struct S{S(F&&f){}};
f()5 void f()
6 {
7   S([]{});
8 }
9 
10 template <typename TF>
11 struct scope_guard : TF
12 {
scope_guardscope_guard13     scope_guard(TF f) : TF{f} { }
~scope_guardscope_guard14     ~scope_guard() { (*this)(); }
15 };
16 
g()17 void g()
18 {
19     struct K { void operator()() {} };
20     scope_guard _{K{}};
21 }
22