From ebfdf26d934913e37b89bdaa037d0e4232f600a3 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 5 Feb 2016 22:32:52 +0000 Subject: More workarounds for undefined behavior exposed when compiling in C++14 with -fsized-deallocation. Disable sized deallocation for all objects derived from TrailingObjects, as we expect the storage allocated for these objects to be larger than the size of their dynamic type. llvm-svn: 259942 --- llvm/unittests/Support/TrailingObjectsTest.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/unittests/Support/TrailingObjectsTest.cpp') diff --git a/llvm/unittests/Support/TrailingObjectsTest.cpp b/llvm/unittests/Support/TrailingObjectsTest.cpp index 170cbc372b8..92cdd6d3824 100644 --- a/llvm/unittests/Support/TrailingObjectsTest.cpp +++ b/llvm/unittests/Support/TrailingObjectsTest.cpp @@ -34,6 +34,7 @@ public: void *Mem = ::operator new(totalSizeToAlloc(NumShorts)); return new (Mem) Class1(ShortArray, NumShorts); } + using TrailingObjects::operator delete; short get(unsigned Num) const { return getTrailingObjects()[Num]; } @@ -78,6 +79,7 @@ public: *C->getTrailingObjects() = D; return C; } + using TrailingObjects::operator delete; short getShort() const { if (!HasShort) -- cgit v1.2.3