[llvm] r322862 - [ADT] Just give up on GCC, I can't fix this.

Friedman, Eli via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 14:56:35 PST 2018


On 1/18/2018 8:23 AM, Benjamin Kramer via llvm-commits wrote:
> Modified: llvm/trunk/include/llvm/ADT/Optional.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/Optional.h?rev=322862&r1=322861&r2=322862&view=diff
> ==============================================================================
> --- llvm/trunk/include/llvm/ADT/Optional.h (original)
> +++ llvm/trunk/include/llvm/ADT/Optional.h Thu Jan 18 08:23:40 2018
> @@ -23,7 +23,6 @@
>   #include <algorithm>
>   #include <cassert>
>   #include <new>
> -#include <cstring>
>   #include <utility>
>   
>   namespace llvm {
> @@ -111,6 +110,7 @@ template <typename T, bool IsPodLike> st
>     }
>   };
>   
> +#if !defined(__GNUC__) || defined(__clang__) // GCC up to GCC7 miscompiles this.
>   /// Storage for trivially copyable types only.
>   template <typename T> struct OptionalStorage<T, true> {
>     AlignedCharArrayUnion<T> storage;

Could this cause an ABI problem if you mix code built with clang and gcc?

-Eli

-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project



More information about the llvm-commits mailing list