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

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 6 10:02:36 PDT 2018


Many thanks!

On Wed, Jun 6, 2018 at 2:26 AM Ilya Biryukov via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> 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;  };
>    };
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180606/7d5af7d2/attachment.html>


More information about the llvm-commits mailing list