[committed 2/2] libstdc++: Fix compilation of <stop_token> with Clang

Jonathan Wakely jwakely@redhat.com
Wed Mar 18 13:01:37 GMT 2020


Clang 9 supports C++20 via -std=c++2a but doesn't support three-way
comparisons, so <stop_token> fails to compile. When the compiler doesn't
support default comparisons, this patch defines operator== and
operator!= for the _Stop_state_ref class. That is enough for the header
to be compiled with Clang. It allows operator== for stop_token and
stop_source to work, but not operator!= because that isn't explicitly
defined.

	* include/std/stop_token (stop_token::_Stop_state_ref): Define
	comparison operators explicitly if the compiler won't synthesize them.

Tested powerpc64le-linux, committed to master.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 1684 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20200318/e9792967/attachment.bin>


More information about the Libstdc++ mailing list