OptionalStorage implementation for trivial type, take III
authorSerge Guelton <sguelton@redhat.com>
Fri, 15 Feb 2019 15:17:29 +0000 (15:17 +0000)
committerSerge Guelton <sguelton@redhat.com>
Fri, 15 Feb 2019 15:17:29 +0000 (15:17 +0000)
commitfb4df68f48702377845a471fddcd1f67a3889ae4
tree4b087a3decad0b6b49907075acb88a5ca3f800e3
parent5dfddff2424c836da0aa30225252d350a818468e
OptionalStorage implementation for trivial type, take III

This is another attempt at implementating optional storage
for trivially copyable type, using an union instead of a
raw buffer to hold the actual storage. This make it possible
to get rid of the reinterpret_cast, and hopefully to fix the UB
of the previous attempts.

This validates fine on my laptop for gcc 8.2 and gcc 4.8, I'll
revert if it breaks the validation.

llvm-svn: 354137
llvm/include/llvm/ADT/Optional.h