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
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
Howard Hinnant
eaffd0a8ff
XFAIL this test on 10.7 and 10.8
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185391 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-01 22:59:14 +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
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
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
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
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
ee749a403c
Test case for r183481.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@183522 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-07 14:24:18 +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
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 Dean
bb3a0acf93
XFAIL this test when using the darwin12 system library. Reviewed by Howard
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181610 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-10 17:25:57 +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
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
dd854b2c4e
Mark some tests with XFAIL for Lion and Mountain Lion.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181336 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-07 17:37:19 +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
Joerg Sonnenberger
34cb066fa2
Make it possible to provide special (linker) flags for the thread tests.
...
Use it to build & link against libpthread on NetBSD for tests iff they
are testing the thread interface.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180942 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 19:21:36 +00:00
Joerg Sonnenberger
63d8f7e341
Add explicit casts to unsigned char before calling ctype functions.
...
Fixes the value range on platforms with signed char.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180940 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 19:17:48 +00:00
Howard Hinnant
a5f0e6c5c1
İsmail Dönmez: Change to mktemp template to make it compatible with Linux.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-25 16:08:55 +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
Joerg Sonnenberger
c5e6aa5f5c
Avoid bash specific functionality to work with any POSIX shell
...
implementing $(( )).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-23 19:53:24 +00:00
Howard Hinnant
9c2ce95063
Zero-initialize all mbstate_t in the codecvt tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180108 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-23 14:09:35 +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
2062f37772
I believe this finishes up debug mode for list. The testing is a little weak, but I believe all of the functionality is there. Certainly enough for people to checkout and start beating up on.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@179632 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-16 21:42:36 +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
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
e1e96cb840
More list debug mode tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178873 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-05 15:04:10 +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
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
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
d4c96a6c89
Some debug test cases for list.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178565 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 19:53:32 +00:00
Howard Hinnant
9d00ed5d87
Test case was forming the wrong limits when size_t != unsigned long.
...
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178370 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-29 21:22:22 +00:00