summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Biryukov <ibiryukov@google.com>2018-06-06 09:22:19 +0000
committerIlya Biryukov <ibiryukov@google.com>2018-06-06 09:22:19 +0000
commitb7c374500607486d56ae16195b57ea737fa2e5a5 (patch)
tree8db73cbcc2ac11d259e7009360a808a0dc0e153a
parent5583ec4218dd1bbc64f1b0918c3ea6979b38a44a (diff)
downloadbcm5719-llvm-b7c374500607486d56ae16195b57ea737fa2e5a5.tar.gz
bcm5719-llvm-b7c374500607486d56ae16195b57ea737fa2e5a5.zip
Fix compile error with libstdc++.
By adding a ctor to create fuzzer_allocator<T> from fuzzer_allocator<U>. This mimics construcotrs of std::allocator<T>. Without the constructors, some versions of libstdc++ can't compile `vector<bool, fuzzer_allocator<bool>>`. llvm-svn: 334077
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerDefs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerDefs.h b/compiler-rt/lib/fuzzer/FuzzerDefs.h
index dde1b4b83f9..4868bc2d3ea 100644
--- a/compiler-rt/lib/fuzzer/FuzzerDefs.h
+++ b/compiler-rt/lib/fuzzer/FuzzerDefs.h
@@ -155,6 +155,11 @@ extern ExternalFunctions *EF;
template<typename T>
class fuzzer_allocator: public std::allocator<T> {
public:
+ fuzzer_allocator() = default;
+
+ template<class U>
+ fuzzer_allocator(const fuzzer_allocator<U>&) {}
+
template<class Other>
struct rebind { typedef fuzzer_allocator<Other> other; };
};
OpenPOWER on IntegriCloud