Commit Graph

946 Commits

Author SHA1 Message Date
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 c5894133bc Added extra space to end of EXTRA_FLAGS in buildit. This fixes http://llvm.org/bugs/show_bug.cgi?id=15761
llvm-svn: 179609
2013-04-16 17:34:20 +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 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 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 516487765a The cmake script is failing to copy cxxabi.h to the right place because it was generating to destination path like so /include// and dstdir can legally be blank from my interpretation of the script, and this would then generate a path like libcxx/include// which is illegal.
llvm-svn: 178579
2013-04-02 21:33:01 +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 ad36fe5c19 Reference: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077132.html
llvm-svn: 178545
2013-04-02 15:48:56 +00:00
Howard Hinnant 39e9506a1e Reference: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130325/077131.html
llvm-svn: 178544
2013-04-02 15:46:31 +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 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 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
Howard Hinnant 97b8ebe600 I believe debug mode for vector<T> (T != bool) is complete. If anyone sees anything more they would like to see on it, please let me know. Debug mode is activated by compiling with -D_LIBCPP_DEBUG2=1. Eventually _LIBCPP_DEBUG2 will be renamed to just _LIBCPP_DEBUG.
llvm-svn: 178288
2013-03-28 20:35:29 +00:00
Howard Hinnant e00e6f23d3 Fix a few warnings/errors for compiling with -fno-exceptions.
llvm-svn: 178267
2013-03-28 18:56:26 +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 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
Howard Hinnant b14037be89 Remove some erroneous code I was using to debug debug mode.
llvm-svn: 177908
2013-03-25 20:46:07 +00:00
Howard Hinnant 2d752fc2f9 Debug mode tests for vector::front and back.
llvm-svn: 177904
2013-03-25 20:31:25 +00:00
Howard Hinnant 35b3b54548 More vector::iterator debug mode tests. Run by adding to OPTIONS -D_LIBCPP_DEBUG2=1.
llvm-svn: 177897
2013-03-25 20:03:19 +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
Howard Hinnant a60ae88db2 Marshall Clow found some divide-by-zero warnings with UBSan in rand's binomial_distribution test. This eliminates the divide-by-zeros and describes in comments the numerical difficulties the test is having. Each of the problematic tests are exploring edge cases of the distribution.
llvm-svn: 177826
2013-03-23 19:29:45 +00:00
Howard Hinnant 65a87ccdbf This is a start at making the libc++ test suite friendlier to the -fnoexceptions flag. Although this is not a complete solution, it does reduce the number of test failures on OS X from 467 to 128 on OS X when -fno-exceptions is enabled, and does not impact the number of failures at all when -fno-exceptions is not enabled. The bulk of this code was donated anonymously.
llvm-svn: 177824
2013-03-23 17:27:16 +00:00
Howard Hinnant 7c5b88b134 Test cleanup with respect to use of deprecated tmpnam function. Also Windows port for these tests to use _tempnam. The bulk of this patch was donated anonymously. I've tested it on OS X and accept responsibility for it. If I've broken anyone's platform by switching from tmpnam to mktemp for the generation of temporary file names, just let me know. Should be easy to fix in test/support/platform_support.h
llvm-svn: 177755
2013-03-22 20:05:40 +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
Marshall Clow 761b5cf087 Fix bug in test; found by AddressSanitizer
llvm-svn: 177464
2013-03-20 00:01:48 +00:00
Howard Hinnant 4bb98d0917 Marshall Clow found this memory problem in strstream using -fsanitize=address on the test suite.
llvm-svn: 177452
2013-03-19 22:16:57 +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 1c00ce5070 Fix bug in test; found by AddressSanitizer
llvm-svn: 177355
2013-03-18 23:39:36 +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