Go to file
Eric Fiselier a9e659619f Implement N4606 optional
Summary:
Adapt implementation of Library Fundamentals TS optional into an implementation of N4606 optional.

  - Update relational operators per http://wg21.link/P0307
  - Update to requirements of http://wg21.link/P0032
  - Extension: Implement trivial copy/move construction/assignment for `optional<T>` when `T` is trivially copyable.

Audit P/Rs for optional LWG issues:
  - 2756 "C++ WP optional<T> should 'forward' T's implicit conversions" Implemented, which also resolves 2753 "Optional's constructors and assignments need constraints" (modulo my refusal to explicitly delete the move operations, which is a design error that I'm working on correcting in the 2756 P/R).
  - 2736 "nullopt_t insufficiently constrained" Already conforming. I've added a test ensuring that `nullopt_t` is not copy-initializable from an empty braced-init-list, which I believe is the root intent of the issue, to avoid regression.
  - 2740 "constexpr optional<T>::operator->" Already conforming.
  - 2746 "Inconsistency between requirements for emplace between optional and variant" No P/R, but note that the author's '"suggested resolution" is already implemented.
  - 2748 "swappable traits for optionals" Already conforming.
  - 2753 "Optional's constructors and assignments need constraints" Implemented.

Most of the work for this patch was done by Casey Carter @ Microsoft. Thank you Casey!



Reviewers: mclow.lists, CaseyCarter, EricWF

Differential Revision: https://reviews.llvm.org/D22741

llvm-svn: 283980
2016-10-12 07:46:20 +00:00
clang Added REQUIRED triples to the test that fails on some ARM buildbots. 2016-10-12 02:08:08 +00:00
clang-tools-extra [clang-tidy] Ignore empty members and bases in cppcoreguidelines-pro-type-member-init 2016-10-11 14:49:24 +00:00
compiler-rt Fix _recalloc redefinition link error in ASan RTL 2016-10-11 23:13:13 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Provide vstore_half helper to workaround clc restrictions 2016-09-21 20:15:55 +00:00
libcxx Implement N4606 optional 2016-10-12 07:46:20 +00:00
libcxxabi Fix libc++abi test config after recent libc++ changes 2016-10-12 01:19:16 +00:00
libunwind libunwind: Add OpenBSD case for _Unwind_Ptr typedef 2016-09-28 15:37:21 +00:00
lld Fix a test to pacify llvm-clang-lld-x86_64-scei-ps4-windows10pro bot. 2016-10-11 20:15:36 +00:00
lldb Add an arm64 unit test where the function saves x20 in the 2016-10-12 03:53:01 +00:00
llgo [llgo] add llgo source path to LLVM_GO_PACKAGES 2016-07-27 03:01:00 +00:00
llvm Revert "[libFuzzer] refactoring to speed things up, NFC" 2016-10-12 07:26:46 +00:00
openmp Code cleanup for the runtime without monitor thread 2016-10-07 18:12:19 +00:00
parallel-libs [SE] Change CoreTests target name 2016-09-27 15:32:52 +00:00
polly [DepInfo] Print -debug output outside of max-operations scope. 2016-10-10 11:45:59 +00:00