main sync #3

Merged
Patrick Busch merged 318 commits from blender/blender:main into main 2023-03-17 15:52:21 +01:00
Showing only changes of commit 896360de1f - Show all commits

View File

@ -58,16 +58,9 @@ TEST(linear_allocator, CopyString)
blender::AlignedBuffer<256, 1> buffer; blender::AlignedBuffer<256, 1> buffer;
allocator.provide_buffer(buffer); allocator.provide_buffer(buffer);
/* False positive warning with GCC 12.2,
* considers assignment outside of array bounds (`char [0]`). */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
StringRefNull ref1 = allocator.copy_string("Hello"); StringRefNull ref1 = allocator.copy_string("Hello");
StringRefNull ref2 = allocator.copy_string("World"); StringRefNull ref2 = allocator.copy_string("World");
#pragma GCC diagnostic pop
EXPECT_EQ(ref1, "Hello"); EXPECT_EQ(ref1, "Hello");
EXPECT_EQ(ref2, "World"); EXPECT_EQ(ref2, "World");
EXPECT_EQ(ref2.data() - ref1.data(), 6); EXPECT_EQ(ref2.data() - ref1.data(), 6);