aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdbsupport/array-view.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdbsupport/array-view.h b/gdbsupport/array-view.h
index 6f7e45a..edf6655 100644
--- a/gdbsupport/array-view.h
+++ b/gdbsupport/array-view.h
@@ -171,7 +171,7 @@ public:
}
constexpr const_reference operator[] (size_t index) const noexcept
{
-#if defined(_GLIBCXX_DEBUG)
+#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L
gdb_assert (index < m_size);
#endif
return m_array[index];
@@ -185,7 +185,7 @@ public:
/* Return a new array view over SIZE elements starting at START. */
constexpr array_view<T> slice (size_type start, size_type size) const noexcept
{
-#if defined(_GLIBCXX_DEBUG)
+#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L
gdb_assert (start + size <= m_size);
#endif
return {m_array + start, size};
@@ -195,7 +195,7 @@ public:
inclusive. */
constexpr array_view<T> slice (size_type start) const noexcept
{
-#if defined(_GLIBCXX_DEBUG)
+#if defined(_GLIBCXX_DEBUG) && __cplusplus >= 201402L
gdb_assert (start <= m_size);
#endif
return {m_array + start, size () - start};