forked from qt-creator/qt-creator
Utils: Disable warning about unsafe buffer access
There is a compile time check for the size but it seem that clang is missing that information. Change-Id: I53ea97cd2a56f11e7ff4428a13b39d19a7d73cf1 Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
@@ -86,6 +86,8 @@ struct alignas(16) StringDataLayout
|
|||||||
, reference{{string}, size, 0}
|
, reference{{string}, size, 0}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_CLANG("-Wunsafe-buffer-usage")
|
||||||
template<size_type Size>
|
template<size_type Size>
|
||||||
constexpr StringDataLayout(const char (&string)[Size]) noexcept
|
constexpr StringDataLayout(const char (&string)[Size]) noexcept
|
||||||
{
|
{
|
||||||
@@ -110,6 +112,7 @@ struct alignas(16) StringDataLayout
|
|||||||
reference = {{string}, Size - 1, 0};
|
reference = {{string}, Size - 1, 0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QT_WARNING_POP
|
||||||
|
|
||||||
constexpr static size_type shortStringCapacity() noexcept
|
constexpr static size_type shortStringCapacity() noexcept
|
||||||
{
|
{
|
||||||
@@ -159,6 +162,8 @@ struct alignas(16) StringDataLayout<MaximumShortStringDataAreaSize,
|
|||||||
, reference{{string}, size, 0}
|
, reference{{string}, size, 0}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
QT_WARNING_PUSH
|
||||||
|
QT_WARNING_DISABLE_CLANG("-Wunsafe-buffer-usage")
|
||||||
template<size_type Size>
|
template<size_type Size>
|
||||||
constexpr StringDataLayout(const char (&string)[Size]) noexcept
|
constexpr StringDataLayout(const char (&string)[Size]) noexcept
|
||||||
{
|
{
|
||||||
@@ -183,6 +188,7 @@ struct alignas(16) StringDataLayout<MaximumShortStringDataAreaSize,
|
|||||||
reference = {{string}, Size - 1, 0};
|
reference = {{string}, Size - 1, 0};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QT_WARNING_POP
|
||||||
|
|
||||||
void copyHere(const StringDataLayout &other) noexcept
|
void copyHere(const StringDataLayout &other) noexcept
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user