mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Update Clang GSL_SUPPRESS to stringize parameter instead of using fixed string literal. (#1133)
Fix #1130.
This commit is contained in:
parent
2940006b5c
commit
52212c2d76
@ -46,7 +46,7 @@
|
|||||||
// Hopefully temporary until suppression standardization occurs
|
// Hopefully temporary until suppression standardization occurs
|
||||||
//
|
//
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#define GSL_SUPPRESS(x) [[gsl::suppress("x")]]
|
#define GSL_SUPPRESS(x) [[gsl::suppress(#x)]]
|
||||||
#else
|
#else
|
||||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
|
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
|
||||||
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
|
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
|
||||||
|
@ -17,20 +17,6 @@
|
|||||||
#ifndef GSL_BYTE_H
|
#ifndef GSL_BYTE_H
|
||||||
#define GSL_BYTE_H
|
#define GSL_BYTE_H
|
||||||
|
|
||||||
//
|
|
||||||
// make suppress attributes work for some compilers
|
|
||||||
// Hopefully temporary until suppression standardization occurs
|
|
||||||
//
|
|
||||||
#if defined(__clang__)
|
|
||||||
#define GSL_SUPPRESS(x) [[gsl::suppress("x")]]
|
|
||||||
#else
|
|
||||||
#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__NVCC__)
|
|
||||||
#define GSL_SUPPRESS(x) [[gsl::suppress(x)]]
|
|
||||||
#else
|
|
||||||
#define GSL_SUPPRESS(x)
|
|
||||||
#endif // _MSC_VER
|
|
||||||
#endif // __clang__
|
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
|
||||||
// VS2017 15.8 added support for the __cpp_lib_byte definition
|
// VS2017 15.8 added support for the __cpp_lib_byte definition
|
||||||
|
@ -37,9 +37,6 @@ TEST(byte_tests, construction)
|
|||||||
EXPECT_TRUE(static_cast<unsigned char>(b) == 4);
|
EXPECT_TRUE(static_cast<unsigned char>(b) == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clang-format off
|
|
||||||
GSL_SUPPRESS(es.49)
|
|
||||||
// clang-format on
|
|
||||||
{
|
{
|
||||||
const byte b = byte(12);
|
const byte b = byte(12);
|
||||||
EXPECT_TRUE(static_cast<unsigned char>(b) == 12);
|
EXPECT_TRUE(static_cast<unsigned char>(b) == 12);
|
||||||
|
Loading…
Reference in New Issue
Block a user