Fix compile error with libstdc++.
authorIlya Biryukov <ibiryukov@google.com>
Wed, 6 Jun 2018 09:22:19 +0000 (09:22 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 6 Jun 2018 09:22:19 +0000 (09:22 +0000)
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

compiler-rt/lib/fuzzer/FuzzerDefs.h

index dde1b4b..4868bc2 100644 (file)
@@ -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;  };
   };