@@ -303,7 +303,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX20_CONSTEXPR
inline bool
operator==(const array<_Tp, _Nm>& __one, const array<_Tp, _Nm>& __two)
- { return std::equal(__one.begin(), __one.end(), __two.begin()); }
+ { return std::__equal_aux1(__one.begin(), __one.end(), __two.begin()); }
#if __cpp_lib_three_way_comparison // C++ >= 20 && lib_concepts
template<typename _Tp, size_t _Nm>
new file mode 100644
@@ -0,0 +1,15 @@
+// { dg-options "-D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++20 } }
+
+// Bug libstdc++/106212 - Code becomes non-constexpr with _GLIBCXX_DEBUG
+
+#include <array>
+
+struct A
+{
+ constexpr A(int i) : e{i} {}
+ constexpr bool operator==(const A& a) const = default;
+ std::array<int, 1> e;
+};
+
+static_assert(A{1} != A{2}, "");