summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/Support/TrailingObjectsTest.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-02-05 22:32:52 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-02-05 22:32:52 +0000
commitebfdf26d934913e37b89bdaa037d0e4232f600a3 (patch)
tree00180b90ca680661250e0e9a0fc1750b06bd23a8 /llvm/unittests/Support/TrailingObjectsTest.cpp
parent6219836edd78a7dd4f710cef314409e0061d8c8d (diff)
downloadbcm5719-llvm-ebfdf26d934913e37b89bdaa037d0e4232f600a3.tar.gz
bcm5719-llvm-ebfdf26d934913e37b89bdaa037d0e4232f600a3.zip
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
Diffstat (limited to 'llvm/unittests/Support/TrailingObjectsTest.cpp')
-rw-r--r--llvm/unittests/Support/TrailingObjectsTest.cpp2
1 files changed, 2 insertions, 0 deletions
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<short>(NumShorts));
return new (Mem) Class1(ShortArray, NumShorts);
}
+ using TrailingObjects::operator delete;
short get(unsigned Num) const { return getTrailingObjects<short>()[Num]; }
@@ -78,6 +79,7 @@ public:
*C->getTrailingObjects<double>() = D;
return C;
}
+ using TrailingObjects::operator delete;
short getShort() const {
if (!HasShort)
OpenPOWER on IntegriCloud