remove space in GSL_SUPPRESS (#1248)

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.

Co-authored-by: Werner Henze <werner.henze+gitcommits@posteo.de>
This commit is contained in:
Werner Henze 2026-05-27 20:04:16 +02:00 committed by GitHub
parent 4524208d32
commit f3c5967126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View file

@ -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;
}

View file

@ -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<int*> 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<const int*> p) { return *p == 12; }

View file

@ -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)