Commit Graph

907 Commits

Author SHA1 Message Date
Marshall Clow
65ccddb341 Mark seed_seq default constructor and size() as noexcept. This is implied, but not required by LWG issue 2180
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-23 05:56:47 +00:00
Marshall Clow
33ae2337e2 Patch by GM: apparently '__value' (two underscores) is a special name in Visual Studio, so rename the private method in <regex> with that name. GM's patch used '___value' (three underscores), but I changed that to '__regex_traits_value' because I've been burned in the past by identifiers that appear identical but are not.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193087 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 15:43:25 +00:00
Marshall Clow
8a43fca8ed Patch by GM: Making implicit conversion to bool explicit in <ios> and <__locale>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193085 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 14:41:05 +00:00
Marshall Clow
0ac5cce17c Patch by GM: Adding MSVC support to __bit_reference
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 14:29:37 +00:00
Marshall Clow
9de3d4cab3 Patch from GM to make more implicit bools explicit since we can't stop MSVC warning about this in headers and to warn is the MSVC default. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-13 01:02:45 +00:00
Marshall Clow
61a8422ffa LWG Issue 2087: iostream_category() and noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192545 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:49:56 +00:00
Marshall Clow
5f2d5b95e6 LWG Issue 2097: packaged_task constructors should be constrained
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:49:17 +00:00
Marshall Clow
206ce1faaf LWG issue 2143: ios_base::xalloc should be thread-safe
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192539 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 19:13:52 +00:00
Marshall Clow
1206720869 Implement national body comment GB9: remove std::gets
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 19:09:47 +00:00
Marshall Clow
b8dd5caf5a patch by Yaron: Uses rand_s() from stdlib.h (when building for Windows)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192325 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-09 21:49:03 +00:00
Marshall Clow
dab89a1412 Fix LWG Issue 2141: common_type trait produces reference types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 23:43:33 +00:00
Howard Hinnant
e064055942 G M: Rename local variable from __except to avoid MSVC keyword clash.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 21:00:29 +00:00
Howard Hinnant
35a98a00b3 Use _LIBCPP_NEW_DELETE_VIS instead of LIBCPP_FUNC_VIS in src/new.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192071 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 20:53:24 +00:00
Howard Hinnant
2bcdf5e9a0 Yaron Keren: Add missing comment.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192068 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 19:48:40 +00:00
Marshall Clow
79d8c99a62 LWG Issue 2247: Implement type trait 'is_null_pointer'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:21:17 +00:00
Marshall Clow
320c80fecf Implement literal suffixes for compled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:19:49 +00:00
Marshall Clow
8d9dd7a968 Mark namespaces for user defined literals as 'inline'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:18:32 +00:00
Marshall Clow
1d927e38d1 Implement LWG issue 2275 'forward_as_tuple should be constexpr'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192038 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 18:46:37 +00:00
Howard Hinnant
5a8b5783f8 G M: The attached patch is for libcxx's new.cpp and __config files. The patch's intent is to make new.cpp compile using MS's cl.exe compiler without changing the meaning of anything for any other compiler.
The issue this patch seeks to address is that MS's compiler (cl.exe) doesn't support the __attribute__((__weak__)) or __atribute__((__visibility__("default")) syntax; so a solution must be found where cl.exe doesn't see this syntax.

This patch seeks to solve this problem by changing code patterned like this:
__attribute__((__weak__, __visibility__("default")))
void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { /*snip*/; return p; }

to code like this:
_LIBCPP_WEAK
void* operator new(size_t size, const std::nothrow_t&) _NOEXCEPT { return p; }

Howard:  Thanks for all the comments regarding the default visibility
tag on the definition.  I agree it isn't needed, and that there are lots
of other places where it is missing.  That being said, I'm not wanting
to rock the boat on that issue right now.  So I've added it back to the
definition via _LIBCPP_FUNC_VIS.  A later pass dedicated just to this
issue can bring things in to a consistent state one way or the other. 
Note that we do not want to have the exact same attributes on the
declaration and defintion in this case.  The declaration should not be
marked weak, whereas the definition should (which is what G M's patch
did). I've fully tested on OS X to ensure that the resultant attribute
syntax actually works.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192007 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 23:56:37 +00:00
Howard Hinnant
1e564246ec G M: Changes all references to "x inline" to "inline x" where x = _libcpp_always_inline or _libcpp_inline_visibility macros.
The patch touches these files:

locale
array
deque
new
string
utility
vector
__bit_reference
__split_buffer
locale_win32.h
 
There is no intended functionality change and it is expected that reversing the position of the inline keyword with regard to the other keywords does not change the meaning of anything, least not for apple/Linux etc.
 
It is intended to make libcxx more consistent with itself and to prevent the 1000 or so
"inline.cpp(3) : warning C4141: 'inline' : used more than once" warnings that MS's cl.exe compiler emits without this patch, i.e. if inline is not the first keyword before a function name etc.
 
Prefer "inline [other inline related keyword]" over "[other related keyword] inline".
After this patch, libcxx should be consistent to this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191987 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 22:09:00 +00:00
Howard Hinnant
f677bc4165 G M: Fix libcxx's detection of rtti disablement for g++.exe and cl.exe. When RTTI is NOT enabled, _LIBCPP_NO_RTTI is defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191981 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 21:24:21 +00:00
Howard Hinnant
f7555069ab G M: Provides the _LIBCPP_WARNING macro, to be used for MSVC only, since that compiler doesn't support #warning.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191980 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-04 21:14:44 +00:00
Marshall Clow
19e7862eb8 Remove non-printable chars that snuck in back in July; thanks to Yaron Keren for the catch
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-01 13:28:20 +00:00
Marshall Clow
bd444af850 Part 8 of LWG Issue 2210' unordered_set and unordered multiset; this got missed when I went on vacation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 21:33:51 +00:00
Howard Hinnant
ff7546e974 SCARY/N2913 iterator support between the multi and non-multi versions of the associative and unordered containers. I beleive lack of support for this was accidentally recently introduced (by me) and this is fixing a regression. This time tests are put in to prevent such a regression in the future.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 19:08:22 +00:00
Marshall Clow
9738cafa4f Implement n3789; constexpr support in named function objects
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-28 19:06:12 +00:00
Marshall Clow
6db12cb037 Add a set of macros for using the new '[[[deprecated]]' attribute. No code changes (yet)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-28 18:35:31 +00:00
Howard Hinnant
de589f2f8f Peter Collingbourne: If a pointer is passed as the third argument of the (iterator,
iterator, allocator) constructor with the intention of it being
implicitly converted to the allocator type, it is possible for overload
resolution to favour the (iterator, iterator, enable_if) constructor.
Eliminate this possibility by moving the enable_if to one of the
existing arguments and removing the third argument.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 21:13:54 +00:00
Howard Hinnant
dcc6a0bc44 Apply LWG 2048. It is amazing to me that this actually works, but the existing tests confirm that it does. c++1y status page now showing libc++ is complete for c++1y modulo dynarray issues.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 19:25:37 +00:00
Howard Hinnant
0836f87fb9 Apply LWG 2021. This is only a documentation change. Also bringing c++1y status page up to date.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191141 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 18:17:23 +00:00
Howard Hinnant
23e470c348 Apply LWG 2017. This is a only a documentation change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 17:58:58 +00:00
Howard Hinnant
ba898e4208 N3659: Shared locking in C++ Revision 2, c++1y only
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191127 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 01:49:28 +00:00
Howard Hinnant
8127758024 David Chisnall: macro protect 'test' in __has_pointer_type_imp.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191126 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 01:45:05 +00:00
Howard Hinnant
ef5aa93b9c G M: Restore the ability for libcxx to compile again on mingw 64.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190837 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-17 01:34:47 +00:00
Howard Hinnant
cd942f1840 Marshall Clow: LWG Issue 2056: future_errc enums start with value 0 (invalid value for broken_promise).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 18:20:10 +00:00
Marshall Clow
a49a2c9deb LWG Issue 2210 (Part #7): vector and vector<bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 00:47:59 +00:00
Howard Hinnant
37c4acfe5e G M: Make shared_ptr a little more gentle for some compilers. No impact on clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190732 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 23:56:00 +00:00
Howard Hinnant
d885143d5c G M: Make valarray a little more forgiving to compilers not quite so gifted. This has no impact on clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190731 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 23:27:42 +00:00
Marshall Clow
27a1c252e3 Initial implementation of <dynarray>. No allocator support pending resolution of LWG #2235; no stack allocation pending compiler support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190697 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 15:22:55 +00:00
Marshall Clow
6dff618d7d LWG Issue 2210 (Part #6): unordered_map and unordered_multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190576 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 03:00:31 +00:00
Marshall Clow
599e60d2f7 Implement uses-allocator construction
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190571 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 02:11:16 +00:00
Howard Hinnant
f9d2680e19 A collection of minor type-o fixes. The first two aren't testable, but all tests pass with them. I stumbled across them while experimenting with a std::move that checks its argument for non-const. The third corrects a test that is currently failing.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190563 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 00:10:44 +00:00
Marshall Clow
7f9f52e6c6 Adding bad_array_length to libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190478 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 01:38:42 +00:00
Marshall Clow
49d596d412 LWG Issue #2210 Part 5 - map/multimap; no, really - the last one was set/multiset. THIS is map/multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190474 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 01:15:47 +00:00
Marshall Clow
24a7e331f1 LWG Issue #2210 Part 4 - map/multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190454 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 00:06:45 +00:00
Marshall Clow
e00f53bcfb Update synopsis for list/forward_list/deque to match the allocator style of existing comment. No code change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-09 18:19:45 +00:00
Marshall Clow
955f2c88a1 LWG Issue 2210 (Part #2 & #3): list and forward_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190279 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 19:11:51 +00:00
Marshall Clow
ab04aadaf4 LWG Issue 2210 (Part #1): deque
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 16:16:19 +00:00
Marshall Clow
62f34be0ba N3545: Quoted strings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190032 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 04:48:45 +00:00
Marshall Clow
9e613ca1b3 LWG Issue 2148: Hashing Enums
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 17:55:32 +00:00
Marshall Clow
1b5f3adcef Updated the synopsis for weak_ptr<T>::owner_before to match the code. No code changes.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189812 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 14:37:50 +00:00
Howard Hinnant
01afa5c6e4 Implement N3672, optional<T>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 20:30:37 +00:00
Howard Hinnant
713f4db2e5 SFINAE out duration converting constructor if the constructor would otherwise cause a ratio compile-time overflow. This fixes LWG 2094.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189722 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-31 16:51:56 +00:00
Howard Hinnant
d179407288 is_destructible for function types was mistakenly returning true instead of false. This is true in both C++11 and C++1y, but has been clarified by the post C++11 LWG issue 2049.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 19:12:42 +00:00
Howard Hinnant
cb0e6b65a8 Xing Xue: Fix type-o. Thanks to C. Bergström for spotting it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189674 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 14:42:39 +00:00
Marshall Clow
09da3c053c LWG Issue 2128: Implement global cbegin/rbegin/cend/rbegin
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 01:17:07 +00:00
Howard Hinnant
161a9bf447 Glen: Remove unneeded _LIBCPP_ALWAYS_INLINE.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 23:50:48 +00:00
Howard Hinnant
5143722d14 Xing Xue: Some minor changes for IBM XLC++/AIX.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 23:37:50 +00:00
Howard Hinnant
04a2c71d67 Turn off extern templates for most uses. It is causing more problems than it is worth. The extern templates will still be built into the dylib, mainly for ABI stability purposes. And the client can still turn these back on with a #define if desire. This fixes http://llvm.org/bugs/show_bug.cgi?id=17027. However there's no associated test for the test suite because http://llvm.org/bugs/show_bug.cgi?id=17027 needs mismatched dylib and headers to fire.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-29 20:56:53 +00:00
Marshall Clow
08b4f3f99b LWG Issue 2162: mark allocator_traits::maxsize as noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 20:22:15 +00:00
Marshall Clow
83179a788f LWG issues 2174/5/6 - mark wstring_convert::converted as noexcept, and make (some of) the constructors for wstring_convert and wbuffer_convert as explicit. Add configuration macro _LIBCPP_EXPLICIT_AFTER_CXX11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 20:18:59 +00:00
Marshall Clow
e42f184a76 Update synopsis in <locale> to match LWG Issue 2229. No code change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 14:22:13 +00:00
Marshall Clow
af74651f61 Implement LWG issue 2061
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 13:03:03 +00:00
Howard Hinnant
e1c5f9ec1b Apply constexpr to initializer_list for c++1y.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189271 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 20:11:32 +00:00
Howard Hinnant
fc3f80badf G M: Improve support for compilers not supporting defaulted functions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-24 21:31:37 +00:00
Howard Hinnant
5e57142c59 Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 20:10:18 +00:00
Howard Hinnant
5d5f9f9786 Remove _LIBCPP_DEBUG. This was my first attempt at debug mode for libc++, and is now obsoleted by _LIBCPP_DEBUG2 (which isn't finished).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 19:03:36 +00:00
Howard Hinnant
499cea12bb Debug mode for string. This commit also marks the first time libc++ debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189114 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 17:37:05 +00:00
Howard Hinnant
e31c432a33 Glen: replace obsolete _LIBCPP_CANTTHROW with _NOEXCEPT.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 19:39:03 +00:00
Howard Hinnant
9a894d93de Zhihao Yuan noted that there were a few unneeded statements. Eliminated the unnecessary ones, and commented the ones that are there for non-obvious reasons such as to help things limp along in C++03 language mode.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189039 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 18:29:50 +00:00
Howard Hinnant
1c44f51de7 Zhihao Yuan noted that a move assignment operation was missing from std::adjacent_difference. Fixed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 18:02:34 +00:00
Howard Hinnant
8a1df3ca0c David Blaikie suggested this test for detecting constexpr on the error_category default constructor. Additionally I decided to make this constructor trivial as well, as I could not come up with a rationale for not doing so. Fully tested with both current Apple clang and tip-of-trunk clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 17:41:48 +00:00
Marshall Clow
5c316a6d04 LWG 2145 - mark constructor for std::error_category as inline and constexpr. Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188858 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 02:57:19 +00:00
Howard Hinnant
de8fc6b2b1 Relax complete-type check for functions and function pointers to allow void return type. This bug was exposed by Eli Friedman's commit to clang r188324. Anywhere this version of clang ships, this libc++ fix must follow. However this fix is compatible with previous clangs, and so this libc++ doesn't need to wait for this clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188413 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 21:28:31 +00:00
Howard Hinnant
7f76450ee9 Xing Xue: port to IBM XLC++/AIX.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188396 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 18:00:20 +00:00
Marshall Clow
2df3700879 Add a deleted assignment operator for basic_ostream; LWG Issue #2067
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188375 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-14 15:15:28 +00:00
Marshall Clow
198a2a59ee Implement LWG Issue #2187 (emplace_back and emplace for vector<bool>)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 23:54:12 +00:00
Marshall Clow
5cfc6ab2b8 Second half (map/multimap) of N3657
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 22:18:47 +00:00
Marshall Clow
4a0a98166c First half of support for N3657; heterogenous lookups for set/multiset
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 01:11:06 +00:00
Howard Hinnant
0f678bd69e Nico Rieck: this patch series fixes visibility issues on Windows as explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188192 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 18:38:34 +00:00
Howard Hinnant
80e19ac90f Add a check for arrays of unknown bounds to is_destructible. This fixes http://llvm.org/bugs/show_bug.cgi?id=16839
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 16:53:45 +00:00
Howard Hinnant
5ea5d31f6d Partial implementation of N3665. This paper was not voted into the C++1y draft. However I was looking at it and with some experimentation realized that I could partially implement it, and at the same time offer a performance optimization to cout. I simply added an xsputn override to the cout filebuf. The override does nothing special at all if there is a non-trivial codecvt installed. However if the codecvt returns true for always_noconv(), then this function can dump an entire string to fwrite, instead of doing it a character at a time under overflow(). This just makes sense. I stopped short of a full implementation of N3665 because in order to do so, xsputn would have to allocate a buffer when always_noconv() returned false, and I don't want to go to that expense.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188077 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 16:25:43 +00:00
Marshall Clow
051c848e88 N3644 tests for map/multimap/set/multiset. Drive-by NOEXCEPT for __tree_const_iterator constructor. Fix comment typos in other tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188019 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 21:52:50 +00:00
Howard Hinnant
a4e87abbb9 My previous reorganization of addressof broke -std=c++03. Thanks much to Arnold Schwaighofer for catching this. This patch also catches a few more missing addressof in <future>, thanks go to Zhihao Yuan for catching these.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187997 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 18:38:55 +00:00
Arnold Schwaighofer
a709c823f7 Revert r187927.
Zhihao Yuan: Replace operator& with addressof in reference_wrapper constructor.

It breaks a clang bootstrap.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187959 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 03:06:24 +00:00
Howard Hinnant
d8bfe7ba56 Zhihao Yuan: Replace operator& with addressof in reference_wrapper constructor.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187927 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 23:02:42 +00:00
Marshall Clow
193ef03eb5 N3644 support for <unordered_set> and <unordered_map>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 21:30:44 +00:00
Marshall Clow
b92ee614f2 N3644 support for vector<bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187911 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:53:44 +00:00
Marshall Clow
0f164c9d75 N3644 support for <string> and <vector>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:48:48 +00:00
Howard Hinnant
36ba399a33 Correct logic bug in find optimization for vector<bool>. This fixes http://llvm.org/bugs/show_bug.cgi?id=16816
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:42:16 +00:00
Howard Hinnant
ab61b2c9f1 War on tabs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187906 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:39:48 +00:00
Marshall Clow
5a11f94583 Implement NULL iterators for <forward_list> and <deque> re: N3644
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187805 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 16:14:36 +00:00
Marshall Clow
65d2e6a392 Implement NULL iterators for <list> re: N3644
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-05 21:23:28 +00:00
Howard Hinnant
824c19963e debug mode for unordered_map. Also picked up a missing check and test in unordered_multimap. This wraps up debug mode for the unordered containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 17:50:49 +00:00
Howard Hinnant
8b00e6c960 Ok, 3 major changes for debug mode in one commit:
1.  I had been detecting and trapping iterator == and \!= among iterators
    in different containers as an error.  But the trapping itself is actually
    an error.
    
    Consider:
    
    #include <iostream>
    #include <vector>
    #include <algorithm>

    template <class C>
    void
    display(const C& c)
    {
        std::cout << "{";
        bool first = true;
        for (const auto& x : c)
        {
            if (\!first)
                std::cout << ", ";
            first = false;
            std::cout << x;
        }
        std::cout << "}\n";
    }

    int
    main()
    {
        typedef std::vector<int> V;
        V v1 = {1, 3, 5};
        V v2 = {2, 4, 6};
        display(v1);
        display(v2);
        V::iterator i = std::find(v1.begin(), v1.end(), 1);
        V::iterator j = std::find(v2.begin(), v2.end(), 2);
        if (*i == *j)
            i = j;    // perfectly legal
        // ...
        if (i \!= j)   // the only way to check
            v2.push_back(*i);
        display(v1);
        display(v2);
    }

    It is legal to assign an iterator from one container to another of the
    same type.  This is required to work.  One might want to test whether or
    not such an assignment had been made.  The way one performs such a check
    is using the iterator's ==, \!= operator.  This is a logical and necessary
    function and does not constitute an error.

2.  I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
    This caused a problem in several of the libc++ tests.
    Fixed.

3.  There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
    std::basic_string is inoperable.  std::basic_string uses __wrap_iterator
    to implement its iterators.  __wrap_iterator has been rigged up in debug
    mode to support vector.  But string hasn't been rigged up yet.  This means
    that one gets false positives when using std::string in debug mode.  I've
    upped std::string's priority in www/debug_mode.html.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 00:26:35 +00:00
Howard Hinnant
e9df0a5c6c Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which is
MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can
also define _MSC_VER, and MSVCRT is not necessarily the only C runtime,
these macros should not be used interchangeably.

This patch divides all Windows-related bits into the aforementioned
categories. Two new macros are introduced:

- _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using
  _MSC_VER, excluding Clang.
- _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default
   when _WIN32 is defined.

This leaves _WIN32 for code using the Windows API.

This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF.

Nico, please prepare a patch for CREDITS.TXT, thanks.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 18:17:34 +00:00
Howard Hinnant
56dcf0b809 Taking another swing at correctly optimizing fill_n.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 17:29:28 +00:00
Howard Hinnant
eb34122153 Constrain fill_n -> memset operations to include implicit convertibility to unsigned char. This fixes http://llvm.org/bugs/show_bug.cgi?id=16764. Also a drive-by fix on a chrono test suite bug.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187552 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 00:41:55 +00:00
Marshall Clow
a61e6f8705 Implement constexpr (n3302) and fix operator *= and /=
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187529 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 21:02:34 +00:00
Marshall Clow
0777473911 Backwards!
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187518 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 19:39:37 +00:00
Marshall Clow
832b304076 Implement n3469 - constexpr for chrono
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 19:32:19 +00:00
Howard Hinnant
f890d9bfaa Debug mode for unordered_multimap. Some mods were done for unordered_map as well to keep all the tests passing. However unordered_map is at the very least still missing tests, if not functionality (if it isn't tested, it probably isn't working).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187446 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-30 21:04:42 +00:00
Howard Hinnant
0bb0a7c9ea Debug mode for unordered_multiset. The exercise spotted a few places I had missed on unordered_set, so I picked those up as well.
There are actually two debug modes:

   1.  -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1
       This is a relatively expensive debug mode, but very thorough.  This is normally what you want to debug with, but may turn O(1) operations into O(N) operations.

   2.  -D_LIBCPP_DEBUG2=0
       This is "debug lite."  Only preconditions that can be checked with O(1) expense are checked.  For example range checking on an indexing operation.  But not iterator validity.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 19:05:47 +00:00
Marshall Clow
ff46409221 Implement N3421; comparison predicates<void>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187357 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 14:21:53 +00:00
Marshall Clow
f182038521 literal suffixes for std::chrono
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187078 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 21:18:14 +00:00
Howard Hinnant
39213641f4 Debug mode for unordered_set. I believe this to be fairly complete for
unordered_set, however it is not complete yet for unordered_multiset,
unordered_map or unordered_multimap.  There has been a lot of work done
for these other three containers, however that work was done just to
keep all of the tests passing.

You can try this out with -D_LIBCPP_DEBUG2.  You will have to link to a
libc++.dylib that has been compiled with src/debug.cpp.  So far, vector
(but not vector<bool>), list, and unordered_set are treated.  I hope to
get the other three unordered containers up fairly quickly now that
unordered_set is done.

The flag _LIBCPP_DEBUG2 will eventually be changed to _LIBCPP_DEBUG, but
not today.  This is my second effort at getting debug mode going for
libc++, and I'm not quite yet ready to throw all of the work under the
first attempt away.

The basic design is that all of the debug information is kept in a
central database, instead of in the containers.  This has been done as
an attempt to have debug mode and non-debug mode be ABI compatible with
each other.  There are some circumstances where if you construct a
container in an environment without debug mode and pass it into debug
mode, the checking will get confused and let you know with a readable
error message.  Passing containers the other way: from debug mode out to
a non-debugging mode container should be 100% safe (at least that is the
goal).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 22:01:58 +00:00
Marshall Clow
152343260f Implement string suffixes from N3642
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 17:05:24 +00:00
Howard Hinnant
cd59accbf5 Bill Fisher: This patch fixes a bug where std::regex in ECMAScript mode was ignoring capture groups inside lookahead assertions.
For example, matching /(?=(a))(a)/ to "a" should yield two captures: \1 = "a", \2 = "a"

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186954 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 16:18:04 +00:00
Richard Smith
01fbfc2fa6 Add some missing cv-qualifiers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 01:24:30 +00:00
Anders Carlsson
b8e0d9086e Fix a bug in std::fill_n where memset would end up being called in cases when it shouldn’t.
Reviewed by Howard.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186875 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22 21:08:00 +00:00
Marshall Clow
da0a0e8a1b Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22 16:02:19 +00:00
Marshall Clow
8fc4f5a251 Make std::get constexpr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186525 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-17 18:25:36 +00:00
Marshall Clow
206f6cdc33 Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 17:45:44 +00:00
Marshall Clow
01a0e90783 Make std::forward and std::move (and std::move_if_noexcept) constexpr in C++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186344 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 20:46:11 +00:00
Howard Hinnant
1e1d05121d Bill Fisher: This patch fixes an ill-formed comparison when parsing control escapes, e.g. "\cA\ca". The code will now throw an error_escape exception for invalid control sequences like "\c:" or "\c".
I've added the test cases to bad_escape.pass.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 18:21:11 +00:00
Marshall Clow
ac93d0ebf2 Add macro _LIBCPP_CONSTEXPR_AFTER_CXX11 for functions that have been marked constexpr post C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186323 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 14:57:19 +00:00
Marshall Clow
e8029e54f1 Implement n3584 - Addressing Tuples by Type
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-13 02:54:05 +00:00
Howard Hinnant
e840208989 Bill Fisher: This patch fixes a less likely case where '\b' can back up into invalid memory, when driven by a regex_iterator (for case 1, see r185273 or http://llvm.org/bugs/show_bug.cgi?id=16240)
The attached test program also supplies a test for the case 1 fix in r185273.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 15:32:55 +00:00
Marshall Clow
809e93f7f2 move __save_flags from <random> to <ios> in preparation for reuse; no functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185968 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 20:34:14 +00:00
Howard Hinnant
7670f7d1ed Bill Fisher: This patch fixes a bug where regex_iterator doesn't indicate when it's restarting in the middle of a string. This bug causes /^a/ to match in the middle of the string "aaaaaaa", during iteration.
My patch uses  to communicate when  is false.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 17:29:09 +00:00
Howard Hinnant
171771a9f5 War on tabs.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 21:06:38 +00:00
Marshall Clow
e2735d1df0 Implement n3668 - std::exchange
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 20:54:40 +00:00
Marshall Clow
d29bb4b7c4 Implement n3545 for c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185856 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 20:05:31 +00:00
Howard Hinnant
9b128e06ed Remove implicit conversion from __value_type to value_type in [unordered_][multi]map. This fixes http://llvm.org/bugs/show_bug.cgi?id=16549
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185711 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 18:06:00 +00:00
Howard Hinnant
b66e1c3f96 Removed extension in [unordered_][multi]map which allowed one to emplace using just an argument for the key, as opposed to using piecewise_construct. However a bug report exposed that this created an unfortunate ambiguity. People who are currently using the extension will be notified the next time they compile, and will have to change to using piecewise_construct. There are no ABI issues with the removal of this extension. This fixes http://llvm.org/bugs/show_bug.cgi?id=16542
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185666 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 20:59:16 +00:00
Howard Hinnant
e008d4eecc Simplify comparators of [unordered_][multi]map. This fixes http://llvm.org/bugs/show_bug.cgi?id=16538
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185665 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 19:46:35 +00:00
Marshall Clow
933afa9761 Patch for N3655 (Transformation type traits) with Howard's additions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185597 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-04 00:10:01 +00:00
Marshall Clow
42e55e932e Commit patch for integer sequences. Suggested by Richard, reworked by Howard, and annotated by me
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185569 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 19:20:30 +00:00
Howard Hinnant
24ae8f8e5b Matthew Dempsky: Attached patch replaces the type punning with memcpy(), which on
x86/x86-64 clang optimizes to direct word accesses anyway.  This fixes an unaligned word access in murmurhash/cityhash.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185558 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 17:39:28 +00:00
Marshall Clow
fb5511027b Adorn make_unique with visibility and inline attributes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185468 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 20:06:09 +00:00
Howard Hinnant
839ae58c2e Matthew Dempsky: In libc++'s <locale>, there's already dependence on an snprintf_l
implementation and all of the char buffers readily have their
allocated size available, so we can easily use snprintf_l instead of
sprintf_l.

This avoids OpenBSD's linker warnings against using sprintf and
vsprintf.
Howard:  Please consider a patch for CREDITS.TXT

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185457 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:42:28 +00:00
Howard Hinnant
6a683bfb5f Constrain launch ~ operator to defined bits.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185452 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 18:01:41 +00:00
Howard Hinnant
dbc8cf059e Bill Fisher: This patch fixes a bug where the regex parser doesn't advance the pointer after reading the third character of an octal escape (in awk mode).
That is, regex{"\141", awk} results in the regular expression /a1/ instead of just /a/.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185449 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-02 17:43:31 +00:00
Marshall Clow
fd7481e96d Implement n3656 - make_unique. Thanks to Howard for the review and suggestions.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185352 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 18:16:03 +00:00
Marshall Clow
7ec46bc422 Implement n3658 - Compile-time integer sequences
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185343 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 16:26:55 +00:00
Howard Hinnant
11b87182b0 In istream::ignore, check the delimeter as an int_type, not as a char_type, so as to correctly handle EOF. This fixes http://llvm.org/bugs/show_bug.cgi?id=16427
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185298 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 00:37:50 +00:00
Howard Hinnant
099dec1ba0 The bind and function functor constructors and assignment operators were overly general and getting confused with the copy constructor and copy assignment operators. Constrained them. This fixes http://llvm.org/bugs/show_bug.cgi?id=16385
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 00:01:51 +00:00
Howard Hinnant
c05e98660f Fix bind by making _is_valid_bind_return more robust. It should return false instead of give a compile time error, always. The problem was down in ____mu_return, the version that handles nested bind objects. This fixes http://llvm.org/bugs/show_bug.cgi?id=16343
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185289 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-30 19:48:15 +00:00
Howard Hinnant
a9602d56de Prevent '\b' from backing up into invalid memory. Fixes http://llvm.org/bugs/show_bug.cgi?id=16240. Sorry, I can not think of a good test case for this one, except by running valgrind as reported in the bug.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185273 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-29 23:45:43 +00:00
Howard Hinnant
f491e51ebd Add operators to make launch a bitmask type. Searched all of the standard, and libc++ to see if this error occurred elsewhere and didn't see any other place. This fixes http://llvm.org/bugs/show_bug.cgi?id=16207
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185265 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-29 18:38:17 +00:00
Howard Hinnant
ab135d7f4e Make cout a little more thread-safe. This fixes http://llvm.org/bugs/show_bug.cgi?id=12158
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185222 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 21:40:28 +00:00
Howard Hinnant
c1ecd97f00 Provide missing '{' in parsing extended quoted characters. This fixes http://llvm.org/bugs/show_bug.cgi?id=16135
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 20:31:05 +00:00
Howard Hinnant
e57b7c445b William Fisher: A bug in __lookahead::exec causes /(?=^)b/ to match ab. When makes a recursive call to , it passes true for the value of . This causes a beginning-of-line anchor (^) inside a lookahead assertion to match anywhere in the text. This fixes http://llvm.org/bugs/show_bug.cgi?id=11118
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185196 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 19:11:23 +00:00
Howard Hinnant
918f2a80ab Bill Fisher: Fix for failing to throw an exception in regex when parsing an invalid escape sequence. This fixes http://llvm.org/bugs/show_bug.cgi?id=16023
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185192 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:57:30 +00:00
Howard Hinnant
b9d9fb4a17 Dimitry Andric: Add const to constexpr member functions in order to cope with new C++1y language rules. This silences -Wconstexpr-not-const warnings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185181 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 18:09:35 +00:00
Howard Hinnant
9dcdcdee25 Implement full support for non-pointer pointers in custom allocators for string. This completes the custom pointer support for the entire library.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185167 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-28 16:59:19 +00:00
Howard Hinnant
2c39cbe020 Implement full support for non-pointer pointers in custom allocators for vector.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185093 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 19:35:32 +00:00
Howard Hinnant
29f7432ff3 Implement full support for non-pointer pointers in custom allocators for list.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-25 16:08:47 +00:00
Howard Hinnant
81381a932f Implement full support for non-pointer pointers in custom allocators for forward_list.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184759 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 17:17:28 +00:00
Dmitri Gribenko
c7a39cf584 Fix typo in assertion message. Reported by Shriramana Sharma.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-24 06:15:57 +00:00
Howard Hinnant
fcd8db7133 Implement full support for non-pointer pointers in custom allocators for deque.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184673 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-23 21:17:24 +00:00
Howard Hinnant
7a6b7cedcb Implement full support for non-pointer types in custom allocators. This is for the unordered containers only. This work still needs to be done on the sequence containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184635 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-22 15:21:29 +00:00
Howard Hinnant
70342b99e2 Implement full support for non-pointer types in custom allocators. This is for the associative containers only. This work still needs to be done on the unordered and sequence containers. Fixes http://llvm.org/bugs/show_bug.cgi?id=15978
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@184358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-19 21:29:40 +00:00
Howard Hinnant
9360e9f944 Minor bug fix for allowing an extension of const-qualified types in containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@183481 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 01:56:37 +00:00
Howard Hinnant
ddb4e4cbb1 Neglected to remove a debugging comment from last commit.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@182422 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21 21:19:35 +00:00
Howard Hinnant
8f72d5ce16 Fix a couple of bugs in linear_congruential_engine::seed. Regression test added.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@182421 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-21 21:05:12 +00:00
Joerg Sonnenberger
a71a952634 Add NetBSD support.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@182162 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 21:17:34 +00:00
Howard Hinnant
9e98b34a8c Glen: This patch gets the string conversion functions working on Windows. It also refactors repetitive code in string.cpp do greatly reduce the repetitiveness, increasing maintainability.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@182026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-16 17:13:40 +00:00
Howard Hinnant
6287c65a03 Remove cv qualifiers from member pointers in the __member_pointer_traits test. This was causing a const-qualified bind result to malfunction. This was a recent regression due to the new use of __member_pointer_traits in restricting the __invokable and __invoke_of tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181935 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-15 21:49:27 +00:00
David Blaikie
e27e907403 Fixing the MSan/compiler-rt build
Patch by Evgieniy Stepanov, review by İsmail Dönmez.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-13 21:53:44 +00:00
Howard Hinnant
b3585e8226 İsmail Dönmez: Enable quick_exit on linux.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181612 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-10 17:36:59 +00:00
Marshall Clow
9f8f524541 Fix incorrect type usage; nice catch by Sebastian
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181569 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-10 00:16:10 +00:00
Marshall Clow
b30abdd07a Implement n3607: 'equal', 'mismatch', and 'is_permutation'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181548 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 21:14:23 +00:00
Howard Hinnant
a7f5c1bcd8 Put a 1-character unget buffer into cin. This fixes http://llvm.org/bugs/show_bug.cgi?id=15867
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181470 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-08 21:18:42 +00:00
Howard Hinnant
ecc9742f27 Constrain __invoke functions more accurately. This fixes http://llvm.org/bugs/show_bug.cgi?id=15861 .
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181377 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 23:40:12 +00:00
Howard Hinnant
5f1286f574 Introduce _LIBCPP_STD_VER. This can be set by the client (or the clang driver). Or it will be defaulted. The default is 11 if -std= c++11 or eariler, else it will default to the current year modulo the century. We anticipate it defaulting to 14 for C++14 when the time comes. For now, post-C++11 libcxx implementations should protect themselves with #if _LIBCPP_STD_VER > 11.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181347 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 20:16:13 +00:00
Howard Hinnant
8c23819220 Expose accidentally removed __compressed_pair constructor taking piecewise_construct_t. This fixes http://llvm.org/bugs/show_bug.cgi?id=15918 .
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181217 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-06 16:58:36 +00:00
Howard Hinnant
74f4da7219 Stephan Tolksdorf: fixes the issue in the <atomic> header and adds corresponding tests. I've used macros to fall back to a user-provided default constructor if _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS (though I suspect that there won't be many users defining that macro).
The tests use placement new to check that atomic values get properly zero-initialized. I had to modify the atomic_is_lock_free test, because default initialization of an object of const type 'const A' (aka 'const atomic<int>') requires a user-provided default constructor.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180945 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 20:18:43 +00:00
Howard Hinnant
15467189c3 This patch introduces an alternative layout for basic_string which when the string is short, the data pointer will be word-aligned. It can be activated with -D_LIBCPP_ALTERNATE_STRING_LAYOUT. These two different layouts (the default and _LIBCPP_ALTERNATE_STRING_LAYOUT) are not ABI compatible with each other. Once one is chosen for a given platform, it is disruptive to change it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180811 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-30 21:44:48 +00:00
Joerg Sonnenberger
155f06018e Use protected version of the malloc attribute in case source wants to
define malloc as macro.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180727 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 19:52:08 +00:00
Joerg Sonnenberger
a9b94f1337 GCC doesn't support __has_attribute.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180683 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27 20:51:42 +00:00
Howard Hinnant
05e7d24b3d default_delete needs a static_assert against void types. I had previously thought that sizeof(void) would take care of this. I was wrong.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-24 19:44:26 +00:00
Howard Hinnant
08dd25303e Modest performance improvement for std::string's operator==.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180072 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22 23:55:13 +00:00
Howard Hinnant
5544f7e0c7 Somehow aligned_union got dropped through the cracks. This adds it. Did a drive-by fix of alignment_of while I was in the neighborhood.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-22 19:37:49 +00:00
Howard Hinnant
b4e67cfd42 After years of telling people: 'If you ever find any of my code that self-move-assigns, send me a bug report.' Somebody finally took me up on it. vector::erase(begin(), begin()) does a self-move-assign of every element in the vector, leaving all of those elements in an unspecified state. I checked the other containers for this same bug and did not find it. Added test case.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-18 15:02:57 +00:00
Howard Hinnant
4313ec3975 addressof misbehaving for type with an implicit conversion operator to char&. This fixes http://llvm.org/bugs/show_bug.cgi?id=15754
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179608 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16 17:27:56 +00:00
Howard Hinnant
ae57a1ab1d Numeric parsing was getting the wrong answer when faced with very long inputs. This fixes both http://llvm.org/bugs/show_bug.cgi?id=15751 and http://llvm.org/bugs/show_bug.cgi?id=15740
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-15 20:40:06 +00:00
Howard Hinnant
993248935c Accidentally disallowed explicit tuple conversions when all elements of the tuple can be explicitly converted.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179467 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-14 00:01:13 +00:00
Howard Hinnant
4f67100219 Set failbit when strtold sets errno to ERANGE when parsing floating point values.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179461 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-13 18:19:25 +00:00
Howard Hinnant
a5733b3ad3 Ruben Van Boxem: Turn islower_l and isupper_l into functions (instead of macros) on Windows only to quell a warning during libc++ building.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179408 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-12 20:22:57 +00:00
Howard Hinnant
0795931dee Change <cwchar> and <cstring> to look out for flags which may or may not be set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-08 18:59:28 +00:00
Howard Hinnant
6dcaf3ee1a Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 17:58:52 +00:00
Howard Hinnant
79a35570a5 More work on debug mode for list.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178819 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 00:18:49 +00:00
Howard Hinnant
128f7bf4fa Somehow search_n never got tested, so of course it had a bug in it. This fixes http://llvm.org/bugs/show_bug.cgi?id=15667.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178764 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-04 15:40:48 +00:00
Howard Hinnant
c5e8961a35 Fix stupid but harmless type-o. Fixes http://llvm.org/bugs/show_bug.cgi?id=15657.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178691 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03 20:29:45 +00:00
Howard Hinnant
4aa8b06e67 The move / swap members were not correctly taking all of the possible states of the basic_stringbuf into account. Just rewrote these members. Test included. This fixes http://llvm.org/bugs/show_bug.cgi?id=15659.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178690 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-03 20:21:29 +00:00
Howard Hinnant
cf31d3864e Reference: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077133.html
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 22:14:51 +00:00
Howard Hinnant
11a50ac497 Richard Smith: It was pointed out to me off-list that libc++'s non-compiler-builtin
implementation of std::is_polymorphic does this:

template <class _Tp> struct __is_polymorphic1 : public _Tp {};

... and that g++ rejects this if _Tp has an inaccessible virtual destructor
(because __is_polymorphic1<_Tp> would have a deleted virtual destructor
overriding _Tp's non-deleted destructor). Clang was failing to reject this;
I've fixed that in r178563, but that causes libc++'s corresponding test
case to fail with both clang and gcc when using the fallback
implementation. The fallback code also incorrectly rejects final types.

The attached patch fixes the fallback implementation of is_polymorphic; we
now use dynamic_cast's detection of polymorphic class types rather than
trying to determine if adding a virtual function makes the type larger:

  enable_if<sizeof((_Tp*)dynamic_cast<const volatile
void*>(declval<_Tp*>())) != 0, ...>

Two things of note here:
* the (_Tp*) cast is necessary to work around bugs in Clang and g++ where
we otherwise don't instantiate the dynamic_cast (filed as PR15656)
* the 'const volatile' is here to treat is_polymorphic<cv T> as true for a
polymorphic class type T -- my reading of the standard suggests this is
incorrect, but it matches our builtin __is_polymorphic and gcc


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178576 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 21:25:06 +00:00
Howard Hinnant
fc2f021bdd Bruce Mitchener, Jr.: Port to emscripten. Fixes http://llvm.org/bugs/show_bug.cgi?id=15624.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178354 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 18:27:28 +00:00
Howard Hinnant
742fecbd2a Second try at r178075. The llvm breakage has been fixed by r178240.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178253 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 17:44:32 +00:00
Howard Hinnant
2c0d3edf68 Add missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-28 15:00:04 +00:00
Daniel Dunbar
34d36f39b0 Revert r178075, "Tighten up the iterator requirements ...", it breaks LLVM
bootstrap with libc++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178116 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-27 04:10:25 +00:00
Howard Hinnant
32d40f5f44 Tighten up the iterator requirements for the vector member templates. This is especially important for the constructors so that is_constructible<vector<T>, I, I> gives the right answer when T can not be constructed from *I. Test case included for this latter point.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 21:40:54 +00:00
Howard Hinnant
02d5e18917 Another vector debug mode test, and a static test on Allocator::value_type. This partially addresses http://llvm.org/bugs/show_bug.cgi?id=15576.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178064 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 19:04:56 +00:00
Howard Hinnant
d9cdb2dcfd Need one more swap overload for swapping two lvalue vector<bool>::reference's.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178016 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-26 13:48:57 +00:00
Howard Hinnant
782da33d1c Added debug tests for indexing, pop_back and both forms of erase. Added an improved error message for erasing a single element with end().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177929 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 22:12:26 +00:00
Howard Hinnant
f5f4684e71 Debug mode: learning to crawl. I need to set up some tests that actually test that the debug mode is working, but that won't cause problems when debug mode isn't on. This is my first prototype of such a test. It should call std::terminate() because it's comparing iterators from different containers. And std::terminate() is rigged up to exit normally. If debug mode fails, and doesn't call terminate, then the program asserts. The test is a no-op if _LIBCPP_DEBUG2 is not defined or is defined to be 0.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177892 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-25 19:29:35 +00:00
Marshall Clow
9b145da078 Fix buffer read overflow in money_get::do_get(). Found by UBSan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177694 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 02:14:40 +00:00
Marshall Clow
04bd79b23a Fix undefined behavior in syntax_option_type::operator~ and match_flag_type::operator./a.out Found by UBSan
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177693 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-22 02:13:55 +00:00
Howard Hinnant
903439f735 This is an optimization which produces improved launching time. There should be no functionality change. Clients should see no ABI differences.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177443 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-19 21:34:48 +00:00