<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60945>60945</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
unsupported signature for 'std::move<_IO_FILE *&> (and many others) with built-in std::move
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Cogitri
</td>
</tr>
</table>
<pre>
Hello,
ever since https://reviews.llvm.org/D123345 (tested on clang-15), tools like `clang-tidy` fail to build many C++ projects using `std::move`, like boost. It builds without problems with `-fno-builtin`. The following errors are emitted for e.g. `boost`:
```
error: too many errors emitted, stopping now [clang-diagnostic-error]
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/core/exchange.hpp:40:11: error: unsupported signature for 'std::move<_IO_FILE *&>' [clang-diagnostic-error]
T v = std::move(t);
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/beast/core/impl/file_stdio.ipp:31:17: note: in instantiation of function template specialization 'boost::exchange<_IO_FILE *, std::nullptr_t>' requested here
: f_(boost::exchange(other.f_, nullptr))
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/core/exchange.hpp:40:11: error: unsupported signature for 'std::move<bool &>' [clang-diagnostic-error]
T v = std::move(t);
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/beast/core/detail/stream_base.hpp:93:29: note: in instantiation of function template specialization 'boost::exchange<bool, bool>' requested here
, clear_(boost::exchange(
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/core/exchange.hpp:40:11: error: unsupported signature for 'std::move<boost::beast::saved_handler::base *&>' [clang-diagnostic-error]
T v = std::move(t);
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/beast/core/impl/saved_handler.ipp:28:17: note: in instantiation of function template specialization 'boost::exchange<boost::beast::saved_handler::base *, std::nullptr_t>' requested here
: p_(boost::exchange(other.p_, nullptr))
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/core/exchange.hpp:40:11: error: unsupported signature for 'std::move<char *&>' [clang-diagnostic-error]
T v = std::move(t);
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/beast/core/detail/impl/temporary_buffer.ipp:62:23: note: in instantiation of function template specialization 'boost::exchange<char *, char *const &>' requested here
deallocate(boost::exchange(data_, p));
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/core/exchange.hpp:40:11: error: unsupported signature for 'std::move<int &>' [clang-diagnostic-error]
T v = std::move(t);
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/beast/core/impl/file_posix.ipp:81:18: note: in instantiation of function template specialization 'boost::exchange<int, int>' requested here
: fd_(boost::exchange(other.fd_, -1))
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/local_counted_base.hpp:67:9: error: use of undeclared identifier '__builtin_assume' [clang-diagnostic-error]
__builtin_assume( local_use_count_ >= 1 );
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/local_counted_base.hpp:110:79: error: unsupported signature for 'std::move<boost::detail::shared_count &>' [clang-diagnostic-error]
explicit local_counted_impl( shared_count && pn ) BOOST_SP_NOEXCEPT: pn_( std::move(pn) )
^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:35:49: error: too few arguments to function call, expected 6, have 3 [clang-diagnostic-error]
__atomic_fetch_add( pw, 1, __ATOMIC_RELAXED );
~~~~~~~~~~~~~~~~~~ ^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:40:56: error: too few arguments to function call, expected 6, have 3 [clang-diagnostic-error]
return __atomic_fetch_sub( pw, 1, __ATOMIC_ACQ_REL );
~~~~~~~~~~~~~~~~~~ ^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:49:27: error: cannot initialize a variable of type 'boost::uint_least32_t' (aka 'unsigned int') with an rvalue of type 'void' [clang-diagnostic-error]
boost::uint_least32_t r = __atomic_load_n( pw, __ATOMIC_RELAXED );
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:58:57: error: too many arguments to function call, expected 3, have 6 [clang-diagnostic-error]
if( __atomic_compare_exchange_n( pw, &r, r + 1, true, __ATOMIC_RELAXED, __ATOMIC_RELAXED ) )
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/sp_counted_base_gcc_atomic.hpp:67:12: error: cannot initialize return object of type 'boost::uint_least32_t' (aka 'unsigned int') with an rvalue of type 'void' [clang-diagnostic-error]
return __atomic_load_n( pw, __ATOMIC_ACQUIRE );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:39:61: error: too few arguments to function call, expected 3, have 2 [clang-diagnostic-error]
return __atomic_test_and_set( &v_, __ATOMIC_ACQUIRE ) == 0;
~~~~~~~~~~~~~~~~~~~~~ ^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:52:47: error: too few arguments to function call, expected 3, have 2 [clang-diagnostic-error]
__atomic_clear( &v_, __ATOMIC_RELEASE );
~~~~~~~~~~~~~~ ^
/home/dev/.conan/data/boost/1.80.0/_/_/package/6c6f550ea882f4b157cd61f6b5b4e434517f30ae/include/boost/smart_ptr/shared_ptr.hpp:364:169: error: unsupported signature for 'std::move<boost::detail::shared_count &>' [clang-diagnostic-error]
BOOST_CONSTEXPR shared_ptr( boost::detail::sp_internal_constructor_tag, element_type * px_, boost::detail::shared_count && pn_ ) BOOST_SP_NOEXCEPT : px( px_ ), pn( std::move( pn_ ) )
^
/home/dev/Projects/ds4-util/build/../ds4b-tests-util/src/http/DownloaderTestsServer.cpp:37:59: error: unsupported signature for 'std::move<boost::asio::basic_stream_socket<boost::asio::ip::tcp> &>' [clang-diagnostic-error]
return SharedPtr<HttpConnection>(new HttpConnection(std::move(socket)));
^
/home/dev/Projects/ds4-util/build/../ds4b-tests-util/src/http/DownloaderTestsServer.cpp:54:18: error: unsupported signature for 'std::move<boost::asio::basic_stream_socket<boost::asio::ip::tcp> &>' [clang-diagnostic-error]
: socket(std::move(socket)), deadline(this->socket.get_executor(), std::chrono::seconds(10)) {
^
/home/dev/Projects/ds4-util/build/../ds4b-tests-util/src/http/DownloaderTestsServer.cpp:131:32: error: unsupported signature for 'std::move<boost::asio::basic_stream_socket<boost::asio::ip::tcp> &>' [clang-diagnostic-error]
HttpConnection::create(std::move(socket))->start();
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:553:38: error: unsupported signature for 'std::move<std::allocator<char> &>' [clang-diagnostic-error]
: _M_dataplus(_M_local_data(), std::move(__str._M_get_allocator()))
^
/usr/bin/../lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/basic_string.h:6604:12: note: in instantiation of member function 'std::basic_string<char>::basic_string' requested here
return __str;
^
8726 warnings and 20 errors generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzkWt9z2rgW_mvEiwbGlrGBBx4IgdnOtJtukzvTN41sH4O2QvKVZJLeh_u33zmygZBAmrabu8mWaWOw5SPp-75zdPRDOCdXGmBK0guSXvZE49fGTudmJb2VvdyUX6e_gVKGsDmJLkk0a__CFix1UhdA197XjiQzwpaELS1sJdy6gVLbzcDYFWHLy5glyTClhI09OA8lNZoWSuhVP04JmxA2p94Y5aiSX4CSLGofell-JVlEKyEV9YbmjVQl3Qj9lc4JuyDsgtbW_AmFd7RxUq_wVedLbEsy25gtkCxC48FsbozzA_rOt3YcvZV-bRqPNnIFm_YGmuhX2vSxkJeaZNGA3qyBVkYpc4uVgLXGOiosUNhIj_2pjKUwWA3w7VAPVpzM7gOGd9p_LX5ohCQz7Hjbpc5sZxKb7bypa6xRm1tK0osWlVKKlTbOy6LfGkkvuxrYcm02QNiyhC1hy0FhtND4U3hB2LJtGFvGg3E0iAhb8u5_LYovYoUvZkVWpWkEYjxm1TCP01FRZnGV5Wk-hGEyTONRlUQCi0pdqKaEe3YLY_En3BVroVcwWNc1SWZDBCKOsav7PjfaNXVtLEKH8hO-sRBAJGx0TGAy5--u-PLd-wUlbEZYRpIFYaNnwEEppTd0S0lySY9tsrFH1SUXXUGSLl4HgjmI-0jKTa0IW1ZSAXe-lGYgA6QJohmPEEltPOBVaiq180J7Kbw0mpqKVo0uwncPm1oJD9TVUEih5H_aMoSN2poDNDveHkE-P8CnG6V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