===================================================================
@@ -50,7 +50,18 @@
static constexpr _Tp*
_S_ptr(const _Type& __t, std::size_t __n) noexcept
+#if __google_stl_debug_array
+ {
+ return __n < _Nm
+ ? const_cast<_Tp*>(std::__addressof(__t[__n]))
+ : (std::__throw_out_of_range_fmt(__N("array::_S_ptr: __n "
+ "(which is %zu) >= size() "
+ "(which is %zu)"),
+ __n, _Nm), nullptr);
+ }
+#else
{ return const_cast<_Tp*>(std::__addressof(__t[__n])); }
+#endif
};
template<typename _Tp>
===================================================================
@@ -28,6 +28,6 @@
int n2 = std::get<1>(std::move(a));
int n3 = std::get<1>(ca);
-// { dg-error "static assertion failed" "" { target *-*-* } 274 }
-// { dg-error "static assertion failed" "" { target *-*-* } 283 }
-// { dg-error "static assertion failed" "" { target *-*-* } 291 }
+// { dg-error "static assertion failed" "" { target *-*-* } 285 }
+// { dg-error "static assertion failed" "" { target *-*-* } 294 }
+// { dg-error "static assertion failed" "" { target *-*-* } 302 }
===================================================================
@@ -23,4 +23,4 @@
typedef std::tuple_element<1, std::array<int, 1>>::type type;
-// { dg-error "static assertion failed" "" { target *-*-* } 320 }
+// { dg-error "static assertion failed" "" { target *-*-* } 331 }