Howard Hinnant
210051548e
Modest performance improvement for std::string's operator==.
...
llvm-svn: 180072
2013-04-22 23:55:13 +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
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
24afdf71c1
Ruben Van Boxem: Turn islower_l and isupper_l into functions (instead of macros) on Windows only to quell a warning during libc++ building.
...
llvm-svn: 179408
2013-04-12 20:22:57 +00:00
Howard Hinnant
98381453c0
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.
...
llvm-svn: 179041
2013-04-08 18:59:28 +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
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
ea48b6dcd0
Fix stupid but harmless type-o. Fixes http://llvm.org/bugs/show_bug.cgi?id=15657 .
...
llvm-svn: 178691
2013-04-03 20:29:45 +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
459448241a
Reference: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077133.html
...
llvm-svn: 178581
2013-04-02 22:14:51 +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
9cb970074f
Bruce Mitchener, Jr.: Port to emscripten. Fixes http://llvm.org/bugs/show_bug.cgi?id=15624 .
...
llvm-svn: 178354
2013-03-29 18:27:28 +00:00
Howard Hinnant
b3adefc34c
Second try at r178075. The llvm breakage has been fixed by r178240.
...
llvm-svn: 178253
2013-03-28 17:44:32 +00:00
Howard Hinnant
a4d35ce2bf
Add missing #ifndef _LIBCPP_NO_EXCEPTIONS around throw in include/thread.
...
llvm-svn: 178237
2013-03-28 15:00: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
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
Howard Hinnant
92bd7c0337
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.
...
llvm-svn: 177892
2013-03-25 19:29:35 +00:00
Marshall Clow
c962cdf8a5
Fix buffer read overflow in money_get::do_get(). Found by UBSan
...
llvm-svn: 177694
2013-03-22 02:14:40 +00:00
Marshall Clow
1c2c986796
Fix undefined behavior in syntax_option_type::operator~ and match_flag_type::operator./a.out Found by UBSan
...
llvm-svn: 177693
2013-03-22 02:13:55 +00:00
Howard Hinnant
591ebe3cbb
This is an optimization which produces improved launching time. There should be no functionality change. Clients should see no ABI differences.
...
llvm-svn: 177443
2013-03-19 21:34:48 +00:00
Marshall Clow
69e76f80e2
Removed raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now just check to see if they are defined.
...
llvm-svn: 177310
2013-03-18 19:34:07 +00:00
Marshall Clow
7415c8b171
Removed raw references to _MSC_VER; now just check to see if it is defined.
...
llvm-svn: 177304
2013-03-18 18:20:48 +00:00
Marshall Clow
b56e8587af
Removed raw references to __APPLE__; now just check to see if it is defined.
...
llvm-svn: 177297
2013-03-18 17:45:34 +00:00
Marshall Clow
91907cbe82
Removed raw references to _WIN32; now just check to see if it is defined.
...
llvm-svn: 177291
2013-03-18 17:04:29 +00:00
Howard Hinnant
41801f14ed
This SO question: http://stackoverflow.com/questions/15344402/how-can-i-read-a-0xff-in-a-file-with-libc-istream-iterator/15347225#15347225 highlighted the lack of a cast in the implementation of std::cin. Added. I unfortunately don't have a test case to add to the suite since this bug only shows itself when using std::cin. The current testsuite setup does not have a way a good way to test std::cin.
...
llvm-svn: 176822
2013-03-11 19:53:48 +00:00
Howard Hinnant
7e4844b353
Parsing floating point numbers with very long precision was broken, and this patch fixes it. This fixes http://llvm.org/bugs/show_bug.cgi?id=15445 .
...
llvm-svn: 176711
2013-03-08 19:06:24 +00:00
Howard Hinnant
c60bf548c5
Albert Wong: definition for regex_traits<_CharT>::__regex_word.
...
llvm-svn: 176640
2013-03-07 19:38:08 +00:00
Howard Hinnant
ead480d30a
Change _LIBCPP_TYPE_VIS to use __type_visibility__(default) instead of __visibility__(default) when available. This change makes just the type_info visible so that types like vectors and strings can be used as exception objects across dylib boundaries even when hidden visibility is specified globally (at the command line), and yet this allows clients to hide the member functions of things like vector and string (with global visibility commands).
...
llvm-svn: 176639
2013-03-07 19:25:03 +00:00
Howard Hinnant
6e41256f68
No functionality change at this time. I've split _LIBCPP_VISIBLE up into two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute.
...
llvm-svn: 176593
2013-03-06 23:30:19 +00:00
Howard Hinnant
65f58f3fe8
Have basic_istream::read call sgetn intead of sbumpc individual characters. This addresses http://llvm.org/bugs/show_bug.cgi?id=15427 .
...
llvm-svn: 176573
2013-03-06 19:27:56 +00:00
Howard Hinnant
3fb6c6e50d
Correct silly type-o. Thanks Richard.
...
llvm-svn: 176568
2013-03-06 18:16:12 +00:00
Howard Hinnant
53b9ee061f
The bitset(unsigned long long) constructor was broken by the constexpr additions only on 32 bit platforms. Fixed. This addresses http://llvm.org/bugs/show_bug.cgi?id=15444 .
...
llvm-svn: 176559
2013-03-06 17:30:26 +00:00
Howard Hinnant
a9f698009f
Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.
...
llvm-svn: 176026
2013-02-25 15:50:36 +00:00
Howard Hinnant
c0c9748c11
Constrain bind operator()() to not exist if the call is not valid. Fixes http://llvm.org/bugs/show_bug.cgi?id=15295 .
...
llvm-svn: 175774
2013-02-21 18:16:55 +00:00
Marshall Clow
b6e5f854f5
Change the 'result_type' from unsigned to 'uint_fast32_t'. This eliminates truncation warnings on Linux
...
llvm-svn: 174669
2013-02-07 22:12:02 +00:00
Howard Hinnant
aba500d633
Revert accidental check-in. These changes are probably good, but premature at this point.
...
llvm-svn: 174625
2013-02-07 15:31:44 +00:00
Howard Hinnant
804f9116e5
Michael van der Westhuizen: The attached patch add support for building against libc++abi and libcxxrt to CMake builds of libc++.
...
Usage (with the appropriate CC and CXX environment variables) is:
$ cmake -DLIBCXX_CXX_ABI=libcxxabi '-DLIBCXX_LIBCXXABI_INCLUDE_PATHS=/home/michael/libcxxabi/include' ../libcxx
and:
$ cmake -DLIBCXX_CXX_ABI=libcxxrt '-DLIBCXX_LIBCXXRT_INCLUDE_PATHS=/home/michael/libcxxrt/src' ../libcxx
llvm-svn: 174623
2013-02-07 15:27:39 +00:00
Howard Hinnant
d3d4356f6e
Marcin Zalewski: Change the name of a template parameter in __copy_backward from _InputIterator to _BidirectionalIterator to better document the intent of the algorithm.
...
llvm-svn: 174544
2013-02-06 21:03:39 +00:00
Howard Hinnant
2446649c1e
Saleem Abdulrasool: If errno is defined as volatile int, the qualifier differences can cause
...
template typename deductions on swap<> (used in string.cpp). Use
decltype(errno) to replicate the type and qualifier information for holding the
errno value. Because errno is expected to be assignable, there is no need to
use typename std::remove_const<decltype(errno)>::type to hold the value.
llvm-svn: 173172
2013-01-22 17:26:08 +00:00
Howard Hinnant
ead15d1f95
Implement the ATOMIC_*_LOCK_FREE macros.
...
llvm-svn: 173084
2013-01-21 20:39:41 +00:00
Howard Hinnant
8d3e797444
Donated anonymously: This enables GCC 4.8.0 to build libc++.
...
llvm-svn: 173060
2013-01-21 17:26:55 +00:00
Howard Hinnant
3d7eb2f806
Optimize basic_ostream::write by having it call sputn instead of sputc.
...
llvm-svn: 172542
2013-01-15 17:22:03 +00:00