[compiler-rt] r334077 - Fix compile error with libstdc++.

Ilya Biryukov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 02:22:20 PDT 2018


Author: ibiryukov
Date: Wed Jun  6 02:22:19 2018
New Revision: 334077

URL: http://llvm.org/viewvc/llvm-project?rev=334077&view=rev
Log:
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>>`.

Modified:
    compiler-rt/trunk/lib/fuzzer/FuzzerDefs.h

Modified: compiler-rt/trunk/lib/fuzzer/FuzzerDefs.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerDefs.h?rev=334077&r1=334076&r2=334077&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerDefs.h (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerDefs.h Wed Jun  6 02:22:19 2018
@@ -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;  };
   };




More information about the llvm-commits mailing list