Skip to content

Commit 12c4be1

Browse files
committed
[clang][unittests] On Windows, silence warning when building with MSVC
Fixes: ``` [113/324] Building CXX object tools\clang\unittests\AST\ByteCode\CMakeFiles\InterpTests.dir\BitcastBuffer.cpp.obj C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(52): warning C4309: 'initializing': truncation of constant value C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(53): warning C4309: 'initializing': truncation of constant value ```
1 parent 84ed81b commit 12c4be1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/unittests/AST/ByteCode/BitcastBuffer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ TEST(BitcastBuffer, PushData) {
4949

5050
BitcastBuffer Buff2(Bytes(sizeof(int)).toBits());
5151
{
52-
short s1 = 0xCAFE;
53-
short s2 = 0xBABE;
52+
short s1 = (short)0xCAFE;
53+
short s2 = (short)0xBABE;
5454
std::byte sdata[2];
5555

5656
std::memcpy(sdata, &s1, sizeof(s1));

0 commit comments

Comments
 (0)