Commit Graph

1214 Commits

Author SHA1 Message Date
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
312926eed4 Matthew Dempsky: POSIX defines that the _POSIX_C_SOURCE macros are to be set by user
code to specify what version of POSIX the system should provide.  If
you want to check what version of POSIX is actually available, you're
supposed to test _POSIX_VERSION.

However, since sysconf() has been in POSIX since 1995, it's probably
safe to assume it's available on any system with a C++11 compiler,
especially if _SC_NPROCESSORS_ONLN is defined too.  So no point in a
complicated preprocessor rule if just we unconditionally include
<unistd.h> (on non-Windows systems).

Also, I've added a #warning for to help porters detect when a suitable
implementation isn't detected at compile-time.

Howard:  Matthew, can you patch CREDITS.TXT?  Thanks.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185275 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-30 00:14:43 +00:00
Howard Hinnant
09ca5d49e1 Matthew Dempsky: Same as stdexcept.cpp in libc++abi: we've already computed 'len strlen(msg)', so we can use memcpy() instead of strcpy().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185274 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-29 23:53:20 +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
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
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
Joerg Sonnenberger
67444034ed Create a weak pthread_create reference on NetBSD to not force a
dependency on libpthread for code that doesn't use threads itself.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@182161 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-17 21:16:18 +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
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
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
Joerg Sonnenberger
be764c946c Don't try to free the C locale.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 23:06:35 +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
Joerg Sonnenberger
5328cd307c Initialize codecvt explicitly with the C locale, which might not be 0.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@181534 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-09 19:00:18 +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
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
e58bc12f2a The push/pop variant of pragma GCC diagnostic is only supported by Clang
and GCC 4.6 and newer, so protect accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180943 91177308-0d34-0410-b5e6-96231b3b80d8
2013-05-02 19:34:26 +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
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
867deb8e06 Add entry for myself.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180728 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-29 19:55:32 +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
Joerg Sonnenberger
912438c272 Use static_cast.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180680 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27 19:13:31 +00:00
Joerg Sonnenberger
d3b5b6b9f4 Use reinterpret_casts directly in place of C-style casts.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180679 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27 19:12:36 +00:00
Joerg Sonnenberger
006ab1e213 Only use Clang pragma when compiling with clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@180678 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-27 19:10:15 +00:00