diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-08-08 16:53:40 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-08-08 16:53:40 +0000 |
commit | 2297469e56abc8e8842c838f8bb5451e8a62570f (patch) | |
tree | ef26eb852426c6d9c6d081c3a9305d6467e7052d | |
parent | a4233227dd3dd88590f8f4d5fdfea2e3ed286d0a (diff) |
Vendor import of libc++ release_50 branch r310316:vendor/libc++/libc++-release_50-r310316
Notes
Notes:
svn path=/vendor/libc++/dist/; revision=322264
svn path=/vendor/libc++/libc++-release_50-r310316/; revision=322265; tag=vendor/libc++/libc++-release_50-r310316
-rw-r--r-- | include/__bsd_locale_defaults.h | 4 | ||||
-rw-r--r-- | include/__bsd_locale_fallbacks.h | 4 | ||||
-rw-r--r-- | include/__locale | 2 | ||||
-rw-r--r-- | include/mutex | 6 | ||||
-rw-r--r-- | include/sstream | 3 | ||||
-rw-r--r-- | test/std/input.output/string.streams/stringstream.cons/string.pass.cpp | 19 | ||||
-rw-r--r-- | test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp | 8 | ||||
-rw-r--r-- | test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp | 9 | ||||
-rw-r--r-- | www/cxx1z_status.html | 6 | ||||
-rw-r--r-- | www/cxx2a_status.html | 2 |
10 files changed, 52 insertions, 11 deletions
diff --git a/include/__bsd_locale_defaults.h b/include/__bsd_locale_defaults.h index f315ca2949e3..cbc407d10305 100644 --- a/include/__bsd_locale_defaults.h +++ b/include/__bsd_locale_defaults.h @@ -15,6 +15,10 @@ #ifndef _LIBCPP_BSD_LOCALE_DEFAULTS_H #define _LIBCPP_BSD_LOCALE_DEFAULTS_H +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + #define __libcpp_mb_cur_max_l(loc) MB_CUR_MAX_L(loc) #define __libcpp_btowc_l(ch, loc) btowc_l(ch, loc) #define __libcpp_wctob_l(wch, loc) wctob_l(wch, loc) diff --git a/include/__bsd_locale_fallbacks.h b/include/__bsd_locale_fallbacks.h index 9489452905c1..5e9e09483072 100644 --- a/include/__bsd_locale_fallbacks.h +++ b/include/__bsd_locale_fallbacks.h @@ -18,6 +18,10 @@ #include <stdarg.h> #include <memory> +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + _LIBCPP_BEGIN_NAMESPACE_STD inline _LIBCPP_ALWAYS_INLINE diff --git a/include/__locale b/include/__locale index 766842294ca3..91ed9e709ee3 100644 --- a/include/__locale +++ b/include/__locale @@ -34,7 +34,7 @@ # include <support/solaris/xlocale.h> #elif defined(_NEWLIB_VERSION) # include <support/newlib/xlocale.h> -#elif (defined(__GLIBC__) || defined(__APPLE__) || defined(__FreeBSD__) \ +#elif (defined(__APPLE__) || defined(__FreeBSD__) \ || defined(__EMSCRIPTEN__) || defined(__IBMCPP__)) # include <xlocale.h> #elif defined(__Fuchsia__) diff --git a/include/mutex b/include/mutex index 1557ed8770d7..fbcc0989fa98 100644 --- a/include/mutex +++ b/include/mutex @@ -116,7 +116,7 @@ public: using mutex_type = Mutex; // If MutexTypes... consists of the single type Mutex explicit scoped_lock(MutexTypes&... m); - scoped_lock(MutexTypes&... m, adopt_lock_t); + scoped_lock(adopt_lock_t, MutexTypes&... m); ~scoped_lock(); scoped_lock(scoped_lock const&) = delete; scoped_lock& operator=(scoped_lock const&) = delete; @@ -500,7 +500,7 @@ public: ~scoped_lock() _LIBCPP_THREAD_SAFETY_ANNOTATION(release_capability()) {__m_.unlock();} _LIBCPP_INLINE_VISIBILITY - explicit scoped_lock(mutex_type& __m, adopt_lock_t) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) + explicit scoped_lock(adopt_lock_t, mutex_type& __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(requires_capability(__m)) : __m_(__m) {} scoped_lock(scoped_lock const&) = delete; @@ -522,7 +522,7 @@ public: } _LIBCPP_INLINE_VISIBILITY - scoped_lock(_MArgs&... __margs, adopt_lock_t) + scoped_lock(adopt_lock_t, _MArgs&... __margs) : __t_(__margs...) { } diff --git a/include/sstream b/include/sstream index b9903f961823..fe65fd7db53d 100644 --- a/include/sstream +++ b/include/sstream @@ -249,7 +249,8 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(ios_base::openmode template <class _CharT, class _Traits, class _Allocator> basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(const string_type& __s, ios_base::openmode __wch) - : __hm_(0), + : __str_(__s.get_allocator()), + __hm_(0), __mode_(__wch) { str(__s); diff --git a/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp index 3776f17f5304..f808bcd14dea 100644 --- a/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp +++ b/test/std/input.output/string.streams/stringstream.cons/string.pass.cpp @@ -18,6 +18,16 @@ #include <sstream> #include <cassert> +template<typename T> +struct NoDefaultAllocator : std::allocator<T> +{ + template<typename U> struct rebind { using other = NoDefaultAllocator<U>; }; + NoDefaultAllocator(int id_) : id(id_) { } + template<typename U> NoDefaultAllocator(const NoDefaultAllocator<U>& a) : id(a.id) { } + int id; +}; + + int main() { { @@ -46,4 +56,13 @@ int main() ss << i << ' ' << 123; assert(ss.str() == L"456 1236 "); } + { // This is https://bugs.llvm.org/show_bug.cgi?id=33727 + typedef std::basic_string <char, std::char_traits<char>, NoDefaultAllocator<char> > S; + typedef std::basic_stringbuf<char, std::char_traits<char>, NoDefaultAllocator<char> > SB; + + S s(NoDefaultAllocator<char>(1)); + SB sb(s); + // This test is not required by the standard, but *where else* could it get the allocator? + assert(sb.str().get_allocator() == s.get_allocator()); + } } diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp index 78165383a158..d49ba8d1139b 100644 --- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp +++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp @@ -14,7 +14,7 @@ // template <class ...Mutex> class scoped_lock; -// scoped_lock(Mutex&..., adopt_lock_t); +// scoped_lock(adopt_lock_t, Mutex&...); #include <mutex> #include <cassert> @@ -43,7 +43,7 @@ int main() using LG = std::scoped_lock<TestMutex>; m1.lock(); { - LG lg(m1, std::adopt_lock); + LG lg(std::adopt_lock, m1); assert(m1.locked); } assert(!m1.locked); @@ -53,7 +53,7 @@ int main() using LG = std::scoped_lock<TestMutex, TestMutex>; m1.lock(); m2.lock(); { - LG lg(m1, m2, std::adopt_lock); + LG lg(std::adopt_lock, m1, m2); assert(m1.locked && m2.locked); } assert(!m1.locked && !m2.locked); @@ -63,7 +63,7 @@ int main() using LG = std::scoped_lock<TestMutex, TestMutex, TestMutex>; m1.lock(); m2.lock(); m3.lock(); { - LG lg(m1, m2, m3, std::adopt_lock); + LG lg(std::adopt_lock, m1, m2, m3); assert(m1.locked && m2.locked && m3.locked); } assert(!m1.locked && !m2.locked && !m3.locked); diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp index f3113435f3ce..1696f9cc2320 100644 --- a/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp +++ b/test/std/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp @@ -261,4 +261,13 @@ int main() { test_copy_ctor_valueless_by_exception(); test_copy_ctor_sfinae(); test_constexpr_copy_ctor_extension(); +#if 0 +// disable this for the moment; it fails on older compilers. +// Need to figure out which compilers will support it. +{ // This is the motivating example from P0739R0 + std::variant<int, double> v1(3); + std::variant v2 = v1; + (void) v2; +} +#endif } diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html index d9c44fc297ac..601c6e7d2f46 100644 --- a/www/cxx1z_status.html +++ b/www/cxx1z_status.html @@ -39,6 +39,8 @@ <p>In February 2017, the C++ standard committee approved this draft, and sent it to ISO for approval as C++17</p> <p>This page shows the status of libc++; the status of clang's support of the language features is <a href="http://clang.llvm.org/cxx_status.html#cxx17">here</a>.</p> + <p>Reminder: Features in unreleased drafts of the standard are subject to change.</p> + <p>The groups that have contributed papers: <ul> <li>LWG - Library working group</li> @@ -163,7 +165,7 @@ <tr><td><a href="http://wg21.link/P0623R0">P0623R0</a></td><td>LWG</td><td>Final C++17 Parallel Algorithms Fixes</td><td>Kona</td><td></td><td></td></tr> <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> <tr><td><a href="http://wg21.link/P0682R1">P0682R1</a></td><td>LWG</td><td>Repairing elementary string conversions</td><td>Toronto</td><td></td><td></td></tr> - <tr><td><a href="http://wg21.link/P0739R0">P0739R0</a></td><td>LWG</td><td>Some improvements to class template argument deduction integration into the standard library</td><td>Toronto</td><td></td><td></td></tr> + <tr><td><a href="http://wg21.link/P0739R0">P0739R0</a></td><td>LWG</td><td>Some improvements to class template argument deduction integration into the standard library</td><td>Toronto</td><td>Complete</td><td>5.0</td></tr> <!-- <tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> --> </table> @@ -497,7 +499,7 @@ <!-- <tr><td></td><td></td><td></td><td></td></tr> --> </table> - <p>Last Updated: 25-May-2017</p> + <p>Last Updated: 27-Jul-2017</p> </div> </body> </html> diff --git a/www/cxx2a_status.html b/www/cxx2a_status.html index 2c9f878b623f..7a17b784af98 100644 --- a/www/cxx2a_status.html +++ b/www/cxx2a_status.html @@ -38,6 +38,8 @@ <p>In July 2017, the C++ standard committee created a draft for the next version of the C++ standard, known here as "C++2a" (probably to be C++20).</p> <p>This page shows the status of libc++; the status of clang's support of the language features is <a href="http://clang.llvm.org/cxx_status.html#cxx2a">here</a>.</p> + <p>Reminder: Features in unreleased drafts of the standard are subject to change.</p> + <p>The groups that have contributed papers: <ul> <li>LWG - Library working group</li> |