// PR c++/78006 // { dg-do compile { target c++14 } } template T&& declval() noexcept; template struct common_type; template struct common_type<_Tp> { typedef _Tp type; }; template struct common_type<_Tp, _Up> { typedef decltype(true ? declval<_Tp>() : declval<_Up>()) type; }; template struct common_type<_Tp, _Up, _Vp...> { typedef typename common_type::type, _Vp...>::type type; }; template using common_type_t = typename common_type<_Tp...>::type; template auto x(TFs&&... fs) { using rt = common_type_t; return [](auto) -> rt { }; } int main() { x([](int){})(0); }