Recommit Optional specialization for trivially copyable types
authorSerge Guelton <sguelton@redhat.com>
Thu, 14 Feb 2019 19:17:00 +0000 (19:17 +0000)
committerSerge Guelton <sguelton@redhat.com>
Thu, 14 Feb 2019 19:17:00 +0000 (19:17 +0000)
commit4d0934c48f361367edf249f8982e59a90105fb40
tree0e61708992610b3381076a57b7c2f3ae5ffb234c
parent257fcd9b17119455a02f965b95200a286435e942
Recommit Optional specialization for trivially copyable types

Unfortunately the original code gets misscompiled by GCC (at least 8.1),
this is a tentative workaround using std::memcpy instead of inplace new
for trivially copyable types. I'll revert if it breaks.

Original revision: https://reviews.llvm.org/D57097

llvm-svn: 354051
llvm/include/llvm/ADT/Optional.h
llvm/unittests/ADT/OptionalTest.cpp