Author
anonymous
about 4 years ago
Language
C++
Compiler
gcc HEAD 12.0.0 20210721 (experimental)
Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic
Author
anonymous
about 4 years ago
$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/stop_token:35,
from /opt/wandbox/gcc-head/include/c++/12.0.0/thread:40,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h: In instantiation of 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(Foo&); _Args = {Foo&}; <template-parameter-1-3> = void]':
prog.cc:8:21: required from here
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:130:72: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
130 | typename decay<_Args>::type...>::value,
| ^~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:130:72: note: 'std::integral_constant<bool, false>::value' evaluates to false
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h: In instantiation of 'struct std::thread::_Invoker<std::tuple<void (*)(Foo&), Foo> >':
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:203:13: required from 'struct std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(Foo&), Foo> > >'
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:143:29: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(Foo&); _Args = {Foo&}; <template-parameter-1-3> = void]'
prog.cc:8:21: required from here
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:252:11: error: no type named 'type' in 'struct std::thread::_Invoker<std::tuple<void (*)(Foo&), Foo> >::__result<std::tuple<void (*)(Foo&), Foo> >'
252 | _M_invoke(_Index_tuple<_Ind...>)
| ^~~~~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/std_thread.h:256:9: error: no type named 'type' in 'struct std::thread::_Invoker<std::tuple<void (*)(Foo&), Foo> >::__result<std::tuple<void (*)(Foo&), Foo> >'
256 | operator()()
| ^~~~~~~~
Exit Code:
1