Commit Graph

404 Commits

Author SHA1 Message Date
Howard Hinnant 1836462545 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
llvm-svn: 185265
2013-06-29 18:38:17 +00:00
Howard Hinnant 3f75953d82 Provide missing '{' in parsing extended quoted characters. This fixes http://llvm.org/bugs/show_bug.cgi?id=16135
llvm-svn: 185211
2013-06-28 20:31:05 +00:00
Howard Hinnant 8d1e822432 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
llvm-svn: 185196
2013-06-28 19:11:23 +00:00
Howard Hinnant 21246e3314 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
llvm-svn: 185192
2013-06-28 18:57:30 +00:00
Howard Hinnant eec721826c Implement full support for non-pointer pointers in custom allocators for string. This completes the custom pointer support for the entire library.
llvm-svn: 185167
2013-06-28 16:59:19 +00:00
Howard Hinnant 3ec1f00b73 Implement full support for non-pointer pointers in custom allocators for vector.
llvm-svn: 185093
2013-06-27 19:35:32 +00:00
Howard Hinnant 866d4efa7f Implement full support for non-pointer pointers in custom allocators for list.
llvm-svn: 184859
2013-06-25 16:08:47 +00:00
Howard Hinnant 8a27ba8051 Implement full support for non-pointer pointers in custom allocators for forward_list.
llvm-svn: 184759
2013-06-24 17:17:28 +00:00
Howard Hinnant 14e200d14d Implement full support for non-pointer pointers in custom allocators for deque.
llvm-svn: 184673
2013-06-23 21:17:24 +00:00
Howard Hinnant 307f814372 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.
llvm-svn: 184635
2013-06-22 15:21:29 +00:00
Howard Hinnant 07d3eccd26 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
llvm-svn: 184358
2013-06-19 21:29:40 +00:00
Howard Hinnant e7b6d544f0 Test case for r183481.
llvm-svn: 183522
2013-06-07 14:24:18 +00:00
Howard Hinnant 849821cffb Fix a couple of bugs in linear_congruential_engine::seed. Regression test added.
llvm-svn: 182421
2013-05-21 21:05:12 +00:00
Howard Hinnant 0125ab809f 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.
llvm-svn: 181935
2013-05-15 21:49:27 +00:00
David Dean a9ac518364 XFAIL this test when using the darwin12 system library. Reviewed by Howard
llvm-svn: 181610
2013-05-10 17:25:57 +00:00
Marshall Clow 0b0bbd2f22 Implement n3607: 'equal', 'mismatch', and 'is_permutation'
llvm-svn: 181548
2013-05-09 21:14:23 +00:00
Howard Hinnant 866ed94db1 Constrain __invoke functions more accurately. This fixes http://llvm.org/bugs/show_bug.cgi?id=15861 .
llvm-svn: 181377
2013-05-07 23:40:12 +00:00
Howard Hinnant 6b1455f6f1 Mark some tests with XFAIL for Lion and Mountain Lion.
llvm-svn: 181336
2013-05-07 17:37:19 +00:00
Howard Hinnant eedfabd96e Expose accidentally removed __compressed_pair constructor taking piecewise_construct_t. This fixes http://llvm.org/bugs/show_bug.cgi?id=15918 .
llvm-svn: 181217
2013-05-06 16:58:36 +00:00
Howard Hinnant da9ca0b405 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.

llvm-svn: 180945
2013-05-02 20:18:43 +00:00
Joerg Sonnenberger 087e35ec03 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.

llvm-svn: 180942
2013-05-02 19:21:36 +00:00
Joerg Sonnenberger aa05f9eaf3 Add explicit casts to unsigned char before calling ctype functions.
Fixes the value range on platforms with signed char.

llvm-svn: 180940
2013-05-02 19:17:48 +00:00
Howard Hinnant a2ee3a6e2e İsmail Dönmez: Change to mktemp template to make it compatible with Linux.
llvm-svn: 180267
2013-04-25 16:08:55 +00:00
Howard Hinnant 03ec04f9b5 default_delete needs a static_assert against void types. I had previously thought that sizeof(void) would take care of this. I was wrong.
llvm-svn: 180213
2013-04-24 19:44:26 +00:00
Joerg Sonnenberger 4341ad3500 Avoid bash specific functionality to work with any POSIX shell
implementing $(( )).

llvm-svn: 180139
2013-04-23 19:53:24 +00:00
Howard Hinnant f8bb3e522d Zero-initialize all mbstate_t in the codecvt tests.
llvm-svn: 180108
2013-04-23 14:09:35 +00:00
Howard Hinnant 20428e94e0 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.
llvm-svn: 180036
2013-04-22 19:37:49 +00:00
Howard Hinnant ab65a6f560 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.
llvm-svn: 179760
2013-04-18 15:02:57 +00:00
Howard Hinnant 9a20da75ef 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.
llvm-svn: 179632
2013-04-16 21:42:36 +00:00
Howard Hinnant c76d2bda6f addressof misbehaving for type with an implicit conversion operator to char&. This fixes http://llvm.org/bugs/show_bug.cgi?id=15754
llvm-svn: 179608
2013-04-16 17:27:56 +00:00
Howard Hinnant e7389a6915 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
llvm-svn: 179556
2013-04-15 20:40:06 +00:00
Howard Hinnant f3b02b17af Accidentally disallowed explicit tuple conversions when all elements of the tuple can be explicitly converted.
llvm-svn: 179467
2013-04-14 00:01:13 +00:00
Howard Hinnant 40487ca25e Set failbit when strtold sets errno to ERANGE when parsing floating point values.
llvm-svn: 179461
2013-04-13 18:19:25 +00:00
Howard Hinnant f750923161 Fix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.
llvm-svn: 178892
2013-04-05 17:58:52 +00:00
Howard Hinnant 1b81829979 More list debug mode tests.
llvm-svn: 178873
2013-04-05 15:04:10 +00:00
Howard Hinnant b0e4c9d01b More work on debug mode for list.
llvm-svn: 178819
2013-04-05 00:18:49 +00:00
Howard Hinnant b13fcad677 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.
llvm-svn: 178764
2013-04-04 15:40:48 +00:00
Howard Hinnant 1347d33451 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.
llvm-svn: 178690
2013-04-03 20:21:29 +00:00
Howard Hinnant 575e4e3650 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

llvm-svn: 178576
2013-04-02 21:25:06 +00:00
Howard Hinnant 70e19bd31e Some debug test cases for list.
llvm-svn: 178565
2013-04-02 19:53:32 +00:00
Howard Hinnant cf1dc8d39e Test case was forming the wrong limits when size_t != unsigned long.
llvm-svn: 178370
2013-03-29 21:22:22 +00:00
Howard Hinnant 84718fde7a The 3rd test in shrink_to_fit.pass.cpp can't possibly pass if exceptions are disabled, so #ifdef'ing out the test.
llvm-svn: 178350
2013-03-29 17:20:04 +00:00
Daniel Dunbar 15eaebea15 Revert r178075, "Tighten up the iterator requirements ...", it breaks LLVM
bootstrap with libc++.

llvm-svn: 178116
2013-03-27 04:10:25 +00:00
Howard Hinnant 5a13d8dcea 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.
llvm-svn: 178075
2013-03-26 21:40:54 +00:00
Howard Hinnant cd4a9fd301 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.
llvm-svn: 178064
2013-03-26 19:04:56 +00:00
Howard Hinnant 1d8a5164b4 More vector debug tests.
llvm-svn: 178033
2013-03-26 15:45:56 +00:00
Marshall Clow a6d24cc19d Fixed race conditions in thread tests; exposed by UBSan
llvm-svn: 178029
2013-03-26 15:28:33 +00:00
Howard Hinnant ea95898f29 Simply debug mode tests per Dmitri Gribenko's suggestion.
llvm-svn: 178026
2013-03-26 14:28:25 +00:00
Howard Hinnant d9db9f90fb Need one more swap overload for swapping two lvalue vector<bool>::reference's.
llvm-svn: 178016
2013-03-26 13:48:57 +00:00
Howard Hinnant ea1bbbd135 Added debug tests for indexing, pop_back and both forms of erase. Added an improved error message for erasing a single element with end().
llvm-svn: 177929
2013-03-25 22:12:26 +00:00