[llvm] r244023 - [ArrayRefTest] Work around a GCC 4.8 internal compiler error.

Benjamin Kramer benny.kra at googlemail.com
Wed Aug 5 02:39:42 PDT 2015


Author: d0k
Date: Wed Aug  5 04:39:41 2015
New Revision: 244023

URL: http://llvm.org/viewvc/llvm-project?rev=244023&view=rev
Log:
[ArrayRefTest] Work around a GCC 4.8 internal compiler error.

Modified:
    llvm/trunk/unittests/ADT/ArrayRefTest.cpp

Modified: llvm/trunk/unittests/ADT/ArrayRefTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT/ArrayRefTest.cpp?rev=244023&r1=244022&r2=244023&view=diff
==============================================================================
--- llvm/trunk/unittests/ADT/ArrayRefTest.cpp (original)
+++ llvm/trunk/unittests/ADT/ArrayRefTest.cpp Wed Aug  5 04:39:41 2015
@@ -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<NonAssignable> Array3Copy = makeArrayRef(Array3Src).copy(Alloc);
   EXPECT_EQ(makeArrayRef(Array3Src), Array3Copy);
   EXPECT_NE(makeArrayRef(Array3Src).data(), Array3Copy.data());
-#endif
 }
 
 TEST(ArrayRefTest, DropBack) {




More information about the llvm-commits mailing list