#include <iostream>
#include <type_traits>
using namespace std;
int main() {
auto f = [](auto x, auto y = std::decay_t<decltype(x)>{}) {
;
};
f(0);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dHlwZV90cmFpdHM+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglhdXRvIGYgPSBbXShhdXRvIHgsIGF1dG8geSA9IHN0ZDo6ZGVjYXlfdDxkZWNsdHlwZSh4KT57fSkgewoJCTsKCX07CgkKCWYoMCk7CgkKCXJldHVybiAwOwp9
prog.cpp: In function ‘int main()’:
prog.cpp:11:5: error: no match for call to ‘(main()::<lambda(auto:1, auto:2)>) (int)’
f(0);
^
prog.cpp:7:58: note: candidate: template<class auto:1, class auto:2> main()::<lambda(auto:1, auto:2)>::operator decltype (((const main()::<lambda(auto:1, auto:2)>*)((const main()::<lambda(auto:1, auto:2)>* const)0u))->operator()(static_cast<auto:1&&>(<anonymous>), static_cast<auto:2&&>(<anonymous>))) (*)(auto:1, auto:2)() const
auto f = [](auto x, auto y = std::decay_t<decltype(x)>{}) {
^
prog.cpp:7:58: note: template argument deduction/substitution failed:
prog.cpp:11:5: note: couldn't deduce template parameter ‘auto:2’
f(0);
^
prog.cpp:7:58: note: candidate: template<class auto:1, class auto:2> main()::<lambda(auto:1, auto:2)>
auto f = [](auto x, auto y = std::decay_t<decltype(x)>{}) {
^
prog.cpp:7:58: note: template argument deduction/substitution failed:
prog.cpp:11:5: note: couldn't deduce template parameter ‘auto:2’
f(0);
^