gcc/libstdc++-v3/testsuite/23_containers
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
..
array libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
bitset libstdc++: Fix ambiguous comparisons in __gnu_debug::bitset [PR 96303] 2020-08-07 20:29:11 +01:00
deque libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) 2020-06-02 18:13:33 +01:00
forward_list libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) 2020-06-02 18:13:33 +01:00
headers libstdc++: Require c++98_only effective target for some tests 2020-07-02 21:27:12 +01:00
list libstdc++: Make debug containers prefer copy ctor to base ctor (PR 90102) 2020-06-02 18:13:33 +01:00
map libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
multimap libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
multiset libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
priority_queue Library-side tests for parenthesized aggregate init 2020-03-31 17:07:52 +03:00
queue libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
set libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
span libstdc++: Add dg-require-effective-target to std::span assert tests 2020-07-31 19:58:02 +01:00
stack libstdc++: Define operator<=> for std::stack and std::queue 2020-04-19 21:30:15 +01:00
unordered_map libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
unordered_multimap libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
unordered_multiset libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
unordered_set libstdc++: Ensure c++NN effective target present in all C++17 tests 2020-07-31 19:58:02 +01:00
vector libstdc++: Fix and improve std::vector<bool> implementation. 2020-07-31 23:18:51 +02:00