mirror of
https://github.com/microsoft/GSL.git
synced 2025-01-18 17:55:01 -05:00
fixing clang build break
This commit is contained in:
parent
7e4ed8da98
commit
25e7af9c7d
@ -772,10 +772,11 @@ template <class ElementType, std::size_t Extent>
|
|||||||
span<const byte, details::calculate_byte_size<ElementType, Extent>::value>
|
span<const byte, details::calculate_byte_size<ElementType, Extent>::value>
|
||||||
as_bytes(span<ElementType, Extent> s) noexcept
|
as_bytes(span<ElementType, Extent> s) noexcept
|
||||||
{
|
{
|
||||||
|
using type = span<const byte, details::calculate_byte_size<ElementType, Extent>::value>;
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
|
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
|
||||||
// clang-format on
|
// 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()};
|
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>
|
span<byte, details::calculate_byte_size<ElementType, Extent>::value>
|
||||||
as_writable_bytes(span<ElementType, Extent> s) noexcept
|
as_writable_bytes(span<ElementType, Extent> s) noexcept
|
||||||
{
|
{
|
||||||
|
using type = span<byte, details::calculate_byte_size<ElementType, Extent>::value>;
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
|
GSL_SUPPRESS(type.1) // NO-FORMAT: attribute
|
||||||
// clang-format on
|
// clang-format on
|
||||||
using type = span<byte, details::calculate_byte_size<ElementType, Extent>::value>;
|
|
||||||
return type{reinterpret_cast<byte*>(s.data()), s.size_bytes()};
|
return type{reinterpret_cast<byte*>(s.data()), s.size_bytes()};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1180,7 +1180,7 @@ TEST(span_test, from_array_constructor)
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
auto f = [&]() {
|
auto f = [&]() {
|
||||||
span<int, 4> _s4{arr2, 2};
|
const span<int, 4> _s4{arr2, 2};
|
||||||
static_cast<void>(_s4);
|
static_cast<void>(_s4);
|
||||||
};
|
};
|
||||||
EXPECT_DEATH(f(), deathstring);
|
EXPECT_DEATH(f(), deathstring);
|
||||||
|
Loading…
Reference in New Issue
Block a user