Commit Graph

2119 Commits

Author SHA1 Message Date
Marshall Clow
af961ed8cf implement more of N4258 - Cleaning up noexcept in the standard library. Specifically add new noexcept stuff to vector and string's move-assignment operations
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-18 18:57:00 +00:00
Marshall Clow
fc93ce7349 Make regex and any assert when they should throw an exception _but_ the user has decreed 'no exceptions'. This matches the behavior of string and vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245239 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-17 21:14:16 +00:00
Eric Fiselier
1efadf976d Fix CMake error whet llvm-config reports a non-existent source directory.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@244717 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-12 06:36:19 +00:00
Joerg Sonnenberger
ba865ff66b Protect template argument from user interference.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@244462 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-10 16:58:04 +00:00
Marshall Clow
bed1d91bf2 Update some links so that they don't point at the (private) WG21 Wiki
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@244047 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 14:36:42 +00:00
Tanya Lattner
d08dbfc12e Update references to lists.llvm.org
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@244003 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-05 03:59:14 +00:00
Marshall Clow
9a3c689b8a Change char_traits<char16_t>::eof() to return 0xFFFF instead of 0xDFFF. Fixes PR#24342
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243937 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-04 01:38:34 +00:00
Eric Fiselier
c0e7971986 Remove -Werror when using check_cxx_compiler_flag because it was causing compiler-rt breakages.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243784 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 21:09:38 +00:00
Eric Fiselier
6a85d5c674 Print message when configuring for standalone build.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243737 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 06:08:32 +00:00
Eric Fiselier
fe5102c83e Fix failing unique_ptr tests.
When I was refactoring the unique_ptr.single.ctor tests I added a test
deleter, 'NCDeleter', to deleter.h. Other tests that include deleter.h
redefine the NCDeleter type causing test failures.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243733 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 04:34:25 +00:00
Eric Fiselier
76581dc450 Start cleanup of unique_ptr tests.
One of the last sections of tests that still fail in C++03 are the unique_ptr
tests. This patch begins cleaning up the tests and fixing C++03 failures.

The main changes of this patch:
  - The "Deleter" type in "deleter.h" tried to be "move-only" in C++03. However
    the move simulation no longer works (see "__rv"). "Deleter" is now copy
    constructible in C++03. However copying "Deleter" will "move" the test value
    instead of copying it.

  - Reduce the unique.ptr.single.ctor tests files from ~25 to 4. There is no
    reason the tests were split through so many files.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243730 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 02:43:52 +00:00
Eric Fiselier
65a1d45c0a Mark any as done and comment out extra methods until speaking to Marshall
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243729 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 02:29:11 +00:00
Eric Fiselier
7175a07921 [libcxx] Add <experimental/any> v2.
Summary:
This patch adds the second revision of <experimental/any>. 
I've been working from the LFTS draft found at this link. https://rawgit.com/cplusplus/fundamentals-ts/v1/fundamentals-ts.html#any



Reviewers: danalbert, jroelofs, K-ballo, mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D6762

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243728 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 02:24:58 +00:00
Eric Fiselier
26d2390a8d Add -Wno-error by default to work around failing compiler-rt builds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243725 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-31 01:25:01 +00:00
Eric Fiselier
eb6e2eac6c Reapply working parts of CMake cleanup.
This patch adds the working parts of r243503. The difference with this patch
is that it doesn't include the HandleLLVMOptions.cmake file.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243698 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 22:30:34 +00:00
Marshall Clow
0934c750ed Fix PR#24267. use numeric_limits::max instead of ~0 for 'all ones', since that might give wrong answers on a 1's complement machine.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 18:26:34 +00:00
Marshall Clow
36dc080bf6 Change some #ifdefs to #if - thanks to Dexon for thge catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243641 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-30 13:56:00 +00:00
Eric Fiselier
5514d36c43 Revert recent CMake changes again due to failing compiler-rt builds
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243593 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 23:46:55 +00:00
Eric Fiselier
8b93263784 Attempt to fix build issues introduced by
r243574

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243591 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 23:23:18 +00:00
Nick Lewycky
e1be30b7e1 Fix typo in unused variable name.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243586 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 22:38:23 +00:00
Eric Fiselier
d74dee9255 Recommit r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
This change was reverted in r243550 because it broke clang-format builds
(see PR24306).

This patch recommits a fixed version of the original.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243574 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 21:07:28 +00:00
Hans Wennborg
aa9b5e37f7 Revert r243503 "[libcxx] Cleanup CMake configuration and integrate with LLVM"
This caused clang-format to stop linking on Mac; see PR24306.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243550 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 18:32:21 +00:00
Marshall Clow
a37957634c Fix a self-move bug in inplace_merge. Thanks to Ted and Dexon for the report and the suggested fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243530 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 16:25:45 +00:00
Eric Fiselier
91eeba8d26 [libcxx] Cleanup CMake configuration and integrate with LLVM
Summary:
This patch contains the following changes:

1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. Cleanup ugly configuration code in CMakeLists.txt by using `add_flags`, `add_flags_if`, and `add_flags_if_supported` macros.

The goals for this patch are:

1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs). 
5. Move towards allowing  libc++ to use other LLVM utilities such as `not` and `FileCheck`.

  

Reviewers: mclow.lists, jroelofs, danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11308

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243503 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-29 00:03:51 +00:00
Eric Fiselier
3baabab827 Remove sanitizer XFAILs on a test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243499 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 23:27:03 +00:00
Marshall Clow
2576c29dab Consolidate a bunch of #ifdef _LIBCPP_NO_EXCEPTIONS .. #endif blocks into a single template function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243415 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 13:30:47 +00:00
Eric Fiselier
dd29a02911 Mark async tests as UNSUPPORTED in C++03 because it requires variadics
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243393 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 07:49:15 +00:00
Eric Fiselier
b47a434d60 Fix a handful of tests that fail in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243392 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 07:31:50 +00:00
Eric Fiselier
bfb46e486d Cleanup C++03 __invoke for Bullets 3 and 4.
The key changes in this patch are:

1. Remove the zero-argument overload in mem_fn. A member function must always
   be invoked with at least one argument, the class instance. The zero-argument
   operator()() in mem_fn would cause mem_fn to fail to compile when because
   the call to '__invoke(pm)' is not well formed.

2. Prevent evaluation of '__apply_cv<Tp, Ret>' when 'Ret' is a function type.
   'Ret' is a function type whenever 'Ret Tp::*' is a pointer to member function.
   Attempting to add cv and ref qualifiers to a function type can cause a hard
   compile error.

3. Remove the dummy overload __invoke(Rp Tp::*). It was present to help work
   around #1. It will be replaced with a different '__invoke' overload that
   represents a bad call to invoke.

After applying this patch the test func.wrap.func.inv/invoke.pass.cpp now
passes.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 02:15:53 +00:00
Eric Fiselier
12ddf2cbd2 Get C++03 __invoke working for bullet 5 of INVOKE.
This patch does a couple of things to get __invoke working for free-functions
and call objects.

1. Turn all uses of declval<Tp>() into declval<Tp&>(). The C++03 __invoke only
   supports lvalues but it will be used when the compiler supports rvalue
   references but not variadic templates. This change makes sure we don't
   generate an rvalue.

2. Call objects for bullet 5 are now passed by reference and not value. Copying
   the functor is incorrect. It will fail to compile for non-copyable functors
   and it will discard cv-qualifiers on the call object, possibly leading to the
   wrong function being called. I suspect that the reason the call object
   was originally taken by value was to support temporary call objects.
   However __invoke is only used internally and it is never given a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243368 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 01:52:08 +00:00
Eric Fiselier
48aa2cf9f3 Checking more __invoke tests.
Before I start trying to fix __invoke in C++03 it needs better test coverage.
This patch adds a large amount of tests for __invoke.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243366 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-28 01:25:36 +00:00
Marshall Clow
568bd0222f Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@243030 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-23 18:27:51 +00:00
Justin Bogner
3a59ae6783 Mark this test as XFAIL with older compilers, since they hit PR18097
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 23:32:57 +00:00
Eric Fiselier
db8c4fd8c7 Merge C++03 and C++11 implementations of mem_fn and __mem_fn.
The implementation of mem_fn doesn't actually require any  C++11 support.
For some reason there were 17 overloads for mem_fn in C++03 when only one
is needed. This patch removes the extra overloads and uses the same implementation
of mem_fn in C++03 and C++11.

__mem_fn does require variadics to implement the call operator. Instead of
having two entirely different implementations of the __mem_fn struct, this patch
uses the same __mem_fn struct but provides different call operators when
variadics are not available.

The only thing left in <__functional_03> is the C++03 implementation of
std::function.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242959 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:43:27 +00:00
Eric Fiselier
5b3a4593da Remove almost everything in <__functional_base_03>
This patch removes a large amount of duplicate code found in both
<__functional_base> and <__functional_base_03>. The only code that remains
in <__functional_base_03> is the C++03 implementation of __invoke and
__invoke_return.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242951 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 22:23:49 +00:00
Eric Fiselier
9962ddfa24 Remove more commented out code. That is what version control is for.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242872 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 04:37:12 +00:00
Eric Fiselier
45f63bc07e Cleanup <__functional_03>
<__functional_03> provides the C++03 definitions for std::memfun and
std::function. However the interaction between <functional> and <__functional_03>
is ugly and duplicates code needlessly. This patch cleans up how the two
headers work together.

The major changes are:

- Provide placeholders, is_bind_expression and is_placeholder in <functional>
  for both C++03 and C++11.

- Provide bad_function_call, function fwd decl,
  __maybe_derive_from_unary_function and __maybe_derive_from_binary_function
  in <functional> for both C++03 and C++11.

- Move the <__functional_03> include to the bottom of <functional>. This makes
  it easier to see how <__functional_03> interacts with <functional>

- Remove a commented out implementation of bind in C++03. It's never going
  to get implemented.

- Mark almost all std::bind tests as unsupported in C++03. std::is_placeholder
  works in C++03 and C++11. std::is_bind_expression is provided in C++03 but
  always returns false.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242870 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 04:14:38 +00:00
Eric Fiselier
7cc7106776 Fix initializer list order in <regex> to be correct
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242864 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 01:29:41 +00:00
Eric Fiselier
938c96ef53 [libcxx] Add support for sanitizers on OS X.
Summary: This patch adds special configuration logic to find the compiler_rt libraries required by sanitizers on OS X. The supported sanitizers are Address and Undefined.

Reviewers: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D11381

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242858 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-22 00:33:36 +00:00
Marshall Clow
40766f70a4 Update the status of the TS'es
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242788 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 14:29:31 +00:00
Marshall Clow
f544330f34 Mark new tests as unsupported before C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242695 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 19:27:47 +00:00
Marshall Clow
bbe4245e63 Implement the default searcher for std::experimental::search.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242682 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 16:39:28 +00:00
Marshall Clow
166dadbcbe Implement the plugin-based version of std::search. There are no searchers yet; those are coming soon.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242679 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-20 15:40:27 +00:00
Eric Fiselier
fd9bbf52cd Fix warnings in unordered_map
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242634 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 03:16:47 +00:00
Eric Fiselier
6af41ab8c2 Fix warnings in forwardlist
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242633 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:38:37 +00:00
Eric Fiselier
18dbed9596 Fix warnings in deque tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242632 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:31:54 +00:00
Eric Fiselier
b0be44f963 Commit file missing from r242629
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242630 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-19 00:11:50 +00:00
Eric Fiselier
02bb4bdb49 Fix warnings in array and assoc containers
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242629 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 23:56:04 +00:00
Eric Fiselier
47c5dae573 Remove unused typedefs in random and regex
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242628 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 22:57:14 +00:00
Eric Fiselier
212714f805 Cleanup warnings in test/std/depr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242627 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 22:51:51 +00:00