diff --git a/unittests/ADT/ArrayRefTest.cpp b/unittests/ADT/ArrayRefTest.cpp index 00afcae2e7a..3ab13a34829 100644 --- a/unittests/ADT/ArrayRefTest.cpp +++ b/unittests/ADT/ArrayRefTest.cpp @@ -46,21 +46,18 @@ TEST(ArrayRefTest, AllocatorCopy) { EXPECT_TRUE(Array2.equals(Array2c)); EXPECT_NE(Array2.data(), Array2c.data()); -#if __GNUC__==4 && __GNUC_MINOR__==8 - // g++-4.8 cannot compile the block below. -#else // Check that copy can cope with uninitialized memory. struct NonAssignable { const char *Ptr; + NonAssignable(const char *Ptr) : Ptr(Ptr) {} NonAssignable(const NonAssignable &RHS) = default; void operator=(const NonAssignable &RHS) { assert(RHS.Ptr != nullptr); } bool operator==(const NonAssignable &RHS) const { return Ptr == RHS.Ptr; } - } Array3Src[] = {{"hello"}, {"world"}}; + } Array3Src[] = {"hello", "world"}; ArrayRef Array3Copy = makeArrayRef(Array3Src).copy(Alloc); EXPECT_EQ(makeArrayRef(Array3Src), Array3Copy); EXPECT_NE(makeArrayRef(Array3Src).data(), Array3Copy.data()); -#endif } TEST(ArrayRefTest, DropBack) {