Commit Graph

2069 Commits

Author SHA1 Message Date
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
Ed Schouten
7c1ebcf6fd 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241455 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 15:39:36 +00:00
Ed Schouten
9e97eb890c 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


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241454 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-06 15:37:40 +00:00
Marshall Clow
b81d6f5b8d Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241190 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 21:23:40 +00:00
Marshall Clow
5a426e50d0 Mark N4508, LWG#2407, and LWG#2470 as complete. I don't see that 2470 requires any changes to the library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241111 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 20:06:00 +00:00
Marshall Clow
5706c375d5 K-ballo pointed out that I missed one of the specializations of packaged_task when I committed r241068. Thanks for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241095 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:28:35 +00:00
Marshall Clow
933bf68f0a Forgot the support include file in r241091
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241092 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:16:12 +00:00
Marshall Clow
58113db00c Add tests for LWG#2299. While doing so, I noticed that the tests we have for the transparent comparators don't actually call them. Fix those tests, too. Now one of them is failing, due to a missing const in <map>. Add that (twice). Next step is to do the same for <unordered_map>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241091 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 18:15:41 +00:00
Marshall Clow
07546f3b93 Implement LWG#2407: 'packaged_task(allocator_arg_t, const Allocator&, F&&) should neither be constrained nor explicit'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241068 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 14:16:49 +00:00
Marshall Clow
abadb458d0 Implement N4508: shared_mutex. Reviewed as http://reviews.llvm.org/D10480
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241067 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 14:04:14 +00:00
Marshall Clow
f3c8fb22ec Mark LWG#2266 as complete. This is a tightening up the wording; no code changes required.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241064 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-30 13:32:08 +00:00
Marshall Clow
715339ab55 Mark LWG#2439 as complete. This is a tightening up the wording; no code changes required.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@241013 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-29 22:27:30 +00:00
Ed Schouten
323ade3e70 Make support for thread-unsafe C functions optional.
One of the aspects of CloudABI is that it aims to help you write code
that is thread-safe out of the box. This is very important if you want
to write libraries that are easy to reuse. For CloudABI we decided to
not provide the thread-unsafe functions. So far this is working out
pretty well, as thread-unsafety issues are detected really early on.

The following patch adds a knob to libc++,
_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable
thread-unsafe functions that can easily be avoided in practice. The
following functions are not thread-safe:

- <clocale>: locale handles should be preferred over setlocale().
- <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over
  their non-restartable counterparts.
- <ctime>: asctime(), ctime(), gmtime() and localtime() are not
  thread-safe. The first two are also deprecated by POSIX.

Differential Revision:	http://reviews.llvm.org/D8703
Reviewed by:	marshall


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-24 08:44:38 +00:00
Marshall Clow
4428584a88 Mark a couple of features as 'in progress'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 20:48:55 +00:00
Marshall Clow
8c42c8cb46 When building libc++, we use '"' as a delimiter instead of '<' when including libc++ header files. This is so that the dylib gets built with our headers; rather than the system-installed ones. We do this in most places already, just fixing a couple of inconsistent uses.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240412 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 14:45:02 +00:00
Marshall Clow
1224e8972b Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240286 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-22 15:01:21 +00:00
Marshall Clow
46d06b90c1 Fix illegal chars that snuck into <memory>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240163 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 19:32:06 +00:00
Marshall Clow
cb126215aa Fix ASAN bot; missing bookkeeping in r240136.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240139 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 17:13:59 +00:00
Marshall Clow
c41133728d Fix PR#18843. Thanks to Howard for the fix
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@240136 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-19 15:54:13 +00:00
Jonathan Roelofs
3d08766099 Delete dead code. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239974 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-17 23:31:45 +00:00
Eric Fiselier
b05f0599c0 Fix std::function allocator constructors in C++03.
The C++03 version of function tried to default construct the allocator
in the uses allocator constructors when no allocation was performed. These
constructors would fail to compile when used with allocators that had no
default constructor.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239708 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-14 23:30:09 +00:00
Eric Fiselier
4983580dc5 Cleanup result_of tests and fix issues with the C++03 result_of.
The two main fixes this patch contains are:
- use __identity_t instead of common_type. common_type was used as an
  identity metafunction but the decay resulted in incorrect results.
- Pointers to free functions were not counted as functions. Remove the pointer
  before checking if a type is a function.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239668 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 08:25:24 +00:00
Eric Fiselier
6f08111102 Remove warnings about old CMake options
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239667 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 07:31:55 +00:00
Eric Fiselier
fdae69aa13 Fix PR12999 - unordered_set::insert calls operator new when no insert occurs
Summary:
when `unordered_set::insert(value_type&&)` was called it would be treated like `unordered_set::emplace(Args&&)` and it would allocate and construct a node before trying to insert it.
This caused unnecessary allocations when the value was already in the set. This patch adds an overload to `__hash_table::__insert_unique` that specifically handles `value_type&&` more link `value_type const &`. 

This patch also adds a single unified insert function for values into  `__hash_table` called `__insert_unique_value` that handles the cases for `__insert_unique(value_type&&)` and `__insert_unique(value_type const &)`. 

This patch fixes PR12999: http://llvm.org/bugs/show_bug.cgi?id=12999.




Reviewers: mclow.lists, titus, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239666 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 07:18:32 +00:00