Commit Graph

561 Commits

Author SHA1 Message Date
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
Marshall Clow
53e2763966 Removed raw references to __sun__, __FreeBSD__, __GLIBC__ and __linux__; now just check to see if they are defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177310 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 19:34:07 +00:00
Marshall Clow
dab9b2eb32 Removed raw references to _MSC_VER; now just check to see if it is defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177304 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 18:20:48 +00:00
Marshall Clow
dece7fe670 Removed raw references to __APPLE__; now just check to see if it is defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177297 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:45:34 +00:00
Marshall Clow
a22d2addb1 Removed raw references to _WIN32; now just check to see if it is defined.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@177291 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-18 17:04:29 +00:00
Howard Hinnant
c789025a5a 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176822 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-11 19:53:48 +00:00
Howard Hinnant
6319f1462d 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176711 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-08 19:06:24 +00:00
Howard Hinnant
23fb972520 Albert Wong: definition for regex_traits<_CharT>::__regex_word.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176640 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 19:38:08 +00:00
Howard Hinnant
707f318787 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).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176639 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-07 19:25:03 +00:00
Howard Hinnant
83eade6abb 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 23:30:19 +00:00
Howard Hinnant
cc7bdae931 Have basic_istream::read call sgetn intead of sbumpc individual characters. This addresses http://llvm.org/bugs/show_bug.cgi?id=15427.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176573 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 19:27:56 +00:00
Howard Hinnant
3101474720 Correct silly type-o. Thanks Richard.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176568 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 18:16:12 +00:00
Howard Hinnant
11a31d0583 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.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176559 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-06 17:30:26 +00:00
Howard Hinnant
4a0e74fff8 Alexey Samsonov: #ifdefs out undefined function in static build of libc++ w/o RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@176026 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-25 15:50:36 +00:00
Howard Hinnant
0560f786fe Constrain bind operator()() to not exist if the call is not valid. Fixes http://llvm.org/bugs/show_bug.cgi?id=15295.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@175774 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-21 18:16:55 +00:00
Marshall Clow
5920cfc403 Change the 'result_type' from unsigned to 'uint_fast32_t'. This eliminates truncation warnings on Linux
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174669 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 22:12:02 +00:00
Howard Hinnant
635bbbb6d1 Revert accidental check-in. These changes are probably good, but premature at this point.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174625 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 15:31:44 +00:00
Howard Hinnant
46c49d19aa 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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174623 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-07 15:27:39 +00:00
Howard Hinnant
b73568dc24 Marcin Zalewski: Change the name of a template parameter in __copy_backward from _InputIterator to _BidirectionalIterator to better document the intent of the algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@174544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-06 21:03:39 +00:00
Howard Hinnant
54e2fff2e1 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@173172 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 17:26:08 +00:00
Howard Hinnant
7b9d6a8d40 Implement the ATOMIC_*_LOCK_FREE macros.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@173084 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 20:39:41 +00:00
Howard Hinnant
78f0de22db Donated anonymously: This enables GCC 4.8.0 to build libc++.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@173060 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-21 17:26:55 +00:00
Howard Hinnant
0b93963db7 Optimize basic_ostream::write by having it call sputn instead of sputc.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@172542 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-15 17:22:03 +00:00
Howard Hinnant
b05a55675f Make <cmath> classification macros work with integral types.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@172461 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 20:56:22 +00:00
Howard Hinnant
1b031c947f Fix a race in the construction of future. This fixes http://llvm.org/bugs/show_bug.cgi?id=14934.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@172456 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 20:01:24 +00:00
Howard Hinnant
750039f50c Michael van der Westhuizen: Patches for Linux. Fixes http://llvm.org/bugs/show_bug.cgi?id=14648.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@172435 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-14 17:07:27 +00:00
Howard Hinnant
f619e230cc Fix exception safety bug in vector::push_back
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@172250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-11 20:36:59 +00:00
Howard Hinnant
6ae47055f9 atomic_bool was missing (just a typedef to atomic<bool>).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171498 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-04 18:58:50 +00:00
Howard Hinnant
352bd3a273 Klaas de Vries: Fix bug in libc++'s std::string::find_first_not_of.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171321 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 20:09:48 +00:00
Chandler Carruth
ed9f69d342 Don't mark variadic functions as always inline -- they cannot in fact be
inlined.

Patch by Saleem Abdulrasool, reviewed by Michael Spencer and Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171276 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-31 06:09:54 +00:00
Howard Hinnant
d1a7479763 Remove test for eof from istreambuf_iterator constructors. It is no longer necessary and potentially violates the constructor's noexcept spec.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@171232 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-29 17:45:42 +00:00
Howard Hinnant
ee717d8c44 Hyeon-Bin Jeong: readsome() need to reset gcount to zero. This fixes http://llvm.org/bugs/show_bug.cgi?id=14670.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170703 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 15:40:28 +00:00
Richard Smith
b2f2b68143 Implement std::is_base_of for the case where we don't have a compiler
intrinsic. This relies upon the fact that overload resolution does not check
access and ambiguity for a derived-to-base conversion. This passes all
is_base_of tests in the test suite.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170662 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-20 04:20:28 +00:00
Marshall Clow
a46482e8bb Added static_assert to std::get<N>(std::array) calls to catch "out of bounds" calls
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170435 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-18 16:46:30 +00:00
Howard Hinnant
0a69fa14d2 Zhang Xiongpang: Add definitions for const data members. Fixes http://llvm.org/bugs/show_bug.cgi?id=14585.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-12-12 21:14:28 +00:00
Richard Smith
53008d8b0c Remove 'noreturn' attribute from friend declaration. This attribute will be
inherited from the previous out-of-class declaration, and attributes on friend
function declarations are ill-formed in C++11.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@168853 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-29 04:30:50 +00:00
Howard Hinnant
8a9c5ea750 Dimitry Andric: When using libc++ headers on FreeBSD, in combination with -std=c++98,
-ansi or -std=c++03, the long long type is not supported.  So in this
case, several functions and types, like lldiv_t, strtoll(), are not
declared.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@168610 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-26 21:18:17 +00:00
Howard Hinnant
984f10fdc0 istreambuf_iterator increment should call sbumpc instead of snextc. Patch
by Kimball Thurston.  This fixes http://llvm.org/bugs/show_bug.cgi?id=14358.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@168209 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 22:17:23 +00:00
Howard Hinnant
537b2fa6b8 Restrict optimized __pad_and_output implementation detail to desired releases.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167980 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-14 21:17:15 +00:00
Howard Hinnant
0919dbaab3 Dimitry Andric: Silence some miscellaneous warnings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167493 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 21:55:44 +00:00
Howard Hinnant
9bae2a9dc5 Dimitry Andric: Silence some warnings in <locale>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167492 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 21:48:33 +00:00
Howard Hinnant
9d5e9d3d66 Enable the tuple interface of pair in C++03 mode.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167491 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 21:42:45 +00:00
Howard Hinnant
ff9267709d Provide a way to disable use of extern templates in libc++. This is intended for the clients of libc++, not the libc++ build. The dylib should always contain the extern templates. To disable the client needs to put -D'_LIBCPP_EXTERN_TEMPLATE(...)=' on the command line.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167486 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-06 21:08:48 +00:00
Howard Hinnant
73c85c7725 peek should set eofbit if sgetc() returns eof.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167238 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 17:32:07 +00:00
Howard Hinnant
4af2cf38f0 Richard Smith: This fixes a problem in std::is_constructible for incomplete types, and those types with a user-defined operator,().
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167233 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-01 16:32:14 +00:00
Howard Hinnant
9c0df1416f Rename uses of _ and __ because these are getting stepped on by macros from other system code.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@167038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-30 19:06:59 +00:00
Howard Hinnant
1c0be3864a Use traits_type::to_int_type in basic_streambuf<_CharT, _Traits>::xsputn when calling overflow to correctly handle negative signed character types. This fixes http://llvm.org/bugs/show_bug.cgi?id=14074.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@165884 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-13 19:31:51 +00:00