Commit Graph

2079 Commits

Author SHA1 Message Date
Marshall Clow 983d178108 Detect and throw on a class of bad regexes that we mistakenly accepted before. Thanks to Trevor Smigiel for the report
llvm-svn: 243030
2015-07-23 18:27:51 +00:00
Justin Bogner 2ea8daaee1 Mark this test as XFAIL with older compilers, since they hit PR18097
llvm-svn: 242967
2015-07-22 23:32:57 +00:00
Eric Fiselier 00f512ebdf 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.

llvm-svn: 242959
2015-07-22 22:43:27 +00:00
Eric Fiselier 48cf128785 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.

llvm-svn: 242951
2015-07-22 22:23:49 +00:00
Eric Fiselier e345173146 Remove more commented out code. That is what version control is for.
llvm-svn: 242872
2015-07-22 04:37:12 +00:00
Eric Fiselier e5407178d6 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.

llvm-svn: 242870
2015-07-22 04:14:38 +00:00
Eric Fiselier b50f8f9ee7 Fix initializer list order in <regex> to be correct
llvm-svn: 242864
2015-07-22 01:29:41 +00:00
Eric Fiselier d1bac4ce57 [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

llvm-svn: 242858
2015-07-22 00:33:36 +00:00
Marshall Clow 20ceef6f65 Update the status of the TS'es
llvm-svn: 242788
2015-07-21 14:29:31 +00:00
Marshall Clow 1aa4567712 Mark new tests as unsupported before C++11
llvm-svn: 242695
2015-07-20 19:27:47 +00:00
Marshall Clow 205c333c99 Implement the default searcher for std::experimental::search.
llvm-svn: 242682
2015-07-20 16:39:28 +00:00
Marshall Clow 81416e492e Implement the plugin-based version of std::search. There are no searchers yet; those are coming soon.
llvm-svn: 242679
2015-07-20 15:40:27 +00:00
Eric Fiselier ca345e0032 Fix warnings in unordered_map
llvm-svn: 242634
2015-07-19 03:16:47 +00:00
Eric Fiselier 3e572598d3 Fix warnings in forwardlist
llvm-svn: 242633
2015-07-19 00:38:37 +00:00
Eric Fiselier c45b673d5d Fix warnings in deque tests
llvm-svn: 242632
2015-07-19 00:31:54 +00:00
Eric Fiselier 80fe6bd142 Commit file missing from r242629
llvm-svn: 242630
2015-07-19 00:11:50 +00:00
Eric Fiselier 2decfad7c5 Fix warnings in array and assoc containers
llvm-svn: 242629
2015-07-18 23:56:04 +00:00
Eric Fiselier 818139da59 Remove unused typedefs in random and regex
llvm-svn: 242628
2015-07-18 22:57:14 +00:00
Eric Fiselier 203f687971 Cleanup warnings in test/std/depr
llvm-svn: 242627
2015-07-18 22:51:51 +00:00
Eric Fiselier 19fa337610 Fix warnings in test/std/algorithms
llvm-svn: 242626
2015-07-18 21:53:16 +00:00
Eric Fiselier b67e689f02 Fix unused variable warnings in atomic tests
llvm-svn: 242625
2015-07-18 21:40:37 +00:00
Eric Fiselier 5fd308971d Fix warnings in test/std/language.support
llvm-svn: 242624
2015-07-18 21:17:16 +00:00
Eric Fiselier 87a82490fc Enable and fix warnings during the build.
Although CMake adds warning flags, they are ignored in the libc++ headers
because the headers '#pragma system header' themselves.

This patch disables the system header pragma when building libc++ and fixes
the warnings that arose.

The warnings fixed were:
1. <memory> - anonymous structs are a GNU extension
2. <functional> - anonymous structs are a GNU extension.
3. <__hash_table> - Embedded preprocessor directives have undefined behavior.
4. <string> - Definition is missing noexcept from declaration.
5. <__std_stream> - Unused variable.

llvm-svn: 242623
2015-07-18 20:40:46 +00:00
Marshall Clow dd2b7a0a0e Fix up typos in a couple of tests; due to agressive short-circuiting, they never failed on clang or gcc, but MSVC whined. Patch by Andrew Parker.
llvm-svn: 242618
2015-07-18 18:24:15 +00:00
Eric Fiselier 980eda3fc2 Add missing instrumentation in vector::insert - Patch from Anna Zaks
This patch was reviewed as D10859. http://reviews.llvm.org/D10859

llvm-svn: 242617
2015-07-18 18:22:12 +00:00
Eric Fiselier 083abfb3f6 [libcxx] Get is_*_destructible tests passing in C++03.
Summary: This patch adds proper guards to the is_destructible tests depending on the standard version so that they pass in c++03.

Reviewers: mclow.lists, EricWF

Subscribers: cfe-commits

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

llvm-svn: 242612
2015-07-18 16:43:58 +00:00
Eric Fiselier 88558e22b0 Cleanup tests that fail in C++1z and with Clang 3.8
llvm-svn: 242581
2015-07-17 22:27:43 +00:00
Marshall Clow 34389c8d78 Bump libc++ version # to 3.8
llvm-svn: 242541
2015-07-17 16:36:44 +00:00
Marshall Clow 9c9b0ec554 Include what we use, instead of letting them get pulled in implictly. This makes the tests work on VS. Thanks to STL for the report
llvm-svn: 242454
2015-07-16 22:13:26 +00:00
Marshall Clow f6a14fb4e2 Set the libc++ version # to 3.7. Will bump to 3.8 soon
llvm-svn: 242421
2015-07-16 17:22:24 +00:00
Marshall Clow 05fc0f25d6 Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
llvm-svn: 242377
2015-07-16 03:05:06 +00:00
Marshall Clow 5cbce174d9 Mark two tests as failing on clang 3.8 (they failed on 3.7, too)
llvm-svn: 242375
2015-07-16 02:44:33 +00:00
Eric Fiselier 16270a0b09 Remove non-ascii characters
llvm-svn: 242197
2015-07-14 20:45:48 +00:00
Eric Fiselier 5be45129a4 Implement n4169 - Add invoke function template
llvm-svn: 242195
2015-07-14 20:16:15 +00:00
Marshall Clow f69606b117 Mark LWG2308 as complete; fix link. No code change necessary.
llvm-svn: 242189
2015-07-14 20:07:45 +00:00
Eric Fiselier 092c475e25 Fix PR24114 - std::atomic for non-Clang is not a literal type
Add _LIBCPP_CONSTEXPR to the implementation of __gcc_atomic_t.

llvm-svn: 242172
2015-07-14 17:50:27 +00:00
Marshall Clow 71ff7c3f0f Move bits from N4258. Mark vector's move-constructor unconditionally noexcept in C++1z
llvm-svn: 242148
2015-07-14 14:46:32 +00:00
Marshall Clow e3fbe1433b Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates.
llvm-svn: 242056
2015-07-13 20:04:56 +00:00
Eric Fiselier 2d15f15f28 [libcxx] LWG2420 bits for bind<void> - Patch from K-Ballo
Implemented LWG2420 bits for bind<void>

Review: http://reviews.llvm.org/D10997
llvm-svn: 241967
2015-07-10 23:29:18 +00:00
Eric Fiselier e825d8b736 Use __is_identifier to detect __decltype and not the clang version.
llvm-svn: 241939
2015-07-10 20:26:38 +00:00
Eric Fiselier be4e0eb1c2 Fix error string in test suite
llvm-svn: 241757
2015-07-08 23:10:20 +00:00
Marshall Clow bc4c89a977 The rest of N4279 and LWG#2464 - for unordered_map
llvm-svn: 241555
2015-07-07 05:45:35 +00:00
Marshall Clow 8aaf517db7 Implement N4279 and LWG#2664 for <map>. Reviewed as http://reviews.llvm.org/D10669
llvm-svn: 241539
2015-07-07 03:37:33 +00:00
Eric Fiselier 1faf289e27 [libcxx] Add atomic_support.h header to src that handles needed atomic operations.
Summary:
In some places in libc++ we need to use the `__atomic_*` builtins. This patch adds a header that provides access to those builtins in a uniform way from within the dylib source.

If the compiler building the dylib does not support these builtins then a warning is issued.

Only relaxed loads are needed within the headers. A singe function to do these relaxed loads has been added to `<memory>`.

This patch applies the new atomic builtins to `__shared_count` and `call_once`.

Reviewers: mclow.lists

Subscribers: majnemer, jroelofs, cfe-commits

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

llvm-svn: 241532
2015-07-07 00:27:16 +00:00
Eric Fiselier 4cd59b3f49 Automatically detect and use clang verify in failure tests.
Automatically enable clang verify whenever the '-verify-ignore-unexpected' flag
is supported.
Failure tests are run using verify if they contain one or more "expected-*"
diagnostics tags. Otherwise they are run normally.

llvm-svn: 241492
2015-07-06 19:56:45 +00:00
Marshall Clow 3505fba35a Mark LWG#2420 as complete. Eric did this in r228705.
llvm-svn: 241491
2015-07-06 19:36:44 +00:00
Ed Schouten 2a80cab90e Make locale code compile on CloudABI.
After r241454 landed, libc++'s locale code compiles on CloudABI, with
the exception of the following two bits:

- CloudABI doesn't have setlocale(), as the C library does not keep
  track of any global state. The global locale is always set to "C".
  Disable the call to setlocale() on this system.
- Similarly, mbtowc_l() is also not present, as it is also not
  thread-safe. As CloudABI does not support state-dependent encodings,
  simply disable that part of the logic.

The locale code now compiles out of the box on CloudABI.

Differential Revision:	http://reviews.llvm.org/D10729
Reviewed by:	jroelofs

llvm-svn: 241455
2015-07-06 15:39:36 +00:00
Ed Schouten 2a7ab629e5 Cleanup: prefer _LIBCPP_GET_C_LOCALE over __cloc().
The __cloc() function is only present in case the environment does not
provide a way to refer to the C locale using a compile-time constant
expression. _LIBCPP_GET_C_LOCALE seems to be defined unconditionally.

This improves compilation of the locale code on CloudABI.

Differential Revision:	http://reviews.llvm.org/D10690
Reviewed by:	jroelofs

llvm-svn: 241454
2015-07-06 15:37:40 +00:00
Marshall Clow f43a42d53e Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.
llvm-svn: 241190
2015-07-01 21:23:40 +00:00
Marshall Clow b138ae7cac Mark N4508, LWG#2407, and LWG#2470 as complete. I don't see that 2470 requires any changes to the library.
llvm-svn: 241111
2015-06-30 20:06:00 +00:00