fixing clang build break

This commit is contained in:
Jordan Maples 2020-05-20 17:52:03 -07:00
parent 7e4ed8da98
commit 25e7af9c7d
2 changed files with 5 additions and 3 deletions

View File

@ -772,10 +772,11 @@ template <class ElementType, std::size_t Extent>
span<const byte, details::calculate_byte_size<ElementType, Extent>::value>
as_bytes(span<ElementType, Extent> s) noexcept
{
using type = span<const byte, details::calculate_byte_size<ElementType, Extent>::value>;
// clang-format off
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
// clang-format on
using type = span<const byte, details::calculate_byte_size<ElementType, Extent>::value>;
return type{reinterpret_cast<const byte*>(s.data()), s.size_bytes()};
}
@ -784,10 +785,11 @@ template <class ElementType, std::size_t Extent,
span<byte, details::calculate_byte_size<ElementType, Extent>::value>
as_writable_bytes(span<ElementType, Extent> s) noexcept
{
using type = span<byte, details::calculate_byte_size<ElementType, Extent>::value>;
// clang-format off
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
// clang-format on
using type = span<byte, details::calculate_byte_size<ElementType, Extent>::value>;
return type{reinterpret_cast<byte*>(s.data()), s.size_bytes()};
}

View File

@ -1180,7 +1180,7 @@ TEST(span_test, from_array_constructor)
#endif
{
auto f = [&]() {
span<int, 4> _s4{arr2, 2};
const span<int, 4> _s4{arr2, 2};
static_cast<void>(_s4);
};
EXPECT_DEATH(f(), deathstring);