bool
operator==(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
- { return _M_base() == __rhs; }
+ { return _M_base() == __rhs._M_base(); }
+#if __cpp_impl_three_way_comparison < 201907L
bool
operator!=(const bitset<_Nb>& __rhs) const _GLIBCXX_NOEXCEPT
- { return _M_base() != __rhs; }
+ { return _M_base() != __rhs._M_base(); }
+#endif
using _Base::test;
using _Base::all;
--- /dev/null
+// Copyright (C) 2020 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3. If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a -pedantic" }
+// { dg-do compile { target c++2a } }
+
+#include <debug/bitset>
+
+bool
+test01()
+{
+ __gnu_debug::bitset<1> b;
+ // PR libstdc++/96303
+ bool eq = b == b;
+ bool ne = b != b;
+ return eq && !ne;
+}