Index: test/clang-tidy/abseil-upgrade-duration-conversions.cpp =================================================================== --- test/clang-tidy/abseil-upgrade-duration-conversions.cpp +++ test/clang-tidy/abseil-upgrade-duration-conversions.cpp @@ -430,3 +430,36 @@ factoryTemplateAndMacro>(); TemplateFactoryInMacro(ConvertibleTo()); } + +// This is a reduced test-case for PR39949 and manifested in this check. +namespace std { +template +_Tp declval(); + +template +struct __res { + template + static decltype(declval<_Functor>()(_Args()...)) _S_test(int); + + template + static void _S_test(...); + + typedef decltype(_S_test<_ArgTypes...>(0)) type; +}; + +template +struct function; + +template +struct function { + template ::type> + function(_Functor) {} +}; +} // namespace std + +typedef std::function F; + +F foo() { + return F([] {}); +}