Fix compilation errors on gcc 4.4

This commit is contained in:
Victor Zverovich committed 2018-05-20 09:09:03 -07:00
1 parent 936aba5f90
commit edd5f1445d
7 files changed
+52 -33

No files matched your search

+6 -5
View File
@@ -397,13 +397,14 @@ TEST(FixedBufferTest, BufferOverflow) {
EXPECT_THROW_MSG(buffer.resize(11), std::runtime_error, "buffer overflow");
}
struct uint32_pair {
uint32_t u[2];
};
TEST(UtilTest, BitCast) {
struct S {
uint32_t u[2];
};
auto s = fmt::internal::bit_cast<S>(uint64_t(42));
auto s = fmt::internal::bit_cast<uint32_pair>(uint64_t{42});
EXPECT_EQ(fmt::internal::bit_cast<uint64_t>(s), 42u);
s = fmt::internal::bit_cast<S>(uint64_t(~0ull));
s = fmt::internal::bit_cast<uint32_pair>(uint64_t(~0ull));
EXPECT_EQ(fmt::internal::bit_cast<uint64_t>(s), ~0ull);
}