Commit Graph

4099 Commits

Author SHA1 Message Date
Eric Fiselier
6b17a7ba2c Cleanup _LIBCPP_HAS_NO_<c++11-feature> in algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300625 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 23:26:47 +00:00
Eric Fiselier
82810a6cef Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros for std::initializer_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300623 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 23:09:36 +00:00
Eric Fiselier
690d999934 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in thread.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300622 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 23:05:08 +00:00
Eric Fiselier
1ae14a374d 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300620 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 22:50:56 +00:00
Eric Fiselier
6cdc049a90 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::unordered_set and std::unordered_multiset
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300619 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 22:37:32 +00:00
Eric Fiselier
a8d1b917ee Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::queue and std::priority_queue.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300604 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 21:23:18 +00:00
Eric Fiselier
7162dceba5 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macro uses in std::stack.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300602 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 21:16:26 +00:00
Eric Fiselier
ce924dce57 Cleanup _LIBCPP_HAS_NO_<c++11-feature> macros in std::map and std::multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300600 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 21:08:06 +00:00
Eric Fiselier
a3de1e063a Cleanup _LIBCPP_HAS_NO_<c++11-feature> for std::set and std::multiset
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 20:58:03 +00:00
Casey Carter
21d02bea58 [test] Silence another unused-typedef warning
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300581 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 20:04:39 +00:00
Casey Carter
6f448f6943 [test] Silence unused parameter/typedef warnings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 18:44:33 +00:00
Marshall Clow
2f2efbd520 Mark LWG#2788 as complete - we already do this
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300568 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 17:22:49 +00:00
Eric Fiselier
30ea4d0c86 Emit benchmark tests into the benchmarks build directory, not lib/
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 07:40:22 +00:00
Eric Fiselier
688edc78f9 Update google benchmark
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300530 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 07:17:20 +00:00
Billy Robert O'Neal III
937aecfb3d Allow a standard library to implement conditional noexcept for optional and unique_ptr hash functions.
These tests were unconditionally asserting that optional and unique_ptr declare throwing hashes, but MSVC++ implements conditional noexcept forwarding that of the underlying hash function. As a result we were failing these tests but there's nothing forbidding strengthening noexcept in that way.

Changed the ASSERT_NOT_NOEXCEPT asserts to use types which themselves have non-noexcept hash functions.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300516 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 00:19:50 +00:00
Eric Fiselier
55dc5daa60 Work around GCC 4.9 bug regarding default initialization of const variables
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300510 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 22:32:02 +00:00
Eric Fiselier
7e698523da Fix passing incorrectly value-category when constructing unique_ptr's deleter
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300489 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 20:20:27 +00:00
Casey Carter
634a2b535f [optional] Update synopsis for LWG2934
(comment-only change)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300488 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 20:15:16 +00:00
Marshall Clow
07d8458932 Sigh. Once again forgot about the 'no exceptions' bots.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 14:18:44 +00:00
Marshall Clow
5e1df5e170 Mark LWG#2853 as complete. No code changes required, but added a couple of extra tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 13:19:14 +00:00
Eric Fiselier
1cbdb0cb0e Cleanup one more <forward_list> test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 04:05:15 +00:00
Eric Fiselier
ed67bb6007 Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <forward_list>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 04:02:01 +00:00
Eric Fiselier
55ff80ecac Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <list>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300414 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 03:45:35 +00:00
Eric Fiselier
48503005c3 Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in deque
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 03:17:01 +00:00
Eric Fiselier
6c26be6c87 Replace _LIBCPP_HAS_NO_<C++03 feature> with _LIBCPP_CXX03_LANG in <array>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300412 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:50:40 +00:00
Eric Fiselier
ffaa304088 Workaround Clang bug regarding template template parameters
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300411 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:47:46 +00:00
Eric Fiselier
ad421ef159 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300410 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:40:45 +00:00
Petr Hosek
cebb3e984f [CMake][libcxx] Fix the --target and --gcc-toolchain flag handling
CMake has the problem with the single dash variant because of the
space, so use the double dash with equal sign version. We also
don't have to pass the target triple when checking for compiler-rt
since that flag is already included in compile flags now.

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300409 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:25:55 +00:00
Eric Fiselier
745a5cd57f Cleanup and better scope unique_ptr internals
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300408 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:14:31 +00:00
Eric Fiselier
e3aef86de2 Cleanup default_delete specializations
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300407 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 02:06:25 +00:00
Eric Fiselier
a4fd0c9d61 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300406 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-16 01:51:04 +00:00
Eric Fiselier
98d9a858da 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300403 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 19:32:02 +00:00
Eric Fiselier
6ad335bfc0 Simplify test helper
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300399 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 12:05:11 +00:00
Eric Fiselier
622c7d5846 Fix PR32642 - string::insert and string::append don't work with move_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 06:49:02 +00:00
Eric Fiselier
9ea4041df8 [libcxx] Fix check-cxx-abilist on OS X
Summary:
Recent commits broke the check-cxx-abilist by changing the default OS X to use `-rexport_library` instead of `-reexport_symbol_list`. Apparently `-reexport_library` doesn't export the symbols into `libc++.dylib`s symbol table, whereas `-reexport_symbol_list` does.

This means the change removed ~500 symbols from the symbol table. I've been told this change is non ABI breaking, but it does make it harder to maintain the ABI lists, and hence the ABI.

This patch fixes the issue by switching back to `-reexport_symbol_list`. It still avoid the issues fixed in r299052 by putting the new/delete symbols in a different symbol list file, which is only exported when LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS in OFF.


Reviewers: mehdi_amini, smeenai, dexonsmith

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 05:41:45 +00:00
Eric Fiselier
81f58e5052 Rewrite and cleanup unique_ptr tests.
This patch almost entirely rewrites the unique_ptr tests. There are a couple
of reasons for this:

A) Most of the *.fail.cpp tests were either incorrect or could be better written
  as a *.pass.cpp test that uses <type_traits> to check if certain operations
  are valid (Ex. Using static_assert(!std::is_copy_constructible_v<T>) instead
  of writing a failure test).

B) [unique.ptr.runtime] has very poor test coverage. Many of the constructors
  and assignment operators have to tests at all. The special members that have
  tests have very few test cases and are typically way out of date.

C) The tests for [unique.ptr.single] and [unique.ptr.runtime] are largely
  duplicates of each other. This means common requirements have two different
  sets of tests in two different test files. This makes the tests harder to
  maintain than if there was a single copy.

To address (A) this patch changes almost all of the *.fail.cpp tests into
.pass.cpp tests using type traits; Allowing the *.fail.cpp tests to be removed.

The address (B) and (C) the tests for [unique.ptr.single] and [unique.ptr.runtime]
have been combined into a single directory, allowing both specializations to share
common tests. Tests specific to the single/runtime specializations are given the
suffix "*.single.pass.cpp" or "*.runtime.pass.cpp".

Finally the unique.ptr test have been moved into the correct directory according
to the standard. Specifically they have been removed from "utilities/memory" into
"utilities/smartptr".

PS. This patch also adds newly written tests for upcoming unique_ptr changes/fixes.
However since these tests don't currently pass they are guarded by the macro
TEST_WORKAROUND_UPCOMING_UNIQUE_PTR_CHANGES. This allows other STL's to validate
the tests before libc++ implements the changes. The relevant libc++ changes should
land in the next week.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300388 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 05:28:06 +00:00
Eric Fiselier
dfac40a8fc Make clang-format use C++03 syntax
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300387 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-15 02:45:43 +00:00
Petr Hosek
82a50d6474 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300261 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 21:29:21 +00:00
Shoaib Meenai
e1c9dfba1a [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 20:13:32 +00:00
Marshall Clow
059256914c Remove the binders from C++17. Reviewed as https://reviews.llvm.org/D31769
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300232 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 18:25:32 +00:00
Marshall Clow
6403571b40 Implement LWG#2855 - made easy by previous refactoring
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300218 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 16:57:42 +00:00
Shoaib Meenai
b975b451af [libc++] Explicitly set output directory for DLL
DLLs on Windows are treated as runtime targets. Explicitly set the
output directory for them, to be consistent with other platforms.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 16:27:38 +00:00
Marshall Clow
9ac5bc5596 Refactor throw_with_nested. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300197 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 14:41:45 +00:00
Eric Fiselier
d3b3b1f4a1 Add TEST_NOEXCEPT_FALSE to support D31738
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300191 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 10:17:23 +00:00
Eric Fiselier
0301092a7b Cleanup any_cast failure test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300175 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 05:27:55 +00:00
Eric Fiselier
e4b267b262 Fix template >> within C++03 code
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300165 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 02:56:03 +00:00
Eric Fiselier
706e2c7374 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300164 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 02:54:13 +00:00
Eric Fiselier
dd5982633c Fix C++03 test failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300159 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 01:13:58 +00:00
Eric Fiselier
0cb22a2fb4 Add tests that std::unique_ptr's default constructor is constexpr.
std::unique_ptr's default constructor must be constexpr in order
to allow constant initialization to take place for static objects;
Even though we can never have a constexpr unique_ptr variable since
it's not a literal type.

This patch adds tests that constant initialization takes place by
using the __attribute__((require_constant_initialization)) macro.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300158 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 01:11:58 +00:00
Eric Fiselier
3b7f79609f Update tests -verify error messages after r300140.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300156 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 01:03:41 +00:00