Commit Graph

2242 Commits

Author SHA1 Message Date
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
Eric Fiselier
3a07a2f4f3 Fix warnings in test/std/algorithms
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242626 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:53:16 +00:00
Eric Fiselier
462410703d Fix unused variable warnings in atomic tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:40:37 +00:00
Eric Fiselier
7b86ce5cc4 Fix warnings in test/std/language.support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242624 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 21:17:16 +00:00
Eric Fiselier
692177d022 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242623 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 20:40:46 +00:00
Marshall Clow
0f7221ccb8 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242618 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 18:24:15 +00:00
Eric Fiselier
7d439a455d Add missing instrumentation in vector::insert - Patch from Anna Zaks
This patch was reviewed as D10859. http://reviews.llvm.org/D10859


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242617 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 18:22:12 +00:00
Eric Fiselier
12c6d9cd93 [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242612 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-18 16:43:58 +00:00
Eric Fiselier
3f339e65df Cleanup tests that fail in C++1z and with Clang 3.8
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242581 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 22:27:43 +00:00
Marshall Clow
40853eac80 Bump libc++ version # to 3.8
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242541 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-17 16:36:44 +00:00
Marshall Clow
2af7d42fe3 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
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 22:13:26 +00:00
Marshall Clow
7efdd69688 Set the libc++ version # to 3.7. Will bump to 3.8 soon
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242421 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 17:22:24 +00:00
Marshall Clow
cd6ed54fed Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242377 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 03:05:06 +00:00
Marshall Clow
73f131f210 Mark two tests as failing on clang 3.8 (they failed on 3.7, too)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242375 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-16 02:44:33 +00:00
Eric Fiselier
83de1012a9 Remove non-ascii characters
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242197 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 20:45:48 +00:00
Eric Fiselier
22dff5382a Implement n4169 - Add invoke function template
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242195 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 20:16:15 +00:00
Marshall Clow
92679178a5 Mark LWG2308 as complete; fix link. No code change necessary.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242189 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 20:07:45 +00:00
Eric Fiselier
26edd804ba Fix PR24114 - std::atomic for non-Clang is not a literal type
Add _LIBCPP_CONSTEXPR to the implementation of __gcc_atomic_t.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242172 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 17:50:27 +00:00
Marshall Clow
119ed47999 Move bits from N4258. Mark vector's move-constructor unconditionally noexcept in C++1z
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242148 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-14 14:46:32 +00:00
Marshall Clow
7d914d1bff 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242056 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-13 20:04:56 +00:00
Eric Fiselier
f301a117e1 [libcxx] LWG2420 bits for bind<void> - Patch from K-Ballo
Implemented LWG2420 bits for bind<void>

Review: http://reviews.llvm.org/D10997


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241967 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 23:29:18 +00:00
Eric Fiselier
8f7fe5cd8e Use __is_identifier to detect __decltype and not the clang version.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241939 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-10 20:26:38 +00:00
Eric Fiselier
4f55ef701a Fix error string in test suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241757 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-08 23:10:20 +00:00
Marshall Clow
0ce05a9f86 The rest of N4279 and LWG#2464 - for unordered_map
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241555 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 05:45:35 +00:00
Marshall Clow
f3a1a187a1 Implement N4279 and LWG#2664 for <map>. Reviewed as http://reviews.llvm.org/D10669
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241539 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 03:37:33 +00:00
Eric Fiselier
c6e466911f [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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241532 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-07 00:27:16 +00:00
Eric Fiselier
faaf5ee349 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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241492 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 19:56:45 +00:00
Marshall Clow
0c5dd15e09 Mark LWG#2420 as complete. Eric did this in r228705.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241491 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 19:36:44 +00:00