From 00d4a5aab6669258fc450d7ebfd1c37c78bc7473 Mon Sep 17 00:00:00 2001 From: beinhaerter <34543625+beinhaerter@users.noreply.github.com> Date: Wed, 11 Nov 2020 22:47:58 +0100 Subject: [PATCH] suppress bounds.1 (#950) Suppress "warning C26481: Don't use pointer arithmetic. Use span instead (bounds.1)." Co-authored-by: Werner Henze --- include/gsl/span | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/gsl/span b/include/gsl/span index 0f567df..506eb4c 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -152,6 +152,9 @@ namespace details { Expects(begin_ && current_ && end_); Expects(current_ < end_); + // clang-format off + GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute + // clang-format on ++current_; return *this; } @@ -183,6 +186,9 @@ namespace details if (n != 0) Expects(begin_ && current_ && end_); if (n > 0) Expects(end_ - current_ >= n); if (n < 0) Expects(current_ - begin_ >= -n); + // clang-format off + GSL_SUPPRESS(bounds.1) // NO-FORMAT: attribute + // clang-format on current_ += n; return *this; }