Commit Graph

877 Commits

Author SHA1 Message Date
Marshall Clow
e33e03e558 Fix PR#20834 - 'is_trivially_destructible yeilds wrong answer for arrays of unknown bound' Thanks to K-ballo for the bug report. Update a few of the other tests while we're here, and fix a typo in a test name.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216909 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-02 16:19:38 +00:00
Eric Fiselier
b26c966174 Mark test types for <atomic> nothrow default constructible. Patch from Steve MacKenzie.
The way the standard currently specifies the default constructor for atomic<T>
requires T to be nothrow default constructible. This patch makes our test types
meet this requirement.

Note: The nothrow default constructible requirment is subject to the outcome of
LWG issue 1265.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216561 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27 17:00:11 +00:00
Marshall Clow
4de32048f5 Fix bug 20740 - std::set/std::map don't support heterogeneous lookup for count(). Thanks to Jim Porter for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216353 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-24 23:54:16 +00:00
Eric Fiselier
a564dc53dd Fix assignments that should be comparisons x3
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 07:55:29 +00:00
Eric Fiselier
69e7c05783 Add return statement to a test class's assignment operator. Defect found by Coverity Scan.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216317 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 06:36:11 +00:00
Eric Fiselier
1070916643 [libcxx] Add --show-unsupported and --show-xfail to check-libcxx's default LIT args.
Summary:
In order to gather more information about testsuite results these flags should be added to LIT's default args.
These new switches were recently added to LIT. It been more than two weeks since both switches were added.
I think its time we add these to our LIT flags.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D5037

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216315 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:33:20 +00:00
Eric Fiselier
ae6e58c561 Fix handling of format strings to work with python 2.6
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216314 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-23 04:02:21 +00:00
Dan Albert
2c26213103 Refactor lit.cfg.
The purely imperative format of the configuration performed in lit.cfg
was making merge conflicts with changes I have for Android an
unbelievable pain in the ass. I've moved all of the configuration into a
Configuration class, with each piece of configuration happening in a
different method. This way I can avoid merge conflicts, and any new
features that get added (as have been done with the sanitizers, the -std
flag, etc.) can be easily applied to Android as well.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Differential Revision: http://reviews.llvm.org/D4952


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216196 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 17:30:44 +00:00
Eric Fiselier
501561910a Mark some localization time tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216151 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:38:21 +00:00
Eric Fiselier
51642a4e81 Mark some localization monetary tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216150 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:22:54 +00:00
Eric Fiselier
f523693f3f Mark localization ctype tests as XFAIL on linux.
This marks some of the localization test XFAIL on linux.
There has been some discussion on D4861 about doing this.
Please let me know if any of these tests for you on linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@216148 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-21 02:03:01 +00:00
Eric Fiselier
682132b4cc fix missing include for ::close in platform_support.h
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 17:52:40 +00:00
Eric Fiselier
bc4bcf051b Add extra test case for PR20345. Should have been commited with r215984
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215985 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:33:05 +00:00
Eric Fiselier
63648cffc0 Fix is_member_function_pointer does not account for ellipsis. PR20345. Patch from Agustin Berge.
I reviewed the patch and added the test cases.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215984 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 16:31:47 +00:00
Jonathan Roelofs
6f10d47bbc Give libcxx tests temporary filenames that are actually unique.
This fixes a race condition on temp file name creation.

http://reviews.llvm.org/D4962


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215977 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19 13:56:56 +00:00
Eric Fiselier
6661ad10f2 Add standard version to lit.cfg's available features
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 07:05:40 +00:00
Eric Fiselier
da98ce033e [libcxx] Add UNSUPPORTED tag to lit. It mirrors REQUIRES.
Summary:
This patch adds support for // UNSUPPORTED: feature. If an excluded feature is found in the list of available features then the test is marked unsupported.

I hope to use this to mark test unsupported if the fail with msan on asan. As well as tests that fail in particular standard modes.


Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4950

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215883 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 06:43:06 +00:00
Eric Fiselier
781448f48a Mark cuchar tests as always xfail since we don't provide the header'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215873 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:09:51 +00:00
Eric Fiselier
25a1516832 [libcxx] Add support for LLVM_USE_SANITIZER to libcxx when being built standalone and in-tree
Summary:
This patch adds support for LLVM_USE_SANITIZER when being built in-tree and standalone. 

This patch does the following things:
1. define the LLVM_USE_SANITIZER option to "" when being built standalone. This also helps show we support it.
2. Translate LLVM_USE_SANITIZER when standalone in a very similar way done in llvm/cmake/HandleLLVMOptions.cmake.
3. Add config.llvm_use_sanitizer to lit.site.cfg.in
4. Add code to translate config.llvm_use_sanitizer's value into the needed compile flags in lit.cfg.

Currently lit.cfg assumes that that the compiler supports '-fno-omit-frame-pointer' while CMakeLists.txt actually checks to see if its supported. We could pass this information to lit but I'm not sure its needed. 

Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4949

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215872 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-18 05:03:46 +00:00
Eric Fiselier
dfe5e72ed3 [libcxx] Update the way the -std= flag is chosen by CMake and LibcxxTestFormat
Summary:
This patch does two things:
CMake Update:
  - Add compiler flag checks for -std=c++11 and -std=c++1y and remove check for -std=c++0x.
  - Add configuration option LIBCXX_ENABLE_CXX1Y to prevent/allow -std=c++1y from being chosen as the std version. LIBCXX_ENABLE_CXX1Y is set to OFF by default.
  - if LIBCXX_ENABLE_CXX1Y is enabled then set LIBCXX_STD_VERSION to c++1y and fail if the compiler does not support -std=c++1y
  - If c++1y is not enabled then use c++11 and fail if the compiler does not support c++11.

Lit Update:
  - Update lit.site.cfg.in to capture LIBCXX_STD_VERSION information as config.std.
  - Remove mentions of has_cxx0X configuration option.
  - Check for `--param std=X' passed to lit on the command line.
  - Choose the std for the tests either from command line parameter or (if it doesn't exist) the lit.site.cfg.



Reviewers: mclow.lists, danalbert

Reviewed By: danalbert

Subscribers: emaste, rnk, ajwong, danalbert, cfe-commits

Differential Revision: http://reviews.llvm.org/D4329

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215802 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-16 01:35:36 +00:00
Eric Fiselier
b4b32a02fa Readding FreeBSD support to lit.cfg. Patch from Pawel Worach.
Pawel has been using this patch on his buildbots for a while. This should
allow the testsuite to run on FreeBSD with libcxxrt.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215787 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 23:24:00 +00:00
Jonathan Roelofs
09d8c46f30 Tame a few enum size tests when using -fshort-enums on ARM.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215769 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 21:34:52 +00:00
Eric Fiselier
efefe8ba34 Revert get testsuite running on FreeBSD.
There is a similar patch up for review. I'll submit my changes via that.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215750 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:49:28 +00:00
Eric Fiselier
101e2f3e06 Get testsuite running on FreeBSD.
Add initial support for using LIT to run the tests on FreeBSD. 
More work may need to be done to add support for FreeBSD but this is a
good initial step.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215742 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 18:00:47 +00:00
Eric Fiselier
c808961618 Fix incorrect locale requirements in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 05:02:05 +00:00
Eric Fiselier
31b9c44aa7 Add bare_allocator archetype that implements the minimal possible allocator interface.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215691 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-15 04:15:41 +00:00
Eric Fiselier
5b34a5f584 Change two tests to be less dependant on locales.
This patch removes the use of the "%c" specifier for getting/setting times.
The semantics of this specifier differ between linux and Mac. I don't believe
the use of this specifier was important to the test.

The following tests now pass on linux.
test/input.output/iostream.format/ext.manip/get_time.pass.cpp
test/input.output/iostream.format/ext.manip/put_time.pass.cpp

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215417 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:48:56 +00:00
Eric Fiselier
f4124610c2 Add return statement to slice_array and mask_array assignment. Closes PR20614.
This patch just adds the required return statements to slice_array::operator=
and mask_array::operator=.

Tests were added to check that the return value is the same as the object assigned
to.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215414 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12 00:06:58 +00:00
Eric Fiselier
e48b0c40ad fix stdio.h test to reflect removal of ::gets in c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215329 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-10 22:39:11 +00:00
David Blaikie
ddcbcd6b5e Revert "Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state."
Premature commit due to misreading CR feedback.

This reverts commit r215301.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215302 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:42:19 +00:00
David Blaikie
5eb396a8e6 Add some extra checks to the MoveOnly test class to ensure it is not constructed or assigned from in a moved-from state.
Some tests were constructing it with 0, so use -1 as the invalid state
instead.

Reviewers: Marshall Clow

Differential Revision: http://reviews.llvm.org/D4095

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215301 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 22:35:47 +00:00
Eric Fiselier
ae39e4f795 fix copy and pasted comment in test
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215276 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:43:16 +00:00
Eric Fiselier
2af66e9851 Mark math.h and cmath tests as xfail on linux.
These tests were marked as failing because the libc implementation does not
use the proper return type on certain math functions. There is other weirdness
that prevents us from defining our own version of these functions.

The failing tests in cmake were separated into their own files so that the rest
failures in the rest of the cmath tests were not hidden.

This was not done for the math.h test since we don't actually supply math.h


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215275 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-09 02:39:03 +00:00
Marshall Clow
095c3dd23e Apply a similar fix to <forward_list> as I did for <list> in r215210. Again, thanks to Ion Gaztañaga for noticing this problem w.r.t LWG#526
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215213 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:58:00 +00:00
Marshall Clow
fca038e133 While reading LWG#526, Ion Gaztañaga noticed that libc++ didn't correctly handle list::remove(const value_type &x), if x was an element of the list. Added a test for this, and a fix. Thanks to Ion for the report.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 15:35:52 +00:00
Viktor Kutuzov
f2e8c04540 Fix re-building in-tree libc++ against in-tree libc++abi
Differential Revision: http://reviews.llvm.org/D4805


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@215186 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-08 06:53:30 +00:00
Dan Albert
c09c2865b9 Fix typo.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214768 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 20:27:45 +00:00
Marshall Clow
529d303340 Fix a problem with reference_wrapper in C++03 that was causing counting predicates to fail. Add a test to make sure it works. However, most of the reference_wrapper tests still fail in C++03 mode, due to a lack of decltype. No change there.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214760 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 19:20:17 +00:00
Dan Albert
b4ed5ca01e Add locales to available_features for tests.
Linux has a lot of failures caused by not having support for certain
locales. Since these come out as a lot of noise in the test results,
have lit.cfg detect the presence of the various locales used in the
tests and add them to config.available_features as locale.LOCALE_NAME.

This patch also adds REQUIRES: locale.REQUIRED_LOCALE to every test that
I saw failing in this manner. We probably need to add more for all the
tests requiring en_US.UTF-8, but we can do that on an as-needed basis.

One thing that concerns me is how many tests get skipped because of
missing locales (especially in regex/). We should make a point of
splitting up any tests that test default behavior _and_ behavior under a
given locale so that we aren't losing coverage for default behavior.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214753 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 18:44:48 +00:00
Marshall Clow
f0f1bca861 Fix PR#202520 - predicate called too many times in list::remove_if. Add tests for list, forward_list, and the std::remove_if algorithm
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214736 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-04 17:32:25 +00:00
Eric Fiselier
d3d01eac01 Change lit.cfg to allow whitespace before comments
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214454 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 22:56:52 +00:00
Marshall Clow
c5eb69601b Add test cases for creating atomic types for trivially copyable types.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214406 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 15:20:48 +00:00
Marshall Clow
15269a8796 Fix numeric_limits<XXX>::is_modulo for signed arithmetic types. We were reporting true, for all arithmetic types, which is incorrect. Fix the tests which were wrong, too. This fixes PR#20158.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214371 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-31 01:18:05 +00:00
Dan Albert
1757386944 Base regex code on char_class_type.
__get_classname() and __bracket_expression were assuming that
char_class_type was ctype_base::mask rather than using
regex_traits<_CharT>::char_class_type.

This change allows char_class_type to be defined to something other than
ctype_base::mask so that the implementation will still work for
platforms with an 8-bit ctype mask (such as Android and OpenBSD).


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@214201 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 19:23:39 +00:00
Eric Fiselier
3ee7233c80 [libcxx] expose experimental::erased_type for all standard versions.
Summary: The polymorphic allocator implementation would greatly benefit by defining virtual functions in the dynlib instead of inline. In order to do that some types are going to have to be available outside of c++1y. This is the first step.

Reviewers: mclow.lists, EricWF

Reviewed By: EricWF

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4554

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213889 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 19:17:38 +00:00
Eric Fiselier
9020c08989 D4451: Fix copy/move issues casude by __tuple_leafs's converting constructor
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213888 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 18:48:34 +00:00
Eric Fiselier
08b8506930 test commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213887 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 18:41:56 +00:00
David Majnemer
cb8757aca7 Fix std::make_heap's worst case time complexity
std::make_heap is currently implemented by iteratively applying a
siftup-type algorithm.  Since sift-up is O(ln n), this gives
std::make_heap a worst case time complexity of O(n ln n).

The C++ standard mandates that std::make_heap make no more than O(3n)
comparisons, this makes our std::make_heap out of spec.

Fix this by introducing an implementation of __sift_down and switch
std::make_heap to create the heap using it.
This gives std::make_heap linear time complexity in the worst case.

This fixes PR20161.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213615 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 06:07:09 +00:00
Marshall Clow
d5549ccac1 Fix bug #20335 - memory leak when move-constructing a string with unequal allocator. Thanks to Thomas Koeppe for the report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213269 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 15:32:20 +00:00
Eric Fiselier
b1a40264dc [libcxx] Add <experimental/utility> header for LFTS.
Summary:
This patch adds the `<experimental/utility>` header as specified in the latest draft of the library fundamentals TS.

`<experimental/utility>` only contains `class erased_type`. 

This patch also updates the documentation to list the `erased_type` class as "initial implementation complete".

Test Plan:
Three test cases where added:

1. Test that `_LIBCPP_VERSION` is defined.
2. Test that `<utility>` has been included.
3. Test that `erased_type` is in the correct namespace and is constexpr default constructible.

Reviewers: mclow.lists

Reviewed By: mclow.lists

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D4510

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213226 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:31:31 +00:00
Eric Fiselier
9b2b60cab8 Test commit: Reverting whitespace changes
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213223 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:10:03 +00:00
Eric Fiselier
ad250c17df Test commit: whitespace change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213222 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-17 05:06:09 +00:00
Marshall Clow
2b44e3dd49 Correctly implement LWG 2049; std::is_destructible.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@213163 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-16 15:51:50 +00:00
Marshall Clow
7778249d2d Fix warning in test - missing exception specifier for overload of operator new
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212723 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-10 15:19:50 +00:00
Marshall Clow
bbeca21f26 Add a reset method to the counting predicates in the test suite
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212651 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-09 21:04:22 +00:00
Marshall Clow
484728789e string_view enhancements. Move to the correct namespace. Better constexpr support (thanks to Richard for the suggestions). Update the tests to match this. Add <experimental/__config for experimental macros/etc to live.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212569 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 22:38:11 +00:00
Marshall Clow
51349536aa Fix some failing tests for the standard containers. The tests were failing in 32-bit mode because they assumed that std::size_type and make_unsigned<ptrdiff_t>::type were always the same type. No change to libc++, just the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212538 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-08 15:19:40 +00:00
Marshall Clow
3a61b30f3a Minor cleanup for string_view; mostly from suggestions by Richard Smith. Also, make the tests pass under c++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212185 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-02 15:45:57 +00:00
Marshall Clow
2f9e714071 Fix libc++ bug #20039: 'Constructing std::function from empty compatible std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 21:27:51 +00:00
Marshall Clow
c8c7abae66 Add checking for the complexity guarantees in the standard
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212017 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-30 05:04:20 +00:00
Marshall Clow
164b297099 Implement string_view from the library fundamentals TS (n4023). Also works in C++11 and 03, with reduced functionality (mostly in the area of constexpr)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210659 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-11 16:44:55 +00:00
Marshall Clow
675dd5cc4f Mark assign to be constepr only in c++14; can't have constexpr fns that return void in C++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210562 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:52:57 +00:00
Marshall Clow
c1345e3262 A bunch of the char.traits tests were using unicode literals. #ifdef those bits out on c++03, since it doesn't support u"" and U "" style strings.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210560 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10 18:46:59 +00:00
Marshall Clow
281918b6aa Testing infastructure: A template for char_traits where all the functions are constexpr, and a comparison predicate which counts how many times it's been called.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210381 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-06 22:33:40 +00:00
David Majnemer
0707b67ac3 Handle partial nanosleeps in this_thread::sleep_for
Signals may result in nanosleep returning with only some of the
requested sleeping performed.

Utilize nanosleep's "time-remaining" out parameter to continue sleeping
when this occurs.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210210 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 19:43:20 +00:00
Nico Weber
981b01d9d0 Make meta.trans.other/aligned_storage.pass.cpp pass on arm.
The maximum alignment on arm is 8, not 16 like on x86. Use alignof(max_align_t)
to make the test work in both cases.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210195 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04 16:25:58 +00:00
David Majnemer
4d9f97b40b [libc++] Don't return uninitialized data from random_device::operator()
Make sure we appropriately retry calls to read if the return result is
less than what we asked for.

Additionally, check and handle IO errors: EINTR results in the read
operation getting restarted; other errors turn into exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210061 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:40:39 +00:00
David Majnemer
8db32cc2ac [libc++] random_device fails if open returns zero
random_device::random_device(const string&) wrongly assumes that open
can only validly return a file descriptor greater than zero.

This results in random_device believing that it didn't successfully open
the device causing it to throw in it's constructor, this ends up leaking
a file descriptor.

The fix is simple, don't error on file descriptors which are zero.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210060 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-03 02:21:37 +00:00
Nico Weber
4074d6ea30 Remove unused code in a libc++ test.
Other tests in this directory use this type, so it's probably copypasta from
there.

(test_buf only forwards to the superclass in all tests where it's used though,
so I wonder if it can be replaced with just using filebuf / wfilebuf
everywhere?)


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@210019 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-02 12:00:08 +00:00
Justin Bogner
e39915bdc5 Fix XFAIL condition from r208840
The XFAILs in r208840 were too general. They were meant to only apply
to testing when use_system_lib was set.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209972 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-31 07:59:03 +00:00
Nico Weber
d32add4a48 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209819 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 14:58:38 +00:00
David Majnemer
fcafd80ace Linux: Correctly identify valid error codes
[syserr.errcat.objects]p4 specifies that
system_category().default_error_condition(ev) map to
error_condition(posv, generic_category()) if ev could map to a POSIX
errno.

Linux reserves up to and including 4095 for errno values, use this as a
bound.

This fixes syserr.errcat.objects/system_category.pass.cpp on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209795 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 05:02:22 +00:00
Marshall Clow
4f3368e269 Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209785 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-29 01:10:28 +00:00
Marshall Clow
52a708fbca Fix bug 19840, where some tests were not testing what we wanted. Thanks to Eric for the bug report
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209520 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-23 15:30:23 +00:00
Marshall Clow
6b7e6921e2 Fix Bug 19678 - libc++ does not correctly handle the regex: '[^\0]*'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:29:50 +00:00
Marshall Clow
117563c516 Fix bug 19740; round-tripping a pointer through a stream doesn't work
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@209305 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21 16:02:20 +00:00
Alp Toker
08f8ac6951 Fix typo 'fourty' in tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208870 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:33:29 +00:00
Alp Toker
ec34c48976 Fix typos
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208869 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 11:27:39 +00:00
Justin Bogner
5fda8338b2 Work around ABI differences due to LWG 2056 in tests
When testing against the system library, there is a relatively minor
ABI breakage that the std::future_errc values have been changed to
avoid using zero. Update the tests that rely on the values being
consistent.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208840 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 01:57:42 +00:00
Justin Bogner
bdfc0ad2ea Remove XFAIL from a number of tests that aren't expected to fail
These tests haven't been failing on darwin11 or 12 since r189610 when
pr17027 was fixed, but they've been keeping the libc++ bot red by
XPASSing since then.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208831 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-15 00:55:44 +00:00
Marshall Clow
1f50f2d64b Add Address Sanitizer support to std::vector
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208319 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-08 14:14:06 +00:00
Marshall Clow
6b5be703db Fix PR 19663. Some calls to find(vector<bool>) were returning iterators that were subtly invalid (didn't compare equal). Thanks to Erik Verbruggen for the report (and diagnosis)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@208096 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-06 15:33:23 +00:00
Marshall Clow
5f64a2b3c3 Fix bug #18350. Add tests for tuples of all the smart pointers (except auto_ptr)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207307 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-26 05:19:48 +00:00
Marshall Clow
34b571bd88 Added some tests for equal elements in min_element and max_element. Bug #19547 was invalid, but we weren't testing that case
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@207232 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25 15:50:54 +00:00
Marshall Clow
398c9d882b Default the copy and move constructors for __tuple_leaf. This fixes bugs 18853 and 19118. Add a test case for that.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206829 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 23:48:09 +00:00
Marshall Clow
88dd258984 Add more tests for std::ws as pointed out by bug #19497
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206770 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-21 18:12:09 +00:00
Marshall Clow
a178c13419 Bug #19473. If you pass an allocator to std::function, we should use that allocator, not construct one from scratch. Add a test to make sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206623 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-18 17:23:36 +00:00
Marshall Clow
f1d10875d7 Fixed a test that was attempting to use rvalue-references w/o checking to see if they were supported in the language. This resulted in a warning when testing using C++03.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@206482 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-17 18:11:38 +00:00
Marshall Clow
f1264e7c9e Fix PR19819
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@205709 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-07 13:32:26 +00:00
Stephan Tolksdorf
8a71d23633 [libc++] Teach is_integral, is_[un]signed and make_[un]signed about __[u]int128_t
This commit also adds tests for std::numeric_limits<__[u]int128_t>.

Reviewed in http://llvm-reviews.chandlerc.com/D2917

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204849 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 19:45:52 +00:00
Marshall Clow
f4c0c708a3 Add tests that should fail when lock() throws. THis is part of LWG issue #2135. No library changes here.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204777 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26 02:11:47 +00:00
Marshall Clow
bce096d34d Add a test to make sure we're doing the right thing for throwing exceptions from deferred functions. This is LWG issue #2186. No change to the library needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204678 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-24 22:25:24 +00:00
David Majnemer
f9f95be930 Implement N3891: A proposal to rename shared_mutex to shared_timed_mutex
This is as straightforward as it sounds, a renamed from shared_mutex to
shared_timed_mutex.

Note that libcxx .dylib and .so files built with c++14 support need to
be rebuilt.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@204078 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-17 20:19:44 +00:00
Marshall Clow
b1ead689be Implement LWG 2360: 'reverse_iterator::operator*() is unimplementable'. Note that this is a (small) behavior change in the library. Reverse iterators whose base iterators' operator* return references to 'within themselves' have been sacrificed to the greater goal of avoiding data races.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203587 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 17:16:17 +00:00
Marshall Clow
d3849253ce Patch from Steve MacKenzie to make the libc++ tests play nicely with MSVC's STL. Add '#include <functional>' to four of the priority queue tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203584 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 16:22:53 +00:00
Marshall Clow
3ebf26f90d Final bit for LWG #2263; test different allocator pointer types. Note that libc++ already does the right thing here; I've just added tests to ensure that it stays this way.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203539 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 04:32:12 +00:00
Marshall Clow
6dbaaa99a8 Add tests for LWG issue #2356. Stability of erasure in unordered associative containers. Libc++ already does this, but now we have tests for it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203494 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 21:36:36 +00:00
Marshall Clow
179e9455a5 More tests for LWG Issue #2263; this time to the associative and unordered containers. Still no changes to libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203480 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 19:18:49 +00:00
Marshall Clow
9863083ee0 Added tests to the sequence containers for for LWG Issue #2263. Comparing iterators and allocator pointers with different const-character. No changes to libc++
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203479 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-10 18:54:56 +00:00
Marshall Clow
b90686c1ec Implement LWG #2344: quoted()'s interaction with padding is unclear. I think that anyone using quoted with padding is really confused, but it should work the way the rest of iostreams works.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203290 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-07 21:45:32 +00:00
Marshall Clow
471f3c67db Fix a couple of -Wabsolute-value warnings in the libc++ tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203126 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 16:27:17 +00:00
Peter Collingbourne
9d3d032c7d Do not derive __gnu_cxx::hash<T> from std::hash<T>.
Instead, define explicit specializations for the basic types listed in
the SGI documentation. This solves two problems:

 1) Helps avoid silent ODR violations caused by the absence of a
    user-supplied __gnu_cxx::hash specialization in cases where a std::hash
    specialization exists (e.g. for std::string).

 2) __gnu_cxx::hash semantics are slightly different to those of
    std::hash (for example, the former may dereference a pointer argument)
    so it is inappropriate for __gnu_cxx::hash to receive std::hash
    specializations by default.

Differential Revision: http://llvm-reviews.chandlerc.com/D2747

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@203070 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-06 04:11:10 +00:00
Marshall Clow
48c74700ec Implement LWG 2193. Default constructors for standard library containers are explicit. Note that libc++ already did this for string/deque/forward_list/list/vector and the unordered containers; implement it for set/multiset/map/multimap. Add tests for all the containers. Two drive-by fixes as well: add a missing explicit in <deque>, and remove a tab that snuck into a container test. This issue is also LLVM bug 15724, and resolves it.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202994 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 19:06:20 +00:00
Marshall Clow
24b29a02f1 Mark is_final as a C++14 feature.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202991 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 17:58:48 +00:00
Marshall Clow
0d6dcb5569 Remove definition of std::fmaf from libc++. Fixes bug #18910. This function should come from the C standard library. As a drive-by fix, update the tests to remove a warning from -Wabsolute-value
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202990 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 17:09:51 +00:00
Marshall Clow
ebd6c2b81d Implement LWG #2212: std::is_final. This requires compiler support, which modern versions of clang provide. Also mark LWG #2230 as complete - no code changes needed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202934 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 03:39:25 +00:00
Marshall Clow
23ef151614 Update synposis in <memory> to show move semantics for weak_ptr; add tests for already existing move semantics. Mark LWG issues #2315 (no changes needed), 2316 (move semantics for weak_ptr), 2252 (previous commit) and 2271 (previous commit) as complete.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202931 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-05 03:12:04 +00:00
Marshall Clow
8d4ce30c79 LWG Issue #2271: regex_traits::lookup_classname specification unclear. libc++ already does the right thing; just update the tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202904 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 22:44:34 +00:00
Marshall Clow
cbb9305c26 LWG issue #2252: Add more tests for exception safety. No changes needed in the library
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202885 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 20:31:21 +00:00
Marshall Clow
a93b5e27a8 Implement LWG #2268: Setting a default argument in the declaration of a member function assign of std::basic_string.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202876 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-04 19:17:19 +00:00
Peter Collingbourne
be8a99ad0f [libc++] Const qualify __gnu_cxx::hash_map<>::const_iterator::pointer type.
Differential Revision: http://llvm-reviews.chandlerc.com/D2811

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202749 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 19:50:01 +00:00
Marshall Clow
53c0e72d5c Implement LWG 2324: Insert iterator constructors should use addressof(). Add two new container classes to the test suite that overload operator &, and add test cases to the insert/front_insert/back_insert iterator tests that use these containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202741 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 19:20:40 +00:00
Marshall Clow
0c60b0a686 Remove a stray tab that snuck into a test. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202739 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 19:16:40 +00:00
Marshall Clow
50fe0c7d61 Implement LWG Paper n3887: Consistent Metafunction Aliases. This adds std::tuple_element_t<> as an alias for tuple_element<>::type. Clean up the synopsis for tuple_element in <utility> as well.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202673 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 06:18:11 +00:00
Marshall Clow
ff137e9145 Implement LWG Issue #2285 - make_reverse_iterator. Also mark issues #1450 and #2205 as complete; they are just wording changes in the standard. Mark issues #2359, #2320 and #2322 as complete - libc++ implements them already.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202671 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-03 01:24:04 +00:00
Marshall Clow
37a9ca6fb2 More LWG issues. Mark #2182, #2323 and #2213 as complete. Add a test for #2339, and mark that as complete. No actual changes to the libc++ code; all of these were already in place.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202407 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 16:13:36 +00:00
Marshall Clow
02ca8af10b LWG issue #2188: Reverse iterator does not fully support targets that overload operator&. Also mark #2272 and #2299 as complete; libc++ already implements them.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202339 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-27 02:11:50 +00:00
Marshall Clow
103af3478e Implement LWG issue 2306: match_results::reference should be value_type&, not const value_type&. This is a general move by the LWG to have the reference type of read-only containers be a non-const reference; however, there are no methods that return a non-const reference to a match_result entry, so there's no worries about getting a non-const reference to a constant object.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202214 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-26 01:56:31 +00:00
Marshall Clow
8e554d93da Implement LWG issue 2301: Mark std::tie as constexpr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@202158 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25 16:11:46 +00:00
Marshall Clow
e0f8672e7a Implement LWG Issues #2329 and #2332 - disallow iterators into temporary regexes and regexes into temporary strings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 21:21:11 +00:00
Marshall Clow
9dacb2f713 Implement LWG Issue: 2280. begin/end for arrays should be constexpr and noexcept, plus a drive-by fix for cbegin/cend suggested by Peter Sommerlad.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201703 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 17:53:30 +00:00
Marshall Clow
9d9463a355 Implement LWG2350: min, max, and minmax should be constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201697 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-19 16:51:35 +00:00
Marshall Clow
d2060f06b5 Add a test to make sure that vector supports incomplete types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-13 17:56:12 +00:00
Marshall Clow
71e699dda5 Fix for PR17606 - result_of (and INVOKE) works incorrectly for member function pointers with ref qualifiers. Also a drive-by fix for common_type in C++03 mode. Thanks to Michel Morin for the bug report and the proposed fix.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201101 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-10 17:40:28 +00:00
Marshall Clow
ebfc50ee89 Fix for PR18735 - self-assignment for map/multimap gives incorrect results in C++03
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@201021 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-08 04:03:14 +00:00
Peter Collingbourne
a3dc8f3b8b Support forward_list<Incomplete Type>. Patch by Zhihao Yuan!
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@200814 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-05 01:44:17 +00:00
Howard Hinnant
08356fbee7 Albert Wong: Fix thread.thread.id/lt.pass.cpp to not assume thread::id() produces a minimal value. This enables this test to pass on andriod arm.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@200793 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-04 19:51:48 +00:00
Marshall Clow
13fbe9d5e3 Fix numeric.limits.members/traps.pass.cpp to pass on non-x86 architectures. Fixes bug #18468
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@200724 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-03 23:26:56 +00:00
David Fang
a612c62740 lit.site.cfg:cxx_under_test should take precedence over 'which clang++'
(reviewed by Marshall Clow)

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@200364 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-29 01:54:52 +00:00
Marshall Clow
28754d0378 Removed extra line that I left in when committing 199694. Thanks to Jared Grubb for the catch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@200108 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-26 01:59:59 +00:00
Peter Collingbourne
a4c0d87a84 Const qualify __mem_fn call operator
QOI improvement.

Differential Revision: http://llvm-reviews.chandlerc.com/D2059

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199848 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22 22:56:52 +00:00
Marshall Clow
15066f21f1 Removed extra space; thanks to thakis_'s eagle eye
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199695 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-21 00:03:44 +00:00
Marshall Clow
1a383b9755 Fixed test failure in is_iec559.pass.cpp on darwin-ppc32. Thanks to David Fang for the report (and suggested fix)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199694 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-20 23:57:16 +00:00
Marshall Clow
e3c9d52d6d Fix erroneous test; was failing on darwin-ppc32. Fixes PR18469.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199542 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-18 03:41:54 +00:00
Marshall Clow
98760c18f8 Add license headers to a bunch of libc++ files that were missing them. No functionality change. Fixes 18291. Thanks to Nico for the bug report and the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199400 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-16 16:58:45 +00:00
Marshall Clow
beee5e48b3 Apply patch for Albert Wong: 'Modify testit to allow filtering tests by prefixes'.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199318 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-15 16:28:42 +00:00
Marshall Clow
928bb68bb2 Whoops! Set the default in the last commit to c++1y instead of c++11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199224 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 17:04:06 +00:00
Marshall Clow
2f78c0d9f9 Update lib/buildit and test/testit to both pay attention to an env flag CXX_LANG, which people can set to 'c++03', 'c++11' or 'c++1y' to build/test using that language variant. If you don't set this env variable, you get c++11, just like today. Drive-by fix; remove duplicate -nostdinc++.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@199222 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-14 17:00:40 +00:00
Marshall Clow
0efd9dcfa0 Fix PR18404 - 'Bug in regex_token_iterator::operator++(int) implementation'. Enhance the tests for regex_token_iterator and regex_iterator.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198878 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-09 18:25:57 +00:00
Marshall Clow
908b5d7f92 Back out the <type_traits> changes from r198431; they were breaking when building with glibc. Need to find a better solution for PR18218.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198623 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-06 18:12:50 +00:00
Marshall Clow
854a7a02b4 Patch by Howard. First part of fix for PR18218; add type traits needed to do the right thing. Fix the problems in PR18218 for isnan and pow - they also need to be applied to the other functions in <cmath>. Also, a drive-by fix for the test - now actually calls test_abs()
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@198431 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-03 18:21:14 +00:00
Marshall Clow
239bc42b53 Make cv_status a class enum. Fixes PR18314. Thanks to Andersca for the report and the patch.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@197921 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-23 22:14:27 +00:00
Marshall Clow
1b92188a82 Found six (nmostly) identical files named 'test_allocator.h' in the libcxx test suite. Moved one to /support, made it a superset, and removed all but one of the others, and iupdated all the includes. Left the odd one (thread/futures/test_allocator.h) for later.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196174 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-03 00:18:10 +00:00
Marshall Clow
ebedffde9a Found two identical files named 'allocators.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196127 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 18:08:31 +00:00
Marshall Clow
e27dbcf2dc Found two identical files named 'DefaultOnly.h' in the libcxx test suite. Moved one to /support, removed the other, and iupdated all the includes. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196118 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 17:00:56 +00:00
Marshall Clow
6daf534441 Fix for PRPR17934; based on a fix suggested by Peter Sommerlad
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196058 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-02 03:24:33 +00:00
Sylvestre Ledru
a7d46056b0 Remove executable permissions on a text file
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@196041 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-01 10:15:11 +00:00
Marshall Clow
061d0cc4db There were two identical files named 'min_allocator.h'. Move one of them to /support and delete the other. Then adjust all the tests that used them to include the moved one. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195785 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26 20:58:02 +00:00
Marshall Clow
16c76a2107 Fix a test that I broke over the weekend
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@195143 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 19:14:27 +00:00
Marshall Clow
0cdbe60481 Move <optional> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194867 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 22:42:10 +00:00
Marshall Clow
0c6a583e2a Fixed bug in quoted strings implementation. Added test to be sure. Thanks to Peter Sommerlad for the report (and suggested fix)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194725 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-14 20:01:38 +00:00
Marshall Clow
6b7c2aeb00 Move <dynarray> into include/experimental, and into the std::experimental namespace, since it's not part of C++14, but of an upcoming TS
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 22:44:48 +00:00
Howard Hinnant
3f81e9eeba This fixes a very subtle ABI problem concerning the copy constructor of
pair, and a couple of pair-like implementation detail types.  The
C++98/03 and 11 standards all specify that the copy constructor of
pair<int, int> is trivial. However as libc++ tracked the draft C++11
standard over the years, this copy constructor became non-trivial, and
then just recently was corrected back to trivial for C++11.

Unfortunately (for libc++1) the Itanium ABI specifies different calling
conventions for trivial and non-trivial copy constructors.  Therefore
currently the C++03 libc++ copy constructor for pair<int, int> is ABI
incompatible with the C++11 libc++ copy constructor for pair<int, int>.
This is Bad(tm).   This patch corrects the situation by making this copy
constructor trivial in C++03 mode as well.

Just in case it is needed for an incomplete C++11 compiler, libc++
retains the ability to support pair with rvalue references, but without
defaulted special members.  However the pair needs non-trivial special
members to implement this special case, (as it did when clang was in
this place a couple of years ago).

During this work a bug was also found and fixed in
is_trivially_constructible.

And there is a minor drive-by fix in <__config> regarding
__type_visibility__.

A test is updated to ensure that the copy constructor of pair<int, int>
is trivial in both C++03 and C++11.  This test will necessarily fail for
a compiler that implements rvalue references but not defaulted special
members.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194536 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-13 00:39:22 +00:00
Marshall Clow
ecc8d7b334 Fix an off-by-one error in basic_string::__grow_by, where it would incorrectly throw length_error (instead of bad_alloc) when attempting to resize the string to 'max_size()'. Add tests for resizing to max_size +/-1
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194151 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-06 14:24:38 +00:00
Marshall Clow
76a8670ce4 LWG issue 2341; Make the two variants of basic_ostream::seekp and basic_istream::seekg behave consistently; update tests to make sure
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193814 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 22:20:45 +00:00
Marshall Clow
09f8550e1c Fixes PR17148
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-31 17:23:08 +00:00
Richard Smith
aa87532fee Avoid using the name 'bzero' for an enumerator in global scope. <strings.h> might declare this as a function.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@193066 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-21 04:59:37 +00:00
Howard Hinnant
71b52152a9 r192075 broke the buildbot at
http://lab.llvm.org:8013/builders/libcxx_clang-x86_64-darwin11-RA

lit.py: <string>:230: note: inferred use_system_lib as: False
lit.py: <string>:247: fatal: C++ ABI setting None unsupported for tests

cxx_abi is geting set to None, and the lit script errors out shortly after
that.  This patch changes the default of cxx_abi from None to 'libcxxabi'.
This is likely not the right way to fix this problem.  However it gets the
buildbot running again.  Improvements to this fix are welcome.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192609 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-14 18:02:02 +00:00
Marshall Clow
5f2d5b95e6 LWG Issue 2097: packaged_task constructors should be constrained
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192544 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 22:49:17 +00:00
Marshall Clow
1206720869 Implement national body comment GB9: remove std::gets
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192538 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-12 19:09:47 +00:00
Marshall Clow
dab89a1412 Fix LWG Issue 2141: common_type trait produces reference types
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192142 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 23:43:33 +00:00
Marshall Clow
3f433cdb8e Apparently, I don't know the difference between 'left' and 'right'. Swap parameters named 'lhs' and 'rhs' so that they correctly refer to the 'left hand side' and 'right hand side' of comparisons. No functionality change. Thanks to Arthur O'Dwyer for pointing this out to me.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 02:37:18 +00:00
Peter Collingbourne
d0d308f54b Make it possible to link against libstdc++ as well as libsupc++ with CMake.
Linking against libstdc++, rather than libsupc++, is probably better
for people who need to link against clients of libstdc++.  Because
libsupc++ is provided only as a static library, its globals are not
shared between the static library and the copy linked into libstdc++.
This has been found to cause at least one test failure.

This also removes a number of symbols which were multiply defined
between libstdc++ and libc++, only when linking with libstdc++.

Differential Revision: http://llvm-reviews.chandlerc.com/D1825

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192075 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 22:13:19 +00:00
Howard Hinnant
ae2b90b86d G M: 1. It changes the temp file handling to use the template and the current directory for windows, matching how it works on other platforms.
2. It re-enables the temp file handling for mingw that regressed.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-06 21:14:05 +00:00
Marshall Clow
2faa02fc3d Add tests making sure that optional<T>s can be compared at compile time; this functionality was enabled by N3789
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192051 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 23:29:16 +00:00
Marshall Clow
79d8c99a62 LWG Issue 2247: Implement type trait 'is_null_pointer'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:21:17 +00:00
Marshall Clow
320c80fecf Implement literal suffixes for compled
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192048 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:19:49 +00:00
Marshall Clow
8d9dd7a968 Mark namespaces for user defined literals as 'inline'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192047 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 21:18:32 +00:00
Marshall Clow
1d927e38d1 Implement LWG issue 2275 'forward_as_tuple should be constexpr'
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@192038 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-05 18:46:37 +00:00
Peter Collingbourne
4c81b00f75 Make it possible to run the test suite when built as part of LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191930 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-03 21:58:25 +00:00
Marshall Clow
bd444af850 Part 8 of LWG Issue 2210' unordered_set and unordered multiset; this got missed when I went on vacation
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 21:33:51 +00:00
Howard Hinnant
ff7546e974 SCARY/N2913 iterator support between the multi and non-multi versions of the associative and unordered containers. I beleive lack of support for this was accidentally recently introduced (by me) and this is fixing a regression. This time tests are put in to prevent such a regression in the future.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-30 19:08:22 +00:00
Marshall Clow
9738cafa4f Implement n3789; constexpr support in named function objects
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191626 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-28 19:06:12 +00:00
Howard Hinnant
de589f2f8f Peter Collingbourne: If a pointer is passed as the third argument of the (iterator,
iterator, allocator) constructor with the intention of it being
implicitly converted to the allocator type, it is possible for overload
resolution to favour the (iterator, iterator, enable_if) constructor.
Eliminate this possibility by moving the enable_if to one of the
existing arguments and removing the third argument.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191145 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 21:13:54 +00:00
Howard Hinnant
ba898e4208 N3659: Shared locking in C++ Revision 2, c++1y only
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@191127 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-21 01:49:28 +00:00
Howard Hinnant
cd942f1840 Marshall Clow: LWG Issue 2056: future_errc enums start with value 0 (invalid value for broken_promise).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190756 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 18:20:10 +00:00
Marshall Clow
a49a2c9deb LWG Issue 2210 (Part #7): vector and vector<bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190736 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-14 00:47:59 +00:00
Marshall Clow
27a1c252e3 Initial implementation of <dynarray>. No allocator support pending resolution of LWG #2235; no stack allocation pending compiler support
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190697 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13 15:22:55 +00:00
Marshall Clow
f4107076e4 Test for 'bad_array_length'; got left out of initial commit
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190614 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 17:01:38 +00:00
Marshall Clow
6dff618d7d LWG Issue 2210 (Part #6): unordered_map and unordered_multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190576 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 03:00:31 +00:00
Howard Hinnant
f9d2680e19 A collection of minor type-o fixes. The first two aren't testable, but all tests pass with them. I stumbled across them while experimenting with a std::move that checks its argument for non-const. The third corrects a test that is currently failing.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190563 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-12 00:10:44 +00:00
Marshall Clow
49d596d412 LWG Issue #2210 Part 5 - map/multimap; no, really - the last one was set/multiset. THIS is map/multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190474 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 01:15:47 +00:00
Marshall Clow
24a7e331f1 LWG Issue #2210 Part 4 - map/multimap
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190454 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-11 00:06:45 +00:00
Marshall Clow
6398343bfc Remove a tab that snuck in
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190283 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 21:13:57 +00:00
Howard Hinnant
ac04e1f5bf Fix minor type-o in tests.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190280 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 19:28:51 +00:00
Marshall Clow
955f2c88a1 LWG Issue 2210 (Part #2 & #3): list and forward_list
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190279 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-08 19:11:51 +00:00
Marshall Clow
ab04aadaf4 LWG Issue 2210 (Part #1): deque
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190251 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 16:16:19 +00:00
Marshall Clow
62f34be0ba N3545: Quoted strings
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@190032 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-05 04:48:45 +00:00
Marshall Clow
9e613ca1b3 LWG Issue 2148: Hashing Enums
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189831 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 17:55:32 +00:00
Marshall Clow
05fe12bc44 Eradicate tabs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189808 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-03 14:14:27 +00:00
Howard Hinnant
01afa5c6e4 Implement N3672, optional<T>.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189772 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-02 20:30:37 +00:00
Howard Hinnant
8ecb95fdec Forgot to svn add the test for r189722.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189723 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-31 17:03:02 +00:00
Howard Hinnant
713f4db2e5 SFINAE out duration converting constructor if the constructor would otherwise cause a ratio compile-time overflow. This fixes LWG 2094.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189722 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-31 16:51:56 +00:00
Daniel Dunbar
9e9d076879 [tests] Change with_system_lib feature to match what XFAIL lines expect.
- The lit builtin XFAIL handling is more restrictive than what we were
   previously using, and for now I'd rather keep the lit one restrictive.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 19:52:12 +00:00
Howard Hinnant
d179407288 is_destructible for function types was mistakenly returning true instead of false. This is true in both C++11 and C++1y, but has been clarified by the post C++11 LWG issue 2049.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189687 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 19:12:42 +00:00
Marshall Clow
09da3c053c LWG Issue 2128: Implement global cbegin/rbegin/cend/rbegin
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189634 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-30 01:17:07 +00:00
Marshall Clow
08b4f3f99b LWG Issue 2162: mark allocator_traits::maxsize as noexcept
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189399 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 20:22:15 +00:00
Marshall Clow
83179a788f LWG issues 2174/5/6 - mark wstring_convert::converted as noexcept, and make (some of) the constructors for wstring_convert and wbuffer_convert as explicit. Add configuration macro _LIBCPP_EXPLICIT_AFTER_CXX11
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189398 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 20:18:59 +00:00
Marshall Clow
af74651f61 Implement LWG issue 2061
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189345 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-27 13:03:03 +00:00
Howard Hinnant
e1c5f9ec1b Apply constexpr to initializer_list for c++1y.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189271 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 20:11:32 +00:00
Howard Hinnant
5e57142c59 Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189140 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 20:10:18 +00:00
Howard Hinnant
499cea12bb Debug mode for string. This commit also marks the first time libc++ debug-mode has found a bug (found one in regex). Had to play with extern templates a bit to get this to work since string is heavily used within libc++.dylib.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189114 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-23 17:37:05 +00:00
Howard Hinnant
641d3d8b4c XFAIL a few tests on darwin12
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189043 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 18:47:39 +00:00
Howard Hinnant
1c44f51de7 Zhihao Yuan noted that a move assignment operation was missing from std::adjacent_difference. Fixed.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189036 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 18:02:34 +00:00
Howard Hinnant
8a1df3ca0c David Blaikie suggested this test for detecting constexpr on the error_category default constructor. Additionally I decided to make this constructor trivial as well, as I could not come up with a rationale for not doing so. Fully tested with both current Apple clang and tip-of-trunk clang.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@189034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 17:41:48 +00:00
Howard Hinnant
d7cddf6519 XFAIL 3 tests on darwin 11-12. The tests have recently been modified, are correct, and pass with an updated libc++.dylib
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188964 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-22 00:04:22 +00:00
Daniel Dunbar
585b48ddf6 [tests] Update to use lit's now-integrated XFAIL handling.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188960 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-21 23:06:32 +00:00
Marshall Clow
198a2a59ee Implement LWG Issue #2187 (emplace_back and emplace for vector<bool>)
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 23:54:12 +00:00
Marshall Clow
bf6eda0b1e Eradicate tabs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188322 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 22:22:40 +00:00
Marshall Clow
5cfc6ab2b8 Second half (map/multimap) of N3657
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188320 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 22:18:47 +00:00
Marshall Clow
8634fc5494 Added more tests for numeric conversion error handing; Refs LWG issue 2009
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 15:52:51 +00:00
Marshall Clow
7a4e374280 More support for N3657; tests for is_transparent
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188242 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 01:12:41 +00:00
Marshall Clow
4a0a98166c First half of support for N3657; heterogenous lookups for set/multiset
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-13 01:11:06 +00:00
Howard Hinnant
80e19ac90f Add a check for arrays of unknown bounds to is_destructible. This fixes http://llvm.org/bugs/show_bug.cgi?id=16839
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188080 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 16:53:45 +00:00
Daniel Dunbar
bd7b48a628 [tests] Update to use lit_config and lit package, as appropriate.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188073 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-09 14:44:11 +00:00
Marshall Clow
051c848e88 N3644 tests for map/multimap/set/multiset. Drive-by NOEXCEPT for __tree_const_iterator constructor. Fix comment typos in other tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@188019 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 21:52:50 +00:00
Marshall Clow
193ef03eb5 N3644 support for <unordered_set> and <unordered_map>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187915 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 21:30:44 +00:00
Marshall Clow
52ad482edc N3644 support for vector<bool>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187910 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:53:38 +00:00
Marshall Clow
0f164c9d75 N3644 support for <string> and <vector>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187909 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:48:48 +00:00
Howard Hinnant
36ba399a33 Correct logic bug in find optimization for vector<bool>. This fixes http://llvm.org/bugs/show_bug.cgi?id=16816
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187908 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 20:42:16 +00:00
Howard Hinnant
ab61b2c9f1 War on tabs
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187906 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:39:48 +00:00
Howard Hinnant
f68b46f0c9 Rename time.duration.literals step 3
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187905 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:39:11 +00:00
Howard Hinnant
32c0969361 Rename time.duration.literals step 2
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187904 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:36:50 +00:00
Howard Hinnant
c29e1b949c Rename time.duration.literals step 1
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187903 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-07 19:35:46 +00:00
Marshall Clow
f9c29e160c Implement tests for NULL iterators for <array> re: N3644
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187809 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 17:17:13 +00:00
Marshall Clow
5a11f94583 Implement NULL iterators for <forward_list> and <deque> re: N3644
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187805 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-06 16:14:36 +00:00
Marshall Clow
65d2e6a392 Implement NULL iterators for <list> re: N3644
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187740 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-05 21:23:28 +00:00
Howard Hinnant
824c19963e debug mode for unordered_map. Also picked up a missing check and test in unordered_multimap. This wraps up debug mode for the unordered containers.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187659 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 17:50:49 +00:00
Howard Hinnant
8b00e6c960 Ok, 3 major changes for debug mode in one commit:
1.  I had been detecting and trapping iterator == and \!= among iterators
    in different containers as an error.  But the trapping itself is actually
    an error.
    
    Consider:
    
    #include <iostream>
    #include <vector>
    #include <algorithm>

    template <class C>
    void
    display(const C& c)
    {
        std::cout << "{";
        bool first = true;
        for (const auto& x : c)
        {
            if (\!first)
                std::cout << ", ";
            first = false;
            std::cout << x;
        }
        std::cout << "}\n";
    }

    int
    main()
    {
        typedef std::vector<int> V;
        V v1 = {1, 3, 5};
        V v2 = {2, 4, 6};
        display(v1);
        display(v2);
        V::iterator i = std::find(v1.begin(), v1.end(), 1);
        V::iterator j = std::find(v2.begin(), v2.end(), 2);
        if (*i == *j)
            i = j;    // perfectly legal
        // ...
        if (i \!= j)   // the only way to check
            v2.push_back(*i);
        display(v1);
        display(v2);
    }

    It is legal to assign an iterator from one container to another of the
    same type.  This is required to work.  One might want to test whether or
    not such an assignment had been made.  The way one performs such a check
    is using the iterator's ==, \!= operator.  This is a logical and necessary
    function and does not constitute an error.

2.  I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
    This caused a problem in several of the libc++ tests.
    Fixed.

3.  There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
    std::basic_string is inoperable.  std::basic_string uses __wrap_iterator
    to implement its iterators.  __wrap_iterator has been rigged up in debug
    mode to support vector.  But string hasn't been rigged up yet.  This means
    that one gets false positives when using std::string in debug mode.  I've
    upped std::string's priority in www/debug_mode.html.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187636 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-02 00:26:35 +00:00
Howard Hinnant
e9df0a5c6c Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which is
MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can
also define _MSC_VER, and MSVCRT is not necessarily the only C runtime,
these macros should not be used interchangeably.

This patch divides all Windows-related bits into the aforementioned
categories. Two new macros are introduced:

- _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using
  _MSC_VER, excluding Clang.
- _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default
   when _WIN32 is defined.

This leaves _WIN32 for code using the Windows API.

This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF.

Nico, please prepare a patch for CREDITS.TXT, thanks.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187593 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 18:17:34 +00:00
Howard Hinnant
56dcf0b809 Taking another swing at correctly optimizing fill_n.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187587 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 17:29:28 +00:00
Howard Hinnant
eb34122153 Constrain fill_n -> memset operations to include implicit convertibility to unsigned char. This fixes http://llvm.org/bugs/show_bug.cgi?id=16764. Also a drive-by fix on a chrono test suite bug.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187552 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-01 00:41:55 +00:00
Marshall Clow
a61e6f8705 Implement constexpr (n3302) and fix operator *= and /=
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187529 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 21:02:34 +00:00
Marshall Clow
832b304076 Implement n3469 - constexpr for chrono
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187517 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-31 19:32:19 +00:00
Howard Hinnant
f890d9bfaa Debug mode for unordered_multimap. Some mods were done for unordered_map as well to keep all the tests passing. However unordered_map is at the very least still missing tests, if not functionality (if it isn't tested, it probably isn't working).
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187446 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-30 21:04:42 +00:00
Howard Hinnant
0bb0a7c9ea Debug mode for unordered_multiset. The exercise spotted a few places I had missed on unordered_set, so I picked those up as well.
There are actually two debug modes:

   1.  -D_LIBCPP_DEBUG2 or -D_LIBCPP_DEBUG2=1
       This is a relatively expensive debug mode, but very thorough.  This is normally what you want to debug with, but may turn O(1) operations into O(N) operations.

   2.  -D_LIBCPP_DEBUG2=0
       This is "debug lite."  Only preconditions that can be checked with O(1) expense are checked.  For example range checking on an indexing operation.  But not iterator validity.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187369 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 19:05:47 +00:00
Howard Hinnant
d5bfe9030f Add operator new[] to test. Partial fix for valgrind warning in http://llvm.org/bugs/show_bug.cgi?id=16703.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187358 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 14:43:42 +00:00
Marshall Clow
ff46409221 Implement N3421; comparison predicates<void>
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187357 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 14:21:53 +00:00
Marshall Clow
f182038521 literal suffixes for std::chrono
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@187078 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 21:18:14 +00:00
Howard Hinnant
39213641f4 Debug mode for unordered_set. I believe this to be fairly complete for
unordered_set, however it is not complete yet for unordered_multiset,
unordered_map or unordered_multimap.  There has been a lot of work done
for these other three containers, however that work was done just to
keep all of the tests passing.

You can try this out with -D_LIBCPP_DEBUG2.  You will have to link to a
libc++.dylib that has been compiled with src/debug.cpp.  So far, vector
(but not vector<bool>), list, and unordered_set are treated.  I hope to
get the other three unordered containers up fairly quickly now that
unordered_set is done.

The flag _LIBCPP_DEBUG2 will eventually be changed to _LIBCPP_DEBUG, but
not today.  This is my second effort at getting debug mode going for
libc++, and I'm not quite yet ready to throw all of the work under the
first attempt away.

The basic design is that all of the debug information is kept in a
central database, instead of in the containers.  This has been done as
an attempt to have debug mode and non-debug mode be ABI compatible with
each other.  There are some circumstances where if you construct a
container in an environment without debug mode and pass it into debug
mode, the checking will get confused and let you know with a readable
error message.  Passing containers the other way: from debug mode out to
a non-debugging mode container should be 100% safe (at least that is the
goal).

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186991 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 22:01:58 +00:00
Marshall Clow
152343260f Implement string suffixes from N3642
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 17:05:24 +00:00
Howard Hinnant
cd59accbf5 Bill Fisher: This patch fixes a bug where std::regex in ECMAScript mode was ignoring capture groups inside lookahead assertions.
For example, matching /(?=(a))(a)/ to "a" should yield two captures: \1 = "a", \2 = "a"

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186954 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 16:18:04 +00:00
Anders Carlsson
b8e0d9086e Fix a bug in std::fill_n where memset would end up being called in cases when it shouldn’t.
Reviewed by Howard.



git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186875 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22 21:08:00 +00:00
Marshall Clow
da0a0e8a1b Make tuple's constructor and std::get<>(tuple) constexpr. Final stage of fixing bug #16599. Thanks to Howard for the review and updates.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186834 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-22 16:02:19 +00:00
Marshall Clow
8fc4f5a251 Make std::get constexpr
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186525 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-17 18:25:36 +00:00
Howard Hinnant
f7777e8554 Add pointer format test for Windows.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186472 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 23:50:06 +00:00
Marshall Clow
206f6cdc33 Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186430 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-16 17:45:44 +00:00
Marshall Clow
01a0e90783 Make std::forward and std::move (and std::move_if_noexcept) constexpr in C++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186344 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 20:46:11 +00:00
Howard Hinnant
1e1d05121d Bill Fisher: This patch fixes an ill-formed comparison when parsing control escapes, e.g. "\cA\ca". The code will now throw an error_escape exception for invalid control sequences like "\c:" or "\c".
I've added the test cases to bad_escape.pass.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 18:21:11 +00:00
Howard Hinnant
1f96a4df58 A few fixes to tests for Windows port.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186334 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-15 18:09:11 +00:00