Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

over 8 years ago

Language

Compiler

Options

Author

anonymous

over 8 years ago

$
prog.cc: In instantiation of '<lambda(auto:1)> [with auto:1 = int]':
/opt/wandbox/gcc-head/include/c++/7.0.1/type_traits:2431:26:   required by substitution of 'template<class _Fn, class ... _Args> static std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn = <lambda(auto:1)>; _Args = {int}]'
/opt/wandbox/gcc-head/include/c++/7.0.1/type_traits:2442:55:   required from 'struct std::__result_of_impl<false, false, <lambda(auto:1)>, int>'
/opt/wandbox/gcc-head/include/c++/7.0.1/type_traits:2840:12:   recursively required by substitution of 'template<class _Result, class _Ret> struct std::__is_invocable_impl<_Result, _Ret, std::__void_t<typename _Result::type> > [with _Result = std::__invoke_result<<lambda(auto:1)>, int>; _Ret = void]'
/opt/wandbox/gcc-head/include/c++/7.0.1/type_traits:2840:12:   required from 'struct std::is_invocable<<lambda(auto:1)>, int>'
prog.cc:4:51:   required from here
prog.cc:3:24: error: request for member 'foo' in 'x', which is of non-class type 'int'
 auto l = [](auto x){ x.foo(); };
                      ~~^~~
prog.cc:4:1: error: static assertion failed
 static_assert(!std::is_invocable<decltype(l), int>::value);
 ^~~~~~~~~~~~~
Exit Code:
1