gcc/libstdc++-v3/include
Jonathan Wakely de1e3b8795 libstdc++: Fix ambiguous comparisons in __gnu_debug::bitset [PR 96303]
With -pedantic the debug mode bitset has an ambiguous equality
comparison operator, because it tries to compare the non-debug base to
the debug object. The base object can be converted to another debug
bitset, making the same operator== a candidate again.

The fix is to do the comparison on both base objects, so the operator
for the derived type isn't a candidate.

For the inequality operator the same change should be done, but that
operator can be removed entirely for C++20 because it can be synthesized
by the compiler.

I don't think either equality or inequality operators are really needed,
because the public _GLIBCXX_STD_C::bitset base class cam always be
compared using its own comparison operators. I'm not changing that here
though.

libstdc++-v3/ChangeLog:

	PR libstdc++/96303
	* include/debug/bitset (bitset::operator==): Call _M_base() on
	right operand.
	(bitset::operator!=): Likewise, but don't define it at all when
	default comparisons are supported by the compiler.
	* testsuite/23_containers/bitset/operations/96303.cc: New test.
2020-08-07 20:29:11 +01:00
..
backward Update copyright years. 2020-01-01 12:51:42 +01:00
bits libstdc++: Implement P0966 std::string::reserve should not shrink 2020-08-06 19:49:07 +01:00
c Update copyright years. 2020-01-01 12:51:42 +01:00
c_compatibility Update copyright years. 2020-01-01 12:51:42 +01:00
c_global Update copyright years. 2020-01-01 12:51:42 +01:00
c_std Update copyright years. 2020-01-01 12:51:42 +01:00
debug libstdc++: Fix ambiguous comparisons in __gnu_debug::bitset [PR 96303] 2020-08-07 20:29:11 +01:00
decimal Update copyright years. 2020-01-01 12:51:42 +01:00
experimental libstdc++: Refactor filesystem::path string conversions 2020-05-23 09:40:16 +01:00
ext libstdc++: Replace __int_limits with __numeric_traits_integer 2020-07-07 23:36:29 +01:00
parallel libstdc++: Fix some C++20 algorithms to work in parallel mode 2020-05-07 21:43:49 +01:00
precompiled Update copyright years. 2020-01-01 12:51:42 +01:00
pstl
std libstdc++: Adjust overflow prevention to operator>> 2020-08-06 18:26:45 +01:00
tr1 Update copyright years. 2020-01-01 12:51:42 +01:00
tr2 Update copyright years. 2020-01-01 12:51:42 +01:00
Makefile.am libstdc++: Replace __int_limits with __numeric_traits_integer 2020-07-07 23:36:29 +01:00
Makefile.in libstdc++: Replace __int_limits with __numeric_traits_integer 2020-07-07 23:36:29 +01:00