Commit Graph

569 Commits

Author SHA1 Message Date
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
Marshall Clow
e8029e54f1 Implement n3584 - Addressing Tuples by Type
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186237 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-13 02:54:05 +00:00
Howard Hinnant
ef7a7b730c Port make_[un]signed tests to platforms where sizeof(wchar_t) == 2.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186136 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 23:51:05 +00:00
Howard Hinnant
e840208989 Bill Fisher: This patch fixes a less likely case where '\b' can back up into invalid memory, when driven by a regex_iterator (for case 1, see r185273 or http://llvm.org/bugs/show_bug.cgi?id=16240)
The attached test program also supplies a test for the case 1 fix in r185273.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186089 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-11 15:32:55 +00:00
Marshall Clow
37c17ed07d Improved tests (and fixed a bug in the tests); thanks to Richard Smith for the suggestion
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@186022 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-10 18:01:34 +00:00
Howard Hinnant
7670f7d1ed Bill Fisher: This patch fixes a bug where regex_iterator doesn't indicate when it's restarting in the middle of a string. This bug causes /^a/ to match in the middle of the string "aaaaaaa", during iteration.
My patch uses  to communicate when  is false.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185950 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-09 17:29:09 +00:00
Howard Hinnant
171771a9f5 War on tabs.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 21:06:38 +00:00
Marshall Clow
e2735d1df0 Implement n3668 - std::exchange
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185863 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 20:54:40 +00:00
Marshall Clow
d29bb4b7c4 Implement n3545 for c++14
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@185856 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-08 20:05:31 +00:00