From bb7d5b0736c498927f1495cc22ff8917db9b6ed6 Mon Sep 17 00:00:00 2001 From: Werner Henze Date: Tue, 26 May 2026 22:03:27 +0200 Subject: [PATCH] remove space in GSL_SUPPRESS As VS2026 wants a string literal in `[[gsl::suppress(...)]]` it is a difference, if you `GSL_SUPPRESS(a.1)` without space or `GSL_SUPPRESS(a .1)` with space. The version with the space does not work, so this commit removes the spaces. --- include/gsl/span | 2 +- tests/notnull_tests.cpp | 4 ++-- tests/owner_tests.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/gsl/span b/include/gsl/span index cef8a7743..af351ca17 100644 --- a/include/gsl/span +++ b/include/gsl/span @@ -221,7 +221,7 @@ namespace details if (n != 0) Expects(begin_ && current_ && end_); if (n > 0) Expects(current_ - begin_ >= n); if (n < 0) Expects(end_ - current_ >= -n); - GSL_SUPPRESS(bounds .1) + GSL_SUPPRESS(bounds.1) current_ -= n; return *this; } diff --git a/tests/notnull_tests.cpp b/tests/notnull_tests.cpp index 4fa48b0bf..8cb9f8620 100644 --- a/tests/notnull_tests.cpp +++ b/tests/notnull_tests.cpp @@ -138,11 +138,11 @@ struct NonCopyableNonMovable namespace { // clang-format off -GSL_SUPPRESS(f .4) // NO-FORMAT: attribute +GSL_SUPPRESS(f.4) // NO-FORMAT: attribute // clang-format on bool helper(not_null p) { return *p == 12; } // clang-format off -GSL_SUPPRESS(f .4) // NO-FORMAT: attribute +GSL_SUPPRESS(f.4) // NO-FORMAT: attribute // clang-format on bool helper_const(not_null p) { return *p == 12; } diff --git a/tests/owner_tests.cpp b/tests/owner_tests.cpp index 3b7a38b34..0cb47e851 100644 --- a/tests/owner_tests.cpp +++ b/tests/owner_tests.cpp @@ -21,7 +21,7 @@ using namespace gsl; -GSL_SUPPRESS(f .23) // NO-FORMAT: attribute +GSL_SUPPRESS(f.23) // NO-FORMAT: attribute void f(int* i) { *i += 1; } TEST(owner_tests, basic_test)