about summary refs log tree commit diff
path: root/absl/types/span.h
diff options
context:
space:
mode:
Diffstat (limited to 'absl/types/span.h')
-rw-r--r--absl/types/span.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/absl/types/span.h b/absl/types/span.h
index 3283145a56b4..25347c63fe8c 100644
--- a/absl/types/span.h
+++ b/absl/types/span.h
@@ -276,7 +276,7 @@ class Span {
   // Returns a reference to the i'th element of this span.
   constexpr reference operator[](size_type i) const noexcept {
     // MSVC 2015 accepts this as constexpr, but not ptr_[i]
-    return *(data() + i);
+    return ABSL_ASSERT(i < size()), *(data() + i);
   }
 
   // Span::at()