<div dir="ltr">I reverted the static_assert and went back to the MSVC only check for now.  I believe the static_assert holds, but isPodLike can't be correctly implemented everywhere so it's failing.</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Dec 14, 2017 at 11:59 AM Hans Wennborg <<a href="mailto:hans@chromium.org">hans@chromium.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">The static_assert doesn't hold in Chromium's Linux build:<br>
<br>
<a href="https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.clang%2FToTLinuxThinLTO%2F933%2F%2B%2Frecipes%2Fsteps%2Fgclient_runhooks%2F0%2Fstdout" rel="noreferrer" target="_blank">https://logs.chromium.org/v/?s=chromium%2Fbb%2Fchromium.clang%2FToTLinuxThinLTO%2F933%2F%2B%2Frecipes%2Fsteps%2Fgclient_runhooks%2F0%2Fstdout</a><br>
<br>
Looks like some LLVM bots are sad too, e.g.<br>
<a href="http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/12386/steps/build%20stage%201/logs/stdio" rel="noreferrer" target="_blank">http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/12386/steps/build%20stage%201/logs/stdio</a><br>
<br>
On Thu, Dec 14, 2017 at 11:41 AM, Zachary Turner via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: zturner<br>
> Date: Thu Dec 14 11:41:28 2017<br>
> New Revision: 320737<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=320737&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=320737&view=rev</a><br>
> Log:<br>
> Fix isPodLike for MSVC and use it in TypeHashing.<br>
><br>
> This should be a better check than using is_trivially_copyable<br>
> behind an #ifdef _MSC_VER.<br>
><br>
> Modified:<br>
>     llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h<br>
>     llvm/trunk/include/llvm/Support/type_traits.h<br>
><br>
> Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h?rev=320737&r1=320736&r2=320737&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h?rev=320737&r1=320736&r2=320737&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h (original)<br>
> +++ llvm/trunk/include/llvm/DebugInfo/CodeView/TypeHashing.h Thu Dec 14 11:41:28 2017<br>
> @@ -132,15 +132,10 @@ struct GloballyHashedType {<br>
>      return Hashes;<br>
>    }<br>
>  };<br>
> -#if defined(_MSC_VER)<br>
> -// is_trivially_copyable is not available in older versions of libc++, but it is<br>
> -// available in all supported versions of MSVC, so at least this gives us some<br>
> -// coverage.<br>
> -static_assert(std::is_trivially_copyable<GloballyHashedType>::value,<br>
> +static_assert(isPodLike<GloballyHashedType>::value,<br>
>                "GloballyHashedType must be trivially copyable so that we can "<br>
>                "reinterpret_cast arrays of hash data to arrays of "<br>
>                "GloballyHashedType");<br>
> -#endif<br>
>  } // namespace codeview<br>
><br>
>  template <> struct DenseMapInfo<codeview::LocallyHashedType> {<br>
><br>
> Modified: llvm/trunk/include/llvm/Support/type_traits.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/type_traits.h?rev=320737&r1=320736&r2=320737&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/type_traits.h?rev=320737&r1=320736&r2=320737&view=diff</a><br>
> ==============================================================================<br>
> --- llvm/trunk/include/llvm/Support/type_traits.h (original)<br>
> +++ llvm/trunk/include/llvm/Support/type_traits.h Thu Dec 14 11:41:28 2017<br>
> @@ -30,9 +30,9 @@ namespace llvm {<br>
>  template <typename T><br>
>  struct isPodLike {<br>
>    // std::is_trivially_copyable is available in libc++ with clang, libstdc++<br>
> -  // that comes with GCC 5.<br>
> +  // that comes with GCC 5, and MSVC.<br>
>  #if (__has_feature(is_trivially_copyable) && defined(_LIBCPP_VERSION)) ||      \<br>
> -    (defined(__GNUC__) && __GNUC__ >= 5)<br>
> +    (defined(__GNUC__) && __GNUC__ >= 5) || defined(_MSC_VER)<br>
>    // If the compiler supports the is_trivially_copyable trait use it, as it<br>
>    // matches the definition of isPodLike closely.<br>
>    static const bool value = std::is_trivially_copyable<T>::value;<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>