Eric Fiselier
8fcc27286f
Change _LIBCXX_CONSTEXPR_AFTER_CXX11 to check for c++14 constexpr rules
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213225 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:16:18 +00:00
Marshall Clow
2b44e3dd49
Correctly implement LWG 2049; std::is_destructible.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213163 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 15:51:50 +00:00
Saleem Abdulrasool
7ef03b79f9
Change Windows decoration on some base classes
...
Mark the base classes for time_get_byname and time_get as _LIBCPP_TYPE_VIS_ONLY
rather than _LIBCPP_TYPE_VIS. These base classes are templated types and cannot
be stored with export dll storage.
Fixes compilation with _LIBCPP_DLL for Windows when the time_get and
time_get_byname classes are used.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213116 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 01:00:26 +00:00
Marshall Clow
48e7e9f403
Support the built-in type-trait support in gcc 4.7 and later. Thanks to Albert Wong for the patch.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212727 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:38:20 +00:00
Marshall Clow
a64392627e
Add support for BIONIC C library (Android). Patch from Dan Albert
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212724 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:20:28 +00:00
Marshall Clow
484728789e
string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 22:38:11 +00:00
Marshall Clow
3a61b30f3a
Minor cleanup for string_view; mostly from suggestions by Richard Smith. Also, make the tests pass under c++03
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-02 15:45:57 +00:00
Marshall Clow
2f9e714071
Fix libc++ bug #20039 : 'Constructing std::function from empty compatible std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 21:27:51 +00:00
Marshall Clow
394451db81
Fix a typo in the noexcept calculation for __compressed_pair::swap. Thanks to EricWF for the bug report and the fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212046 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 15:35:09 +00:00
Marshall Clow
81aa3a745c
Patch from Albert J. Wong to make type_traits take advantage of gcc intrinsics in 4.7 and later. No functionality change when using clang.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211755 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-26 01:07:56 +00:00
David Fang
44ead61237
eliminate install of duplicate headers (take 2)
...
Patch by Ryuta Suzuki
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211629 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24 20:32:11 +00:00
Marshall Clow
ba6dbf4866
Some calls to get<>() were qualified. Some were not. Qualify them all. Fixes bug #20092 . Thanks to Agustín Bergé for the bug report and the fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211563 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-24 00:46:19 +00:00
Marshall Clow
e4694b4129
Formatting improvements in the <string_view> synopsis suggested by RSmith. No functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@211191 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-18 17:44:04 +00:00
Marshall Clow
164b297099
Implement string_view from the library fundamentals TS (n4023). Also works in C++11 and 03, with reduced functionality (mostly in the area of constexpr)
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11 16:44:55 +00:00
Marshall Clow
37025e1b32
Make the helper routines in string really be constexpr. This required a bit of refacoring in algorithm as well. Give them better names while we're at it. All of these are internal rotines; no visible functionality change.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:51:55 +00:00
Marshall Clow
20f0955062
Since we now have a value for __cplusplus for c++14, teach libc++ about it
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210380 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 22:31:09 +00:00
Richard Smith
73c1fce21c
Use __builtin_operator_new/__builtin_operator_delete when available. This
...
allows allocations and deallocations to be optimized out.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210211 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:54:15 +00:00
Nico Weber
0211e86a5e
Make locales (and transitively, std::endl) work reliably with gcc.
...
libc++ currently relies on undefined initialization order of global
initializers when using gcc:
1. __start_std_streams in iostream.cpp calls locale:🆔 :_init, which assigns
an id to each locale::facet in an initializer
2. Every facet has a static locale::id id, whose constructor sets the facet's
id to 0
If 2 runs after 1, it clobbers the facet's assigned consecutive id, causing
exceptions to be thrown when e.g. running code like "cout << endl".
To fix this, let _LIBCPP_CONSTEXPR evaluate to "constexpr" instead of nothing
with gcc. locale::id's constructor is marked _LIBCPP_CONSTEXPR, which ensures
that it won't get an initializer that could potentially run after the
iostream.cpp initializer. (This remains broken when building with msvc.)
Also switch constexpr-specific code in bitset to use __SIZEOF_SIZE_T__ instead
of __SIZE_WIDTH__, because gcc doesn't define the latter.
Pair-programmed/debugged with Dana Jansens.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210188 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 15:46:56 +00:00
Marshall Clow
360f3196d7
Preparation for <string_view>. More helper functions that can be shared between <string> and <string_view>. No functionality change
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210002 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 02:22:49 +00:00
Nico Weber
3c122d81be
Add a _LIBCPP_CONSTEXPR that was missed in r170026.
...
(clang doesn't complain about this, but gcc does. This is necessary for a
follow-up patch that will enable _LIBCPP_CONSTEXPR for gcc.)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209888 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-30 12:09:47 +00:00
Marshall Clow
4f3368e269
Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209785 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 01:10:28 +00:00
Marshall Clow
6b7e6921e2
Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:29:50 +00:00
Marshall Clow
117563c516
Fix bug 19740; round-tripping a pointer through a stream doesn't work
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:02:20 +00:00
Richard Smith
f33ffcc651
[modules] Add initial module map for libc++.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209265 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 00:33:49 +00:00
Nico Weber
7fac8f6b9f
Update cstddef after clang r207606.
...
r207606 changed the __need_foo macros to behave like they do with gcc: If they
are set, _only_ the __need_foo stuff gets defined. As a consequence, cstddef
no longer defined "offsetof". It looks like the __need_foo defines aren't
needed anymore, so just remove them.
Fixes PR19723.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208942 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 01:45:02 +00:00
Alp Toker
ec34c48976
Fix typos
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208869 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:27:39 +00:00
Marshall Clow
1f50f2d64b
Add Address Sanitizer support to std::vector
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08 14:14:06 +00:00
Marshall Clow
6b5be703db
Fix PR 19663. Some calls to find(vector<bool>) were returning iterators that were subtly invalid (didn't compare equal). Thanks to Erik Verbruggen for the report (and diagnosis)
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-06 15:33:23 +00:00
Joerg Sonnenberger
55622073f4
Exceptions store the message as reference counted string for
...
compatibility to libstdc++. Move the implementation into a header for
easier sharing with libc++abi. Merge a number of improvements from that
version. Provide a POD definition for <stdexcept>'s public use to avoid
cast dances. Discussed with Marshall Clow.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207695 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30 19:54:11 +00:00
Marshall Clow
5f64a2b3c3
Fix bug #18350 . Add tests for tuples of all the smart pointers (except auto_ptr)
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 05:19:48 +00:00
Marshall Clow
398c9d882b
Default the copy and move constructors for __tuple_leaf. This fixes bugs 18853 and 19118. Add a test case for that.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 23:48:09 +00:00
Marshall Clow
067e91d29e
Use compiler intrinsic __is_constructible if available
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206805 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 22:30:32 +00:00
Marshall Clow
a178c13419
Bug #19473 . If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206623 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 17:23:36 +00:00
Marshall Clow
6601516af8
Remove some unnecessary noexcept conditions. Thanks to Richard Smith for the catch.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206424 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-16 23:12:55 +00:00
Marshall Clow
7d4d519f0b
Define a new macro in libc++ named '_LIBCPP_HAS_NO_ASAN'. When this is defined,
...
libc++ will not call address_sanitizer to detect addressing errors in the
standard library containers. This is a negative macro to enable users to
disable the libc++ checks even if they are compiling with address sanitizer
enabled by defining this macro.
At the present time, there is no code in libc++ that looks at this macro.
That will come soon. This is just infrastructure.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206184 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-14 15:44:57 +00:00
Marshall Clow
140e8f52c3
Remove node from a container before destroying it. Thanks to Alexander Potapenko for pointing this out.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206024 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-11 08:22:42 +00:00
Marshall Clow
f1264e7c9e
Fix PR19819
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 13:32:26 +00:00
Tim Northover
0835e16c6d
RTTI Uniqueness: remove __name_for_load function.
...
It's identical to name() these days. (At one point it avoided masking
of the RTTI uniqueness bit because ARM64 ignored it architecturally,
but no longer).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205518 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-03 09:12:38 +00:00
Tim Northover
81339cff83
Use defined(__APPLE__) rather than __APPLE__
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 14:59:12 +00:00
Tim Northover
6fdde87640
ARM64: compare RTTI names as strings
...
ARM64 generates RTTI with hidden visibility, which means that typeinfo
must be compared char-by-char since it's not guaranteed to be uniqued
across the whole program.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205139 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 11:34:26 +00:00
Tim Northover
c030063cc2
ARM64: use the alternate string layout on Apple platforms.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205138 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-30 11:34:22 +00:00
Stephan Tolksdorf
8a71d23633
[libc++] Teach is_integral, is_[un]signed and make_[un]signed about __[u]int128_t
...
This commit also adds tests for std::numeric_limits<__[u]int128_t>.
Reviewed in http://llvm-reviews.chandlerc.com/D2917
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204849 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 19:45:52 +00:00
Marshall Clow
b0767852f7
Implement LWG issue #2135 . If something goes wrong in condition_variable::wait, call terminate() rather than throwing an error. Do this indirectly, by marking the call as 'noexcept'. This is better than just calling terminate() directly, because it gives a better error message on the console.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204778 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 02:45:04 +00:00
David Majnemer
f9f95be930
Implement N3891: A proposal to rename shared_mutex to shared_timed_mutex
...
This is as straightforward as it sounds, a renamed from shared_mutex to
shared_timed_mutex.
Note that libcxx .dylib and .so files built with c++14 support need to
be rebuilt.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 20:19:44 +00:00
Marshall Clow
5a8e27b5b3
THIRD TIME. Richard pointed out (again) that I'd switched the order of the instance variables; and thus failed to repair the ABI break. After this, I'm going to sit down and watch TV for the evening.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203631 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 01:19:36 +00:00
Marshall Clow
668a1d8c44
Fix ABI break I made in r203587; thanks to Richard Smith for the catch.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203610 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 22:05:31 +00:00
Marshall Clow
be3d117702
Fix misguided #elif - it checked the value of _AIX instead of defined(_AIX). Thanks to Johan Bergström for the bug report.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203589 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 17:18:47 +00:00
Marshall Clow
b1ead689be
Implement LWG 2360: 'reverse_iterator::operator*() is unimplementable'. Note that this is a (small) behavior change in the library. Reverse iterators whose base iterators' operator* return references to 'within themselves' have been sacrificed to the greater goal of avoiding data races.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 17:16:17 +00:00
Marshall Clow
caaa1412b0
Fix bug I introduced (enabling implicit conversions from compare function to map) in r202994. Thanks to Sebastian Redl for the catch.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203443 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 04:50:10 +00:00
Marshall Clow
b90686c1ec
Implement LWG #2344 : quoted()'s interaction with padding is unclear. I think that anyone using quoted with padding is really confused, but it should work the way the rest of iostreams works.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203290 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 21:45:32 +00:00