Commit Graph

1872 Commits

Author SHA1 Message Date
Eric Fiselier 6ded58e279 Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <exception>
llvm-svn: 300649
2017-04-19 01:35:58 +00:00
Eric Fiselier 046492b932 Cleanup usages of _LIBCPP_HAS_NO_<c++11-feature> in <bitset>, <ios>, <locale>, and <iterator>
llvm-svn: 300648
2017-04-19 01:34:08 +00:00
Eric Fiselier 7e23afcb60 Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in the functional library
llvm-svn: 300646
2017-04-19 01:28:47 +00:00
Eric Fiselier 2987087182 Cleanup remaining usages of _LIBCPP_HAS_NO_<c++11-feature> in tuple and utility
llvm-svn: 300644
2017-04-19 01:23:39 +00:00
Eric Fiselier afa7a957bd Cleanup remaining _LIBCPP_HAS_NO_<c++11-feature> usages in container headers
llvm-svn: 300643
2017-04-19 01:23:04 +00:00
Eric Fiselier 414d17c67c Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the string library.
llvm-svn: 300633
2017-04-19 00:28:44 +00:00
Eric Fiselier 69154d6e07 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in the numeric tests and headers
llvm-svn: 300632
2017-04-19 00:23:45 +00:00
Eric Fiselier 9f7cc58f81 Cleanup _LIBCPP_HAS_NO_<c++11-features> macro usage in regex
llvm-svn: 300627
2017-04-18 23:42:15 +00:00
Eric Fiselier f0aca21e09 Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library
llvm-svn: 300626
2017-04-18 23:38:41 +00:00
Eric Fiselier ddda456a76 Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
llvm-svn: 300625
2017-04-18 23:26:47 +00:00
Eric Fiselier 94b2bde631 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list
llvm-svn: 300623
2017-04-18 23:09:36 +00:00
Eric Fiselier e11fb13b60 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.
llvm-svn: 300622
2017-04-18 23:05:08 +00:00
Eric Fiselier 6a470bcb6d Cleanup _LIBCPP_HAS_NO_<c++11-feature> in std::unordered_map and std::unordered_multimap
This completes the cleanup of the containers, at least within the tests.

llvm-svn: 300620
2017-04-18 22:50:56 +00:00
Eric Fiselier f0f86ef96f Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordered_multiset
llvm-svn: 300619
2017-04-18 22:37:32 +00:00
Eric Fiselier f5427b26d3 Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.
llvm-svn: 300604
2017-04-18 21:23:18 +00:00
Eric Fiselier 7196ee3175 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.
llvm-svn: 300602
2017-04-18 21:16:26 +00:00
Eric Fiselier 1829311665 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap
llvm-svn: 300600
2017-04-18 21:08:06 +00:00
Eric Fiselier 922940b627 Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset
llvm-svn: 300595
2017-04-18 20:58:03 +00:00
Eric Fiselier 8948264ed7 Work around GCC 4.9 bug regarding default initialization of const variables
llvm-svn: 300510
2017-04-17 22:32:02 +00:00
Eric Fiselier 86321b2bc8 Fix passing incorrectly value-category when constructing unique_ptr's deleter
llvm-svn: 300489
2017-04-17 20:20:27 +00:00
Casey Carter e3bdfe639c [optional] Update synopsis for LWG2934
(comment-only change)

llvm-svn: 300488
2017-04-17 20:15:16 +00:00
Eric Fiselier 99f2c00199 Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>
llvm-svn: 300415
2017-04-16 04:02:01 +00:00
Eric Fiselier cf9ed00dfa Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>
llvm-svn: 300414
2017-04-16 03:45:35 +00:00
Eric Fiselier a9d646a08b Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in deque
llvm-svn: 300413
2017-04-16 03:17:01 +00:00
Eric Fiselier 208156e88b Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>
llvm-svn: 300412
2017-04-16 02:50:40 +00:00
Eric Fiselier 843d910103 Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in vector.
This patch cleans up all usages of the following feature test macros inside
<vector> and its tests:

* _LIBCPP_HAS_NO_RVALUE_REFERENCES
* _LIBCPP_HAS_NO_VARIADICS
* _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS

Where needed the above guards were replaced with _LIBCPP_CXX03_LANG.

llvm-svn: 300410
2017-04-16 02:40:45 +00:00
Eric Fiselier 92e61e93ff Cleanup and better scope unique_ptr internals
llvm-svn: 300408
2017-04-16 02:14:31 +00:00
Eric Fiselier 030d19bd1a Cleanup default_delete specializations
llvm-svn: 300407
2017-04-16 02:06:25 +00:00
Eric Fiselier 4727272254 Overhaul unique_ptr - Implement LWG 2801, 2905, 2520.
This patch overhauls both specializations of unique_ptr while implementing
the following LWG issues:

* LWG 2801 - This issue constrains unique_ptr's constructors when the deleter type
  is not default constructible. Additionally it adds SFINAE conditions
  to unique_ptr<T[]>::unique_ptr(Up).

* LWG 2905 - This issue reworks the unique_ptr(pointer, /* see below */ deleter)
  constructors so that they correctly SFINAE when the deleter argument cannot
  be used to construct the stored deleter.

* LWG 2520 - This issue fixes initializing unique_ptr<T[]> from nullptr.
  Libc++ had previously implemented this issue, but the suggested resolution
  still broke initialization from NULL. This patch re-works the
  unique_ptr<T[]>(Up, deleter) overloads so that they accept NULL as well
  as nullptr.

llvm-svn: 300406
2017-04-16 01:51:04 +00:00
Eric Fiselier 2551475596 Implement LWG 2857 for variant. Tests from Casey Carter @ Microsoft.
Also mark LWG 2857 as complete, since the changes to optional and
any were completed by Marshall earlier.

llvm-svn: 300403
2017-04-15 19:32:02 +00:00
Eric Fiselier e84fcb5f3d Fix PR32642 - string::insert and string::append don't work with move_iterator.
llvm-svn: 300397
2017-04-15 06:49:02 +00:00
Petr Hosek d0e9481c55 [libcxx] Direct support for Fuchsia
Fuchsia's libc was forked from musl, but has evolved sufficiently
since then so it no longer makes sense to pretend it's musl. This
change implements direct support for Fuchsia rather than
piggybacking on musl support.

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

llvm-svn: 300261
2017-04-13 21:29:21 +00:00
Shoaib Meenai 461764de0d [libc++] Add _LIBCPP_DISABLE_EXTERN_TEMPLATE config option
When the libc++ extern template macros were added, the intent was for it
to be possible for consumers of the headers to disable extern templates
(via `-D_LIBCPP_EXTERN_TEMPLATE(...)=`). Unfortunately, support for
specifying function-like macros varies on the command line varies across
compilers (e.g. MSVC doesn't support it at all), and cmake doesn't allow
it for the same reason. Add a non-function macro for this purpose.

The intended use is for libraries which want to use the libc++ headers
without taking a dependency on the libc++ library itself. I can name the
macro something which reflects its intent rather than its behavior (e.g.
`_LIBCPP_HEADER_ONLY`) if desired.

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

llvm-svn: 300246
2017-04-13 20:13:32 +00:00
Marshall Clow 7d210c787e Remove the binders from C++17. Reviewed as https://reviews.llvm.org/D31769
llvm-svn: 300232
2017-04-13 18:25:32 +00:00
Marshall Clow 5948e39297 Implement LWG#2855 - made easy by previous refactoring
llvm-svn: 300218
2017-04-13 16:57:42 +00:00
Marshall Clow e9ca2bb8ab Refactor throw_with_nested. NFC.
llvm-svn: 300197
2017-04-13 14:41:45 +00:00
Eric Fiselier e02ed1c255 Diagnose when reverse_iterator is used on path::iterator.
path::iterator isn't a strictly conforming iterator. Specifically
it stashes the current element inside the iterator. This leads to
UB when used with reverse_iterator since it requires the element
to outlive the lifetime of the iterator.

This patch adds a static_assert inside reverse_iterator to disallow
"stashing iterator types", and it tags path::iterator as such a type.

Additionally this patch removes all uses of reverse_iterator<path::iterator>
within the tests.

llvm-svn: 300164
2017-04-13 02:54:13 +00:00
Eric Fiselier b411e9ce4d Fix C++03 test failures
llvm-svn: 300159
2017-04-13 01:13:58 +00:00
Eric Fiselier b3f5742551 Fix more bad member swap definitions in unordered_map.
The __unordered_map_equal and __unordered_map_hash wrappers
attempt to swap const qualified predicates whenever the predicate
is empty, and is subject to the EBO.

Swapping const values seems blatently incorrect. This patch removes
the const qualifier so the values are swapped as non-const.

llvm-svn: 300154
2017-04-13 01:02:41 +00:00
Eric Fiselier 4104cf8257 Fix the default constructibility of __compressed_pair.
This patch fixes a bug where the =default default ctor for
__compressed_pair was incorrect for const qualified types.

llvm-svn: 300152
2017-04-13 00:50:45 +00:00
Eric Fiselier e1ec29869b Fix most failures caused by r300140
r300140 introduced a bunch of failures by changing the internal
interface provided by __compressed_pair. This patch fixes all of
the failures caused by the new interface by changing the existing
code to use it.

In addition to those changes this patch also fixes two separate
issues causing test failures:

1) Fix the member swap definition for __map_value_compare. Previously
   the swap was incorrectly configured to swap the comparator as const.

2) Fix an assertion failure in futures.task.members/ctor_func_alloc.pass.cpp
that incorrectly expected a move to take place when a single copy is sufficient.

There is one remaining failure regarding make_shared. I'll commit a fix for that
shortly.

llvm-svn: 300148
2017-04-13 00:34:24 +00:00
Eric Fiselier c88580c400 [libcxx] Fix __compressed_pair so it doesn't copy the argument multiple times, and add constexpr.
Summary:
__compressed_pair takes and passes it's constructor arguments by value. This causes arguments to be moved 3 times instead of once. This patch addresses that issue and fixes `constexpr` on the constructors.

I would rather have this fix than D27564, and I'm fairly confident it's not ABI breaking but I'm not 100% sure.

I prefer this solution because it removes a lot of code and makes the implementation *much* smaller.

Reviewers: mclow.lists, K-ballo

Reviewed By: K-ballo

Subscribers: K-ballo, cfe-commits

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

llvm-svn: 300140
2017-04-12 23:45:53 +00:00
Eric Fiselier da04d79a1f [libc++] Implement LWG 2911 - add an is_aggregate type-trait
Summary:
This patch implements http://cplusplus.github.io/LWG/lwg-defects.html#2911.

I'm putting this up for review until __is_aggregate is added to clang (See D31513)

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

llvm-svn: 300126
2017-04-12 23:08:46 +00:00
Marshall Clow 5c80f4f6a2 Implement part of LWG#2857 - any/optional. Still to do - variant. Reviewed as https://reviews.llvm.org/D31956
llvm-svn: 300123
2017-04-12 22:51:27 +00:00
Eric Fiselier 34e38caa2f Fix incorrectly qualified return type from unique_ptr::get_deleter().
For reference deleter types the const qualifier on the return type
of get_deleter() should be ignored, and a non-const deleter should
be returned.

This patch fixes a bug where "const deleter_type&" is incorrectly
formed.

llvm-svn: 300121
2017-04-12 22:43:49 +00:00
Shoaib Meenai 538b3f4198 [libc++] Use more appropriate conditional for ABI macro definition
The inline function definition ABI macro is gated on COFF dllexport
semantics, so it's more appropriate to mark it with the object file
format macro rather than the generic _WIN32 macro. We now have no uses
of _WIN32 apart from those used to define the other Windows macros :)

Clarify the ABI macro comment and make the object file format check
exhaustive while I'm here.

llvm-svn: 300097
2017-04-12 19:56:37 +00:00
Marshall Clow 36bc71782d Implement LWG#2873: 'Add noexcept to several shared_ptr related functions' This issue missed a couple, so I added those as well (see LWG#2942)
llvm-svn: 299963
2017-04-11 17:08:53 +00:00
Ben Craig 3f5b5fff8a [libc++] Fix unknown pragma warning on MSVC
llvm-svn: 299942
2017-04-11 14:06:39 +00:00
Marshall Clow c2be5ab581 Fix PR#32605: common_type<T> is not SFINAE-friendly
llvm-svn: 299901
2017-04-10 23:47:47 +00:00
Marshall Clow bd5f782868 Fix PR#32606: std::decay mishandles abominable function types
llvm-svn: 299894
2017-04-10 22:51:07 +00:00