Commit Graph

709 Commits

Author SHA1 Message Date
Marshall Clow ef44edfde4 N3545: Quoted strings
llvm-svn: 190032
2013-09-05 04:48:45 +00:00
Marshall Clow 5155a569d1 LWG Issue 2148: Hashing Enums
llvm-svn: 189831
2013-09-03 17:55:32 +00:00
Marshall Clow 710a902cac Updated the synopsis for weak_ptr<T>::owner_before to match the code. No code changes.
llvm-svn: 189812
2013-09-03 14:37:50 +00:00
Howard Hinnant e7d746d8b9 Implement N3672, optional<T>.
llvm-svn: 189772
2013-09-02 20:30:37 +00:00
Howard Hinnant 69bc206547 SFINAE out duration converting constructor if the constructor would otherwise cause a ratio compile-time overflow. This fixes LWG 2094.
llvm-svn: 189722
2013-08-31 16:51:56 +00:00
Howard Hinnant 525dc284b4 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.
llvm-svn: 189687
2013-08-30 19:12:42 +00:00
Howard Hinnant d0a4d73623 Xing Xue: Fix type-o. Thanks to C. Bergström for spotting it.
llvm-svn: 189674
2013-08-30 14:42:39 +00:00
Marshall Clow 1e548c72e7 LWG Issue 2128: Implement global cbegin/rbegin/cend/rbegin
llvm-svn: 189634
2013-08-30 01:17:07 +00:00
Howard Hinnant b81766ca23 Glen: Remove unneeded _LIBCPP_ALWAYS_INLINE.
llvm-svn: 189626
2013-08-29 23:50:48 +00:00
Howard Hinnant 9762413621 Xing Xue: Some minor changes for IBM XLC++/AIX.
llvm-svn: 189623
2013-08-29 23:37:50 +00:00
Howard Hinnant 393068bb04 Turn off extern templates for most uses. It is causing more problems than it is worth. The extern templates will still be built into the dylib, mainly for ABI stability purposes. And the client can still turn these back on with a #define if desire. This fixes http://llvm.org/bugs/show_bug.cgi?id=17027. However there's no associated test for the test suite because http://llvm.org/bugs/show_bug.cgi?id=17027 needs mismatched dylib and headers to fire.
llvm-svn: 189610
2013-08-29 20:56:53 +00:00
Marshall Clow 06fbed03fc LWG Issue 2162: mark allocator_traits::maxsize as noexcept
llvm-svn: 189399
2013-08-27 20:22:15 +00:00
Marshall Clow 7988106b21 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
llvm-svn: 189398
2013-08-27 20:18:59 +00:00
Marshall Clow 5320c2b563 Update synopsis in <locale> to match LWG Issue 2229. No code change
llvm-svn: 189352
2013-08-27 14:22:13 +00:00
Marshall Clow 54c83368a5 Implement LWG issue 2061
llvm-svn: 189345
2013-08-27 13:03:03 +00:00
Howard Hinnant 93288117a5 Apply constexpr to initializer_list for c++1y.
llvm-svn: 189271
2013-08-26 20:11:32 +00:00
Howard Hinnant c9d3ae43d2 G M: Improve support for compilers not supporting defaulted functions.
llvm-svn: 189184
2013-08-24 21:31:37 +00:00
Howard Hinnant 145afa17ca Rename _LIBCPP_DEBUG2 to _LIBCPP_DEBUG.
llvm-svn: 189140
2013-08-23 20:10:18 +00:00
Howard Hinnant 2f57df2aa9 Remove _LIBCPP_DEBUG. This was my first attempt at debug mode for libc++, and is now obsoleted by _LIBCPP_DEBUG2 (which isn't finished).
llvm-svn: 189135
2013-08-23 19:03:36 +00:00
Howard Hinnant fc88dbd298 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.
llvm-svn: 189114
2013-08-23 17:37:05 +00:00
Howard Hinnant 104024cb59 Glen: replace obsolete _LIBCPP_CANTTHROW with _NOEXCEPT.
llvm-svn: 189046
2013-08-22 19:39:03 +00:00
Howard Hinnant 179b1f8cf2 Zhihao Yuan noted that there were a few unneeded statements. Eliminated the unnecessary ones, and commented the ones that are there for non-obvious reasons such as to help things limp along in C++03 language mode.
llvm-svn: 189039
2013-08-22 18:29:50 +00:00
Howard Hinnant 9ff3203fcc Zhihao Yuan noted that a move assignment operation was missing from std::adjacent_difference. Fixed.
llvm-svn: 189036
2013-08-22 18:02:34 +00:00
Howard Hinnant d8bf850359 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.
llvm-svn: 189034
2013-08-22 17:41:48 +00:00
Marshall Clow a86d516213 LWG 2145 - mark constructor for std::error_category as inline and constexpr. Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs)
llvm-svn: 188858
2013-08-21 02:57:19 +00:00
Howard Hinnant 113f13d2a5 Relax complete-type check for functions and function pointers to allow void return type. This bug was exposed by Eli Friedman's commit to clang r188324. Anywhere this version of clang ships, this libc++ fix must follow. However this fix is compatible with previous clangs, and so this libc++ doesn't need to wait for this clang.
llvm-svn: 188413
2013-08-14 21:28:31 +00:00
Howard Hinnant 5d1a701d6d Xing Xue: port to IBM XLC++/AIX.
llvm-svn: 188396
2013-08-14 18:00:20 +00:00
Marshall Clow ede1aa2d31 Add a deleted assignment operator for basic_ostream; LWG Issue #2067
llvm-svn: 188375
2013-08-14 15:15:28 +00:00
Marshall Clow 2d6e2834a8 Implement LWG Issue #2187 (emplace_back and emplace for vector<bool>)
llvm-svn: 188333
2013-08-13 23:54:12 +00:00
Marshall Clow 2585835c3b Second half (map/multimap) of N3657
llvm-svn: 188320
2013-08-13 22:18:47 +00:00
Marshall Clow 25d3402c6a First half of support for N3657; heterogenous lookups for set/multiset
llvm-svn: 188241
2013-08-13 01:11:06 +00:00
Howard Hinnant f0544c2086 Nico Rieck: this patch series fixes visibility issues on Windows as explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>.
llvm-svn: 188192
2013-08-12 18:38:34 +00:00
Howard Hinnant 6afbc442d6 Add a check for arrays of unknown bounds to is_destructible. This fixes http://llvm.org/bugs/show_bug.cgi?id=16839
llvm-svn: 188080
2013-08-09 16:53:45 +00:00
Howard Hinnant d7cda0680a Partial implementation of N3665. This paper was not voted into the C++1y draft. However I was looking at it and with some experimentation realized that I could partially implement it, and at the same time offer a performance optimization to cout. I simply added an xsputn override to the cout filebuf. The override does nothing special at all if there is a non-trivial codecvt installed. However if the codecvt returns true for always_noconv(), then this function can dump an entire string to fwrite, instead of doing it a character at a time under overflow(). This just makes sense. I stopped short of a full implementation of N3665 because in order to do so, xsputn would have to allocate a buffer when always_noconv() returned false, and I don't want to go to that expense.
llvm-svn: 188077
2013-08-09 16:25:43 +00:00
Marshall Clow 2472b928d2 N3644 tests for map/multimap/set/multiset. Drive-by NOEXCEPT for __tree_const_iterator constructor. Fix comment typos in other tests
llvm-svn: 188019
2013-08-08 21:52:50 +00:00
Howard Hinnant 8c9742051d My previous reorganization of addressof broke -std=c++03. Thanks much to Arnold Schwaighofer for catching this. This patch also catches a few more missing addressof in <future>, thanks go to Zhihao Yuan for catching these.
llvm-svn: 187997
2013-08-08 18:38:55 +00:00
Arnold Schwaighofer 5331e3a481 Revert r187927.
Zhihao Yuan: Replace operator& with addressof in reference_wrapper constructor.

It breaks a clang bootstrap.

llvm-svn: 187959
2013-08-08 03:06:24 +00:00
Howard Hinnant 9027f5e3de Zhihao Yuan: Replace operator& with addressof in reference_wrapper constructor.
llvm-svn: 187927
2013-08-07 23:02:42 +00:00
Marshall Clow 2c1a894061 N3644 support for <unordered_set> and <unordered_map>
llvm-svn: 187915
2013-08-07 21:30:44 +00:00
Marshall Clow 36b2a3b0e5 N3644 support for vector<bool>
llvm-svn: 187911
2013-08-07 20:53:44 +00:00
Marshall Clow 07186a7d2d N3644 support for <string> and <vector>
llvm-svn: 187909
2013-08-07 20:48:48 +00:00
Howard Hinnant 303e27d8ce Correct logic bug in find optimization for vector<bool>. This fixes http://llvm.org/bugs/show_bug.cgi?id=16816
llvm-svn: 187908
2013-08-07 20:42:16 +00:00
Howard Hinnant d098713aaf War on tabs
llvm-svn: 187906
2013-08-07 19:39:48 +00:00
Marshall Clow 8fe0a3722c Implement NULL iterators for <forward_list> and <deque> re: N3644
llvm-svn: 187805
2013-08-06 16:14:36 +00:00
Marshall Clow 0c37cfd8b8 Implement NULL iterators for <list> re: N3644
llvm-svn: 187740
2013-08-05 21:23:28 +00:00
Howard Hinnant 2f51de568f 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.
llvm-svn: 187659
2013-08-02 17:50:49 +00:00
Howard Hinnant 42a3046eef 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.

llvm-svn: 187636
2013-08-02 00:26:35 +00:00
Howard Hinnant 0be8f64c44 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.

llvm-svn: 187593
2013-08-01 18:17:34 +00:00
Howard Hinnant 0f242bea10 Taking another swing at correctly optimizing fill_n.
llvm-svn: 187587
2013-08-01 17:29:28 +00:00
Howard Hinnant ce075cf1aa 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.
llvm-svn: 187552
2013-08-01 00:41:55 +00:00