Commit Graph

2133 Commits

Author SHA1 Message Date
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
Eric Fiselier
3a0e430cd4 [libcxx] Fix detection of __is_final.
Summary: Currently we only enable the use of __is_final(...) with Clang. GCC also provides __is_final(...) since 4.7 in all standard modes. This patch creates the macro _LIBCPP_HAS_IS_FINAL to note the availability of `__is_final`.

Reviewers: danalbert, mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239664 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 07:08:02 +00:00
Eric Fiselier
6d7a2cb57d [libcxx] Use __decltype instead of __typeof__
Summary:
Both clang and GCC provide C++11 decltype semantics as __decltype in c++03 mode. We should use this instead of __typeof__ when availble. 

GCC added __decltype in 4.6.0, and AFAIK clang provided __decltype ever since 3.3. Unfortunately `__has_builtin(__decltype)` doesn't work for clang so we need to check the compiler version instead.


Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239662 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 06:27:17 +00:00
Eric Fiselier
b7fc49f828 Make __void_t unary and always provide it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239655 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 02:36:07 +00:00
Eric Fiselier
bc1e44d14e LWG2442: call_once() shouldn't DECAY_COPY(). Patch from K-Ballo.
This patch fixes LWG issue 2422 by removing the DECAY_COPY from call once.
The review can be found here: http://reviews.llvm.org/D10191


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239654 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 02:23:00 +00:00
Eric Fiselier
eeeada1c77 Enable __is_trivially* intrinsics for GCC 5.1
Until GCC 5.1 the __is_trivially* intrinsics were not provided. Enable use of
the builtins for GCC 5.1.

Also enable Reference qualified member functions for GCC 4.9 and greater.

This patch also defines _GNUC_VER to 0 when __GNUC__ is not defined because
libc++ assumes _GNUC_VER is always defined.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239653 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 02:18:44 +00:00
Eric Fiselier
724b5ab350 Refactor is_member_function_pointer to use is_function and not __member_function_traits.
Replacing the dependancy on __member_function_traits with is_function allows
is_member_function_pointer to work more often. In particular it allows it to
work when we don't have variadic templates but the function has an arity > 3.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239649 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 00:33:13 +00:00
Eric Fiselier
7726a348df Prevent dependancy on libatomic when using GCC to provide <atomic>.
The __atomic_is_lock_free(...) function sometimes requires linkage to libatomic
if it cannot be evaluated at compile time. Remove __c11_atomic_is_lock_free
and use __atomic_is_lock_free(sizeof(Tp)) directly so that it can be evaluated
at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239648 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-13 00:23:07 +00:00
Eric Fiselier
56a599b976 Fix PR23293 - Do not unlock shared state before notifying consumers.
Within the shared state methods do not unlock the lock guards manually. This
could cause a race condition where the shared state is destroyed before the
method is complete.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239577 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-12 00:41:34 +00:00
Marshall Clow
f54ca46a7b Change #ifdefs in test to UNSUPPORTED. No functionality change in the tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239562 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-11 21:47:39 +00:00
Marshall Clow
4356f6392e Fix PR#23767. Add tests for iterator invalidation for deque::erase/pop_front/pop_back
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239196 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 22:34:19 +00:00
Joerg Sonnenberger
64c6248499 Avoid C-style cast.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239160 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-05 15:54:26 +00:00
Marshall Clow
c912c0ce7c While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@239004 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 02:05:41 +00:00
Marshall Clow
127db91f3e More N4258 changes. This time vector's constructors
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238990 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-04 00:10:20 +00:00
Marshall Clow
7b193f7797 More of N4258 implementation. Mark all of our test_allocators as noexcept constructible. Make the constructors for basic_string noexcept all the time (under C++14). Update tests to reflect the new world order. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238957 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 19:56:43 +00:00
Marshall Clow
bbf87b1c34 Add 'is_always_equal' tests for scoped_allocator. Found that I had typed '||' where I meant '&&' in the code; fixed that, too
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238931 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-03 16:15:55 +00:00
Marshall Clow
b957bac1da Revert changes inadvertantly committed
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238880 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 22:26:29 +00:00
Marshall Clow
22f6c0532d Move uncaught_exeption() definition inside the #ifdef block like uncaught_exceptions()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238879 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 22:25:23 +00:00
Marshall Clow
c2a3137671 Fix breakage that I introduced in r238848
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238870 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 21:40:58 +00:00
Marshall Clow
f0324bcaa1 Implement the first part of N4258 - allocator_traits<X>::is_always_equal. Also fixes PR#23723
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238848 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 16:34:03 +00:00
Marshall Clow
8731c5da46 Implement uncaught_exceptions() using the newly added hooks in libc++abi, when available
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238846 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 15:33:38 +00:00
Marshall Clow
708b86b5f9 Fix some places where we could call memmove(null,xxx,0) - which is UB
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238831 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 13:52:16 +00:00
Marshall Clow
56523ff60e In the case where we are copying/moving zero elements, do less work
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238828 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 13:04:18 +00:00
Eric Fiselier
fa97c2e8bc Add missing return statements in C++03 std::function
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238803 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:31:33 +00:00
Eric Fiselier
c4324b2b94 Add TODO items and remove use of 'noexcept' in C++03 test.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238802 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-02 01:25:34 +00:00
Marshall Clow
ebc31694e8 Remove debugging code
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238674 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-31 14:01:54 +00:00
Marshall Clow
bf0460e0a0 Don't try to memcpy zero bytes; sometimes the source pointer is NULL, and that's UB. Thanks to Nuno Lopes for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238666 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-31 03:13:31 +00:00
Eric Fiselier
0620fc865b Add TODO note about switching to __decltype
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238631 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-29 23:21:03 +00:00
Marshall Clow
60784f62de Fix PR#23647 - make_shared<volatile bool> - second try
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238370 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 22:44:47 +00:00
Marshall Clow
fc3a3ffc69 Revert 238354 while I figure out what broke in weak_ptr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238355 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:36:14 +00:00
Marshall Clow
83f8153b22 Fix PR#23647 - make_shared<volatile bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238354 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 20:15:33 +00:00
Marshall Clow
14c616af09 Add N4259 to the list of papers from Lenexa. Update links to point at public repos.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 17:19:40 +00:00
Eric Fiselier
970d9f7768 Get thread sleep_for test passing in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:09:51 +00:00
Eric Fiselier
2cd0a2e4e7 Mark __convert_to_integral test as XFAIL in c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238271 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 01:02:51 +00:00
Eric Fiselier
ee6bfb2117 Cleanup move/forward tests and remove references to __rv.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:51:08 +00:00
Eric Fiselier
8f1d85fde5 Add test macros header to remove dependance on __config macros.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-27 00:28:30 +00:00
Marshall Clow
7242d18811 Fix broken test I just added
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@238234 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-26 19:17:09 +00:00