Commit Graph

7 Commits

Author SHA1 Message Date
Casey Carter
08242cbd9b [test] Cleanup nullopt_t tests
* Update specification text from N4387

* Delete not_brace_initializable.fail.cpp: it's redundant with nullopt_t.fail.cpp

* is_empty<T> implies is_class<T>

* is_literal is deprecated; directly verify that we can create a nullopt_t in a constexpr context

Differential Revision: D37024

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@312256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-08-31 17:56:31 +00:00
Stephan T. Lavavej
a686caad20 [libcxx] [test] Untabify, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@309464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:55:10 +00:00
Stephan T. Lavavej
fdbd18ff71 [libcxx] [test] Strip trailing whitespace.
No functional change, no code review.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294161 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 22:48:27 +00:00
Marshall Clow
a5f53d0730 Mark LWG2736 as complete. No code changes, but we have more tests now
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@292958 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 18:03:32 +00:00
Eric Fiselier
35ce4859dd 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283980 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 07:46:20 +00:00
Eric Fiselier
ead5d404cc Revert Add <optional>. Will recommit with better commit message
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283978 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 06:48:31 +00:00
Eric Fiselier
fbc80168bb Add <optional> header.
This patch is largely thanks to Casey Carter @ Microsoft. He did the initial
work of porting our experimental implementation and tests over to namespace
std.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@283977 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-12 06:45:11 +00:00