[PATCH] D93510: Fix llvm::Optional build breaks in MSVC using std::is_trivially_copyable

Tatyana Krasnukha via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 04:57:36 PST 2021


tatyana-krasnukha added a comment.

In D93510#2499262 <https://reviews.llvm.org/D93510#2499262>, @jplayer-nv wrote:

> I just triaged the gcc 5.4 build break.  It appears that `std::is_trivially_copy_constructible<T>` instantiates the copy constructor (which is... strange).  So we can't query a compile-time property without the compiler forcing instantiation of the deleted copy constructor in this case.
>
> This bug exists all the way up through gcc 7.3.  Here's a godbolt link which reproduces the problem:
> https://godbolt.org/z/ETW7f1

GCC 7.3 produces the same error for  `std::is_trivially_move_constructible<T>`  if T is not trivially constructible because of having a virtual destructor. Just add `virtual ~URIDistance() = default;`  to your godbolt example to reproduce.
This issue breaks LLDB unit tests build (Utility/ReproducerInstrumentationTest.cpp).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D93510/new/

https://reviews.llvm.org/D93510



More information about the llvm-commits mailing list