Howard Hinnant
c418654096
Revert pair constructors back to using is_convertible instead of is_constructible. This should pull things into alignment with the final draft. Fixes http://llvm.org/bugs/show_bug.cgi?id=13063#add_comment .
...
llvm-svn: 158280
2012-06-09 20:01:23 +00:00
Howard Hinnant
4c0de496a0
Fix dangling else clause. Bug found and fixed by Dimitry Andric.
...
llvm-svn: 157779
2012-05-31 23:12:03 +00:00
Howard Hinnant
78b4015c1c
Fix the new _ALIGNAS_TYPE per instructions supplied by Eli Friedman.
...
llvm-svn: 157765
2012-05-31 20:14:00 +00:00
Howard Hinnant
bf33f5b292
Protect use of alignas against older versions of clang
...
llvm-svn: 157764
2012-05-31 19:31:14 +00:00
Howard Hinnant
8b805c915a
The rules for emplace in map, multimap, unordered_map and unordered_multimap changed a while back and I'm just now updating to these new rules. In a nutshell, you've got to know you're emplacing to a pair and use one of pair's constructors. I made one extension: If you want to emplace the key and default construct the mapped_type, you can just emplace(key), as opposed to emplace(piecewise_construct, forward_as_tuple(key), forward_as_tuple()).
...
llvm-svn: 157503
2012-05-25 22:04:21 +00:00
Howard Hinnant
a960edd203
Fix memory corruption bug found and fixed by Andrew C. Morrow.
...
llvm-svn: 157476
2012-05-25 15:55:46 +00:00
Howard Hinnant
ed81e910bd
Revert fix to http://llvm.org/bugs/show_bug.cgi?id=12867 for the reason now included in the code comment.
...
llvm-svn: 157128
2012-05-19 20:20:49 +00:00
Douglas Gregor
a336f5e645
Revert my _LIBCPP_INLINE_VISIBILITY changes, r157097 and r157107
...
llvm-svn: 157108
2012-05-19 07:14:17 +00:00
Douglas Gregor
a1b6937dba
valarray resize should not be _LIBCPP_INLINE_VISIBILITY
...
llvm-svn: 157107
2012-05-19 07:01:14 +00:00
Douglas Gregor
8f69b1af3d
Move _LIBCPP_VISIBLE_INLINE from the out-of-line definitions of member
...
functions to the original declarations, so that Clang will actually
see them. Part of <rdar://problem/11489333>.
llvm-svn: 157097
2012-05-19 04:41:25 +00:00
Howard Hinnant
9042d623bf
Protect __shared_weak_count::__get_deleter declaration with _LIBCPP_NO_RTTI. Fixes http://llvm.org/bugs/show_bug.cgi?id=12867
...
llvm-svn: 157049
2012-05-18 13:06:21 +00:00
Howard Hinnant
423a8d7733
Fix several bugs in find/count specialized for bits.
...
llvm-svn: 156546
2012-05-10 14:55:00 +00:00
Howard Hinnant
19d9cbfb39
Add friends __count_bool_true and __count_bool_false to __bit_iterator.
...
llvm-svn: 156543
2012-05-10 14:01:40 +00:00
Howard Hinnant
0ae9efeb1a
SFINAE __bit_iterator such that it will only get instantiated with a container that has the nested type __storage_type. This prevents accidental instantiation such as in http://llvm.org/bugs/show_bug.cgi?id=12755 . This fixes http://llvm.org/bugs/show_bug.cgi?id=12755 .
...
llvm-svn: 156308
2012-05-07 16:50:38 +00:00
Howard Hinnant
df7aad41fd
Constrain __bind functor constructor such that it won't accidentally get used as a copy constructor from a non-const lvalue. Fixes <rdar://problem/11359080>.
...
llvm-svn: 156182
2012-05-04 17:21:02 +00:00
Howard Hinnant
9acfc3af72
Change std::abs from a template function to three overloads for float, double and long double.
...
llvm-svn: 156064
2012-05-03 14:58:34 +00:00
Howard Hinnant
bff1bfc6be
Greatly scale back ambitions of emulating move semantics in C++03 mode. It was causing more problems than it solved. This fixes http://llvm.org/bugs/show_bug.cgi?id=12704 .
...
llvm-svn: 155918
2012-05-01 15:37:54 +00:00
Howard Hinnant
d01320c200
Apply noexcept and constexpr to <atomic>.
...
llvm-svn: 154526
2012-04-11 20:14:21 +00:00
Richard Smith
766e8ccbfc
Switch libc++ from __atomic_* builtins to __c11_atomic_* builtins.
...
Per discussion with Howard, we are not interested in maintaining
compatibility with older versions of clang.
All tests pass with ToT clang, except for two which assert due to
a pre-existing, unrelated bug.
llvm-svn: 154521
2012-04-11 18:55:46 +00:00
David Chisnall
cd42f9446b
Now that clang supports doing the right thing with regard to atomic
...
initialisation, do the right thing with regard to atomic initialisation.
Note: clang r154507 or later required for <atomic> to work now.
llvm-svn: 154508
2012-04-11 17:26:23 +00:00
David Chisnall
c5d5a98815
Fix use of __atomic_is_lock_free() intrinsic.
...
llvm-svn: 154093
2012-04-05 13:13:24 +00:00
Howard Hinnant
7e5b4c9328
Put std::piecewise_construct_t back into the dylib for ABI stability. When clients are in C++11/constexpr mode this will be safely ignored because piecewise_construct is then declared with internal linkage.
...
llvm-svn: 153981
2012-04-03 23:45:46 +00:00
Howard Hinnant
b2e9f19caf
constexpr support for <utility>. Patch contributed by Jonathan Sauer.
...
llvm-svn: 153968
2012-04-03 21:09:48 +00:00
Howard Hinnant
e386b7b360
Update <random> with constexpr support. Patch contributed by Jonathan Sauer.
...
llvm-svn: 153896
2012-04-02 21:00:45 +00:00
Howard Hinnant
338eb3116c
Update <limits> with constexpr support. Patch contributed by Jonathan Sauer.
...
llvm-svn: 153888
2012-04-02 19:23:15 +00:00
Howard Hinnant
788c9979d9
This is an initial commit of constexpr support as proposed by Richard Smith. This by no means completes constexpr support. Indeed, it hardly scratches the surface. All it does is lay the foundation in <__config> and changes those few places in the library that are already using that foundation.
...
llvm-svn: 153856
2012-04-02 00:40:41 +00:00
Howard Hinnant
0527c6207a
I believe tuple is still under development in the standard. Daniel Krugler is/will be making convincing arguments that a modified form of LWG 2051 (currently NAD Future) is easily acheivable and desirable. He has demonstrated that a tuple<T...> where all of the T are implicitly convertible from U... should have a tuple constructor that is also implicit, instead of explicit. This would support the use cases in LWG 2051 while not undermining T... with explicit conversions from U.... This check-in is an experimental implementation of Daniel's work. I believe this work to be mature enough to warrant inclusion into libc++. If anyone sees real-world problems that this check in causes, please let me know and I will revert it, and provide the feedback to the LWG.
...
llvm-svn: 153855
2012-04-01 23:10:42 +00:00
Howard Hinnant
cb16c68042
It appears that the standard accidentally removed the default constructor for error_category. I'm putting it back in. This fixes http://llvm.org/bugs/show_bug.cgi?id=12321 .
...
llvm-svn: 153194
2012-03-21 16:18:57 +00:00
David Chisnall
5f13d66fb4
Make sure [at_]quick_exit is in std::
...
llvm-svn: 152717
2012-03-14 14:10:37 +00:00
Jeffrey Yasskin
9c95b19f9e
Fix moneypunct_byname algorithm to more accurately represent C locales in C++.
...
llvm-svn: 152501
2012-03-10 18:31:43 +00:00
Howard Hinnant
8d5df9b9d4
Change some smart_ptr == 0 to smart_ptr == nullptr. Fixes http://llvm.org/bugs/show_bug.cgi?id=12185 .
...
llvm-svn: 152240
2012-03-07 20:37:43 +00:00
David Chisnall
04e5ce2bc1
Define _WCHAR_T in solaris/wchar.h. This fixes a bug where Solaris 10 headers
...
try to define C++ keywords as typedefs (fixed in Solaris 11).
llvm-svn: 151890
2012-03-02 10:56:04 +00:00
David Chisnall
55661e7305
Fix MSVC / Sun #ifdef ordering. Remove another #if-nothing-#endif.
...
Sorry for the churn.
llvm-svn: 151731
2012-02-29 16:41:21 +00:00
David Chisnall
40d7a8acff
Remove a spurious #ifdef / #endif pair with nothing between them.
...
llvm-svn: 151729
2012-02-29 16:22:33 +00:00
David Chisnall
06af2bbb04
Add support files required for building on Solaris.
...
llvm-svn: 151721
2012-02-29 13:17:28 +00:00
David Chisnall
14c25b80e9
Solaris port. Currently sees around 200 test failures, mostly related to
...
Solaris not providing some of the locales that the test suite uses.
Note: This depends on an xlocale (partial) implementation for Solaris and a
couple of fixed standard headers. These will be committed to a branch later
today.
llvm-svn: 151720
2012-02-29 13:05:08 +00:00
David Chisnall
ca78592c16
Don't define __locale_raii if we are not going to be using it.
...
llvm-svn: 151718
2012-02-29 13:00:07 +00:00
Howard Hinnant
9bb1429f20
Reduce the number of move constructions when constructing a std::function. This fixes http://llvm.org/bugs/show_bug.cgi?id=12105 .
...
llvm-svn: 151652
2012-02-28 19:47:38 +00:00
Howard Hinnant
9ffe10106e
vector::emplace_back was mistakenly requiring move assignable. Fixed that and did a little drive-by optimization at the same time. This fixes http://llvm.org/bugs/show_bug.cgi?id=12085 .
...
llvm-svn: 151492
2012-02-26 15:30:12 +00:00
Howard Hinnant
8d01935c09
Hook up to the new clang __is_trivially_constructible and __is_trivially_assignable traits. Fixes r10925427 and http://llvm.org/bugs/show_bug.cgi?id=12038 .
...
llvm-svn: 151406
2012-02-24 23:32:26 +00:00
Howard Hinnant
f2f2d8b98d
Modernize conversion to bool to the explicit bool conversion operator (library wide). This fixes http://llvm.org/bugs/show_bug.cgi?id=12058 .
...
llvm-svn: 151088
2012-02-21 21:46:43 +00:00
Howard Hinnant
67f3964766
Modernize relational operators for shared_ptr and unique_ptr. This includes adding support for nullptr, and using less<T*>. Fixes http://llvm.org/bugs/show_bug.cgi?id=12056 .
...
llvm-svn: 151084
2012-02-21 21:02:58 +00:00
Bob Wilson
a4fd70ea77
Add missing newlines at EOF.
...
llvm-svn: 150965
2012-02-20 16:56:13 +00:00
Howard Hinnant
2a9a072485
Give the emulated nullptr_t a default constructor.
...
llvm-svn: 150893
2012-02-18 22:01:22 +00:00
Howard Hinnant
f9c73f6629
Use __is_polymorphic if available. This fixes http://llvm.org/bugs/show_bug.cgi?id=11983 . Patch contributed by Jonathan Sauer.
...
llvm-svn: 150614
2012-02-15 20:47:11 +00:00
Howard Hinnant
fa8df7db88
tuple was accidentally lacking a valid copy assignment operator. It went undetected because I had failed to test assigning from a const lvalue. This fixes http://llvm.org/bugs/show_bug.cgi?id=11921
...
llvm-svn: 150613
2012-02-15 20:13:52 +00:00
Howard Hinnant
6560953383
Do not parse sign if a sign is not the next legal character when parsing floating point from an input stream. Fixes http://llvm.org/bugs/show_bug.cgi?id=11871
...
llvm-svn: 150609
2012-02-15 19:19:37 +00:00
Howard Hinnant
2aa9a38b67
Another stab at fixing http://llvm.org/bugs/show_bug.cgi?id=12007 . I earlier missed that there are two common_type definitions and corrected only one of them.
...
llvm-svn: 150599
2012-02-15 18:08:09 +00:00
Howard Hinnant
425e44d192
Remove reference from common_type definition. It looks like a recent clang decltype implementation got fixed/improved and exposed this. Fixes http://llvm.org/bugs/show_bug.cgi?id=12007 .
...
llvm-svn: 150581
2012-02-15 15:08:30 +00:00
Howard Hinnant
9741d6c96e
Implement a few optimizations for vector push_back and insert. Fixes r10828365.
...
llvm-svn: 150542
2012-02-15 00:41:34 +00:00