From owner-svn-src-projects@freebsd.org Wed Sep 16 22:26:56 2015 Return-Path: Delivered-To: svn-src-projects@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08E0A9CEB73 for ; Wed, 16 Sep 2015 22:26:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB12D1C5A; Wed, 16 Sep 2015 22:26:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8GMQtKL028178; Wed, 16 Sep 2015 22:26:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8GMQrOQ028160; Wed, 16 Sep 2015 22:26:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201509162226.t8GMQrOQ028160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 16 Sep 2015 22:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r287877 - in projects/clang370-import: . contrib/libc++ contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/suppo... X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Sep 2015 22:26:56 -0000 Author: dim Date: Wed Sep 16 22:26:52 2015 New Revision: 287877 URL: https://svnweb.freebsd.org/changeset/base/287877 Log: Update libc++ to 3.7.0 release. Added: projects/clang370-import/contrib/libc++/include/__undef___deallocate - copied unchanged from r287682, vendor/libc++/dist/include/__undef___deallocate projects/clang370-import/contrib/libc++/include/experimental/algorithm - copied unchanged from r287682, vendor/libc++/dist/include/experimental/algorithm projects/clang370-import/contrib/libc++/include/experimental/chrono - copied unchanged from r287682, vendor/libc++/dist/include/experimental/chrono projects/clang370-import/contrib/libc++/include/experimental/ratio - copied unchanged from r287682, vendor/libc++/dist/include/experimental/ratio projects/clang370-import/contrib/libc++/include/experimental/system_error - copied unchanged from r287682, vendor/libc++/dist/include/experimental/system_error projects/clang370-import/contrib/libc++/include/experimental/tuple - copied unchanged from r287682, vendor/libc++/dist/include/experimental/tuple projects/clang370-import/contrib/libc++/src/config_elast.h - copied unchanged from r287682, vendor/libc++/dist/src/config_elast.h projects/clang370-import/contrib/libc++/src/support/ - copied from r287682, vendor/libc++/dist/src/support/ Deleted: projects/clang370-import/contrib/libc++/include/__tuple_03 projects/clang370-import/contrib/libc++/src/support/newlib/ projects/clang370-import/contrib/libc++/src/support/solaris/ projects/clang370-import/contrib/libc++/src/support/win32/ Modified: projects/clang370-import/ObsoleteFiles.inc projects/clang370-import/contrib/libc++/CREDITS.TXT projects/clang370-import/contrib/libc++/LICENSE.TXT projects/clang370-import/contrib/libc++/include/__config projects/clang370-import/contrib/libc++/include/__debug projects/clang370-import/contrib/libc++/include/__functional_03 projects/clang370-import/contrib/libc++/include/__functional_base projects/clang370-import/contrib/libc++/include/__functional_base_03 projects/clang370-import/contrib/libc++/include/__hash_table projects/clang370-import/contrib/libc++/include/__locale projects/clang370-import/contrib/libc++/include/__refstring projects/clang370-import/contrib/libc++/include/__split_buffer projects/clang370-import/contrib/libc++/include/__sso_allocator projects/clang370-import/contrib/libc++/include/__tree projects/clang370-import/contrib/libc++/include/__tuple projects/clang370-import/contrib/libc++/include/algorithm projects/clang370-import/contrib/libc++/include/array projects/clang370-import/contrib/libc++/include/atomic projects/clang370-import/contrib/libc++/include/cctype projects/clang370-import/contrib/libc++/include/cinttypes projects/clang370-import/contrib/libc++/include/clocale projects/clang370-import/contrib/libc++/include/cmath projects/clang370-import/contrib/libc++/include/cstdio projects/clang370-import/contrib/libc++/include/cstdlib projects/clang370-import/contrib/libc++/include/cstring projects/clang370-import/contrib/libc++/include/ctime projects/clang370-import/contrib/libc++/include/cwchar projects/clang370-import/contrib/libc++/include/deque projects/clang370-import/contrib/libc++/include/exception projects/clang370-import/contrib/libc++/include/experimental/__config projects/clang370-import/contrib/libc++/include/experimental/dynarray projects/clang370-import/contrib/libc++/include/experimental/string_view projects/clang370-import/contrib/libc++/include/experimental/type_traits projects/clang370-import/contrib/libc++/include/experimental/utility projects/clang370-import/contrib/libc++/include/ext/hash_map projects/clang370-import/contrib/libc++/include/forward_list projects/clang370-import/contrib/libc++/include/fstream projects/clang370-import/contrib/libc++/include/functional projects/clang370-import/contrib/libc++/include/future projects/clang370-import/contrib/libc++/include/iosfwd projects/clang370-import/contrib/libc++/include/iostream projects/clang370-import/contrib/libc++/include/iterator projects/clang370-import/contrib/libc++/include/list projects/clang370-import/contrib/libc++/include/locale projects/clang370-import/contrib/libc++/include/map projects/clang370-import/contrib/libc++/include/memory projects/clang370-import/contrib/libc++/include/module.modulemap projects/clang370-import/contrib/libc++/include/mutex projects/clang370-import/contrib/libc++/include/new projects/clang370-import/contrib/libc++/include/ostream projects/clang370-import/contrib/libc++/include/queue projects/clang370-import/contrib/libc++/include/random projects/clang370-import/contrib/libc++/include/ratio projects/clang370-import/contrib/libc++/include/regex projects/clang370-import/contrib/libc++/include/scoped_allocator projects/clang370-import/contrib/libc++/include/set projects/clang370-import/contrib/libc++/include/shared_mutex projects/clang370-import/contrib/libc++/include/stack projects/clang370-import/contrib/libc++/include/streambuf projects/clang370-import/contrib/libc++/include/string projects/clang370-import/contrib/libc++/include/tuple projects/clang370-import/contrib/libc++/include/type_traits projects/clang370-import/contrib/libc++/include/unordered_map projects/clang370-import/contrib/libc++/include/unordered_set projects/clang370-import/contrib/libc++/include/utility projects/clang370-import/contrib/libc++/include/valarray projects/clang370-import/contrib/libc++/include/vector projects/clang370-import/contrib/libc++/src/chrono.cpp projects/clang370-import/contrib/libc++/src/debug.cpp projects/clang370-import/contrib/libc++/src/exception.cpp projects/clang370-import/contrib/libc++/src/future.cpp projects/clang370-import/contrib/libc++/src/ios.cpp projects/clang370-import/contrib/libc++/src/iostream.cpp projects/clang370-import/contrib/libc++/src/locale.cpp projects/clang370-import/contrib/libc++/src/memory.cpp projects/clang370-import/contrib/libc++/src/mutex.cpp projects/clang370-import/contrib/libc++/src/new.cpp projects/clang370-import/contrib/libc++/src/random.cpp projects/clang370-import/contrib/libc++/src/shared_mutex.cpp projects/clang370-import/contrib/libc++/src/string.cpp projects/clang370-import/contrib/libc++/src/system_error.cpp projects/clang370-import/contrib/libc++/src/thread.cpp projects/clang370-import/lib/libc++/Makefile projects/clang370-import/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: projects/clang370-import/contrib/libc++/ (props changed) Modified: projects/clang370-import/ObsoleteFiles.inc ============================================================================== --- projects/clang370-import/ObsoleteFiles.inc Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/ObsoleteFiles.inc Wed Sep 16 22:26:52 2015 (r287877) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 2015mmdd: new libc++ import +OLD_FILES+=usr/include/c++/__tuple_03 # 2015mmdd: new clang import which bumps version from 3.6.1 to 3.7.0. OLD_FILES+=usr/lib/clang/3.6.1/include/__stddef_max_align_t.h OLD_FILES+=usr/lib/clang/3.6.1/include/__wmmintrin_aes.h Modified: projects/clang370-import/contrib/libc++/CREDITS.TXT ============================================================================== --- projects/clang370-import/contrib/libc++/CREDITS.TXT Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/CREDITS.TXT Wed Sep 16 22:26:52 2015 (r287877) @@ -12,6 +12,10 @@ N: Saleem Abdulrasool E: compnerd@compnerd.org D: Minor patches and Linux fixes. +N: Dan Albert +E: danalbert@google.com +D: Android support and test runner improvements. + N: Dimitry Andric E: dimitry@andric.com D: Visibility fixes, minor FreeBSD portability patches. @@ -84,6 +88,10 @@ N: Nico Rieck E: nico.rieck@gmail.com D: Windows fixes +N: Jon Roelofs +E: jonathan@codesourcery.com +D: Remote testing, Newlib port, baremetal/single-threaded support. + N: Jonathan Sauer D: Minor patches, mostly related to constexpr @@ -105,6 +113,9 @@ D: Minor fix N: Michael van der Westhuizen E: r1mikey at gmail dot com +N: Larisse Voufo +D: Minor patches. + N: Klaas de Vries E: klaas at klaasgaaf dot nl D: Minor bug fix. Modified: projects/clang370-import/contrib/libc++/LICENSE.TXT ============================================================================== --- projects/clang370-import/contrib/libc++/LICENSE.TXT Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/LICENSE.TXT Wed Sep 16 22:26:52 2015 (r287877) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT All rights reserved. Modified: projects/clang370-import/contrib/libc++/include/__config ============================================================================== --- projects/clang370-import/contrib/libc++/include/__config Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__config Wed Sep 16 22:26:52 2015 (r287877) @@ -17,14 +17,11 @@ #ifdef __GNUC__ #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__) +#else +#define _GNUC_VER 0 #endif -#if !_WIN32 -#include -#include // for ELAST on FreeBSD -#endif - -#define _LIBCPP_VERSION 1101 +#define _LIBCPP_VERSION 3700 #define _LIBCPP_ABI_VERSION 1 @@ -33,6 +30,23 @@ #define _LIBCPP_NAMESPACE _LIBCPP_CONCAT(__,_LIBCPP_ABI_VERSION) + +#ifndef __has_attribute +#define __has_attribute(__x) 0 +#endif +#ifndef __has_builtin +#define __has_builtin(__x) 0 +#endif +#ifndef __has_feature +#define __has_feature(__x) 0 +#endif +// '__is_identifier' returns '0' if '__x' is a reserved identifier provided by +// the compiler and '1' otherwise. +#ifndef __is_identifier +#define __is_identifier(__x) 1 +#endif + + #ifdef __LITTLE_ENDIAN__ #if __LITTLE_ENDIAN__ #define _LIBCPP_LITTLE_ENDIAN 1 @@ -76,10 +90,8 @@ #ifdef _WIN32 # define _LIBCPP_LITTLE_ENDIAN 1 # define _LIBCPP_BIG_ENDIAN 0 -// Compiler intrinsics (GCC or MSVC) -# if defined(__clang__) \ - || (defined(_MSC_VER) && _MSC_VER >= 1400) \ - || (defined(__GNUC__) && _GNUC_VER > 403) +// Compiler intrinsics (MSVC) +#if defined(_MSC_VER) && _MSC_VER >= 1400 # define _LIBCPP_HAS_IS_BASE_OF # endif # if defined(_MSC_VER) && !defined(__clang__) @@ -94,12 +106,6 @@ # endif #endif // _WIN32 -#ifdef __linux__ -# if defined(__GNUC__) && _GNUC_VER >= 403 -# define _LIBCPP_HAS_IS_BASE_OF -# endif -#endif - #ifdef __sun__ # include # ifdef _LITTLE_ENDIAN @@ -111,12 +117,22 @@ # endif #endif // __sun__ -#if defined(__native_client__) +#if defined(__CloudABI__) + // Certain architectures provide arc4random(). Prefer using + // arc4random() over /dev/{u,}random to make it possible to obtain + // random data even when using sandboxing mechanisms such as chroots, + // Capsicum, etc. +# define _LIBCPP_USING_ARC4_RANDOM +#elif defined(__native_client__) // NaCl's sandbox (which PNaCl also runs in) doesn't allow filesystem access, // including accesses to the special files under /dev. C++11's // std::random_device is instead exposed through a NaCl syscall. # define _LIBCPP_USING_NACL_RANDOM -#endif // defined(__native_client__) +#elif defined(_WIN32) +# define _LIBCPP_USING_WIN32_RANDOM +#else +# define _LIBCPP_USING_DEV_RANDOM +#endif #if !defined(_LIBCPP_LITTLE_ENDIAN) || !defined(_LIBCPP_BIG_ENDIAN) # include @@ -173,10 +189,6 @@ #endif // _WIN32 -#ifndef __has_attribute -#define __has_attribute(__x) 0 -#endif - #ifndef _LIBCPP_HIDDEN #define _LIBCPP_HIDDEN __attribute__ ((__visibility__("hidden"))) #endif @@ -309,6 +321,10 @@ typedef __char32_t char32_t; # define _LIBCPP_HAS_IS_BASE_OF #endif +#if __has_feature(is_final) +# define _LIBCPP_HAS_IS_FINAL +#endif + // Objective-C++ features (opt-in) #if __has_feature(objc_arc) #define _LIBCPP_HAS_OBJC_ARC @@ -327,6 +343,10 @@ typedef __char32_t char32_t; #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR #endif +#if !(__has_feature(cxx_variable_templates)) +#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES +#endif + #if __ISO_C_VISIBLE >= 2011 || __cplusplus >= 201103L #if defined(__FreeBSD__) #define _LIBCPP_HAS_QUICK_EXIT @@ -388,6 +408,11 @@ namespace std { #if _GNUC_VER >= 407 #define _LIBCPP_UNDERLYING_TYPE(T) __underlying_type(T) #define _LIBCPP_IS_LITERAL(T) __is_literal_type(T) +#define _LIBCPP_HAS_IS_FINAL +#endif + +#if defined(__GNUC__) && _GNUC_VER >= 403 +# define _LIBCPP_HAS_IS_BASE_OF #endif #if !__EXCEPTIONS @@ -406,6 +431,8 @@ namespace std { // No version of GCC supports relaxed constexpr rules #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR +// GCC 5 will support variable templates +#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #define _NOEXCEPT throw() #define _NOEXCEPT_(x) @@ -477,6 +504,7 @@ using namespace _LIBCPP_NAMESPACE __attr #define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER #define _LIBCPP_HAS_NO_CONSTEXPR #define _LIBCPP_HAS_NO_CXX14_CONSTEXPR +#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_NO_DELETED_FUNCTIONS #define _LIBCPP_HAS_NO_DEFAULTED_FUNCTIONS @@ -519,6 +547,8 @@ namespace std { #define _LIBCPP_HAS_NO_NULLPTR #define _LIBCPP_HAS_NO_UNICODE_CHARS #define _LIBCPP_HAS_IS_BASE_OF +#define _LIBCPP_HAS_IS_FINAL +#define _LIBCPP_HAS_NO_VARIABLE_TEMPLATES #if defined(_AIX) #define __MULTILOCALE_API @@ -558,7 +588,12 @@ template struct __static_asse #endif // _LIBCPP_HAS_NO_STATIC_ASSERT #ifdef _LIBCPP_HAS_NO_DECLTYPE -#define decltype(x) __typeof__(x) +// GCC 4.6 provides __decltype in all standard modes. +#if !__is_identifier(__decltype) || _GNUC_VER >= 406 +# define decltype(__x) __decltype(__x) +#else +# define decltype(__x) __typeof__(__x) +#endif #endif #ifdef _LIBCPP_HAS_NO_CONSTEXPR @@ -579,14 +614,6 @@ template struct __static_asse #define _NOALIAS #endif -#ifndef __has_feature -#define __has_feature(__x) 0 -#endif - -#ifndef __has_builtin -#define __has_builtin(__x) 0 -#endif - #if __has_feature(cxx_explicit_conversions) || defined(__IBMCPP__) # define _LIBCPP_EXPLICIT explicit #else @@ -633,10 +660,16 @@ template struct __static_asse #define _LIBCPP_NONUNIQUE_RTTI_BIT (1ULL << 63) #endif -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || defined(__sun__) || defined(__NetBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(_WIN32) || \ + defined(__sun__) || defined(__NetBSD__) || defined(__CloudABI__) #define _LIBCPP_LOCALE__L_EXTENSIONS 1 #endif +#if !defined(_WIN32) && !defined(__ANDROID__) && !defined(_NEWLIB_VERSION) && \ + !defined(__CloudABI__) +#define _LIBCPP_HAS_CATOPEN 1 +#endif + #ifdef __FreeBSD__ #define _DECLARE_C99_LDBL_MATH 1 #endif @@ -649,21 +682,6 @@ template struct __static_asse #define _LIBCPP_WCTYPE_IS_MASK #endif -#if defined(ELAST) -#define _LIBCPP_ELAST ELAST -#elif defined(__linux__) -#define _LIBCPP_ELAST 4095 -#elif defined(_NEWLIB_VERSION) -#define _LIBCPP_ELAST __ELASTERROR -#elif defined(__APPLE__) -// Not _LIBCPP_ELAST needed on Apple -#elif defined(__sun__) -#define _LIBCPP_ELAST ESTALE -#else -// Warn here so that the person doing the libcxx port has an easier time: -#warning This platform's ELAST hasn't been ported yet -#endif - #ifndef _LIBCPP_TRIVIAL_PAIR_COPY_CTOR # if defined(__FreeBSD__) // Making the std::pair copy constructor trivial breaks ABI compatibility with @@ -731,4 +749,29 @@ extern "C" void __sanitizer_annotate_con _LIBCPP_HAS_NO_THREADS is defined. #endif +// Systems that use capability-based security (FreeBSD with Capsicum, +// Nuxi CloudABI) may only provide local filesystem access (using *at()). +// Functions like open(), rename(), unlink() and stat() should not be +// used, as they attempt to access the global filesystem namespace. +#ifdef __CloudABI__ +#define _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE +#endif + +// CloudABI is intended for running networked services. Processes do not +// have standard input and output channels. +#ifdef __CloudABI__ +#define _LIBCPP_HAS_NO_STDIN +#define _LIBCPP_HAS_NO_STDOUT +#endif + +#if defined(__ANDROID__) || defined(__CloudABI__) +#define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE +#endif + +// Thread-unsafe functions such as strtok(), mbtowc() and localtime() +// are not available. +#ifdef __CloudABI__ +#define _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS +#endif + #endif // _LIBCPP_CONFIG Modified: projects/clang370-import/contrib/libc++/include/__debug ============================================================================== --- projects/clang370-import/contrib/libc++/include/__debug Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__debug Wed Sep 16 22:26:52 2015 (r287877) @@ -22,7 +22,7 @@ # include # include # ifndef _LIBCPP_ASSERT -# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::printf("%s\n", m), _VSTD::abort())) +# define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : (_VSTD::fprintf(stderr, "%s\n", m), _VSTD::abort())) # endif #endif Modified: projects/clang370-import/contrib/libc++/include/__functional_03 ============================================================================== --- projects/clang370-import/contrib/libc++/include/__functional_03 Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__functional_03 Wed Sep 16 22:26:52 2015 (r287877) @@ -333,7 +333,8 @@ template* __func<_Fp, _Alloc, _Rp()>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -359,7 +360,8 @@ template::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); @@ -369,7 +371,8 @@ template::operator()() { - return __invoke(__f_.first()); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first()); } #ifndef _LIBCPP_NO_RTTI @@ -416,7 +419,8 @@ template* __func<_Fp, _Alloc, _Rp(_A0)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -442,7 +446,8 @@ template::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); @@ -452,7 +457,8 @@ template::operator()(_A0 __a0) { - return __invoke(__f_.first(), __a0); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0); } #ifndef _LIBCPP_NO_RTTI @@ -499,7 +505,8 @@ template* __func<_Fp, _Alloc, _Rp(_A0, _A1)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -525,7 +532,8 @@ template::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); @@ -535,7 +543,8 @@ template::operator()(_A0 __a0, _A1 __a1) { - return __invoke(__f_.first(), __a0, __a1); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0, __a1); } #ifndef _LIBCPP_NO_RTTI @@ -582,7 +591,8 @@ template* __func<_Fp, _Alloc, _Rp(_A0, _A1, _A2)>::__clone() const { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__func, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -608,7 +618,8 @@ template::destroy_deallocate() { - typedef typename _Alloc::template rebind<__func>::other _Ap; + typedef allocator_traits<_Alloc> __alloc_traits; + typedef typename __rebind_alloc_helper<__alloc_traits, __func>::type _Ap; _Ap __a(__f_.second()); __f_.~__compressed_pair<_Fp, _Alloc>(); __a.deallocate(this, 1); @@ -618,7 +629,8 @@ template::operator()(_A0 __a0, _A1 __a1, _A2 __a2) { - return __invoke(__f_.first(), __a0, __a1, __a2); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(__f_.first(), __a0, __a1, __a2); } #ifndef _LIBCPP_NO_RTTI @@ -790,17 +802,11 @@ function<_Rp()>::function(allocator_arg_ if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); + ::new (__f_) _FF(__f, __a0); } else { - typedef typename __alloc_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<_FF> -#else - rebind_alloc<_FF>::other -#endif - _Ap; + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; _Ap __a(__a0); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -827,6 +833,7 @@ function<_Rp()>::operator=(nullptr_t) else if (__f_) __f_->destroy_deallocate(); __f_ = 0; + return *this; } template @@ -1092,17 +1099,11 @@ function<_Rp(_A0)>::function(allocator_a if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); + ::new (__f_) _FF(__f, __a0); } else { - typedef typename __alloc_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<_FF> -#else - rebind_alloc<_FF>::other -#endif - _Ap; + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; _Ap __a(__a0); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -1129,6 +1130,7 @@ function<_Rp(_A0)>::operator=(nullptr_t) else if (__f_) __f_->destroy_deallocate(); __f_ = 0; + return *this; } template @@ -1394,17 +1396,11 @@ function<_Rp(_A0, _A1)>::function(alloca if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); + ::new (__f_) _FF(__f, __a0); } else { - typedef typename __alloc_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<_FF> -#else - rebind_alloc<_FF>::other -#endif - _Ap; + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; _Ap __a(__a0); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -1431,6 +1427,7 @@ function<_Rp(_A0, _A1)>::operator=(nullp else if (__f_) __f_->destroy_deallocate(); __f_ = 0; + return *this; } template @@ -1696,17 +1693,11 @@ function<_Rp(_A0, _A1, _A2)>::function(a if (sizeof(_FF) <= sizeof(__buf_)) { __f_ = (__base*)&__buf_; - ::new (__f_) _FF(__f); + ::new (__f_) _FF(__f, __a0); } else { - typedef typename __alloc_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<_FF> -#else - rebind_alloc<_FF>::other -#endif - _Ap; + typedef typename __rebind_alloc_helper<__alloc_traits, _FF>::type _Ap; _Ap __a(__a0); typedef __allocator_destructor<_Ap> _Dp; unique_ptr<__base, _Dp> __hold(__a.allocate(1), _Dp(__a, 1)); @@ -1733,6 +1724,7 @@ function<_Rp(_A0, _A1, _A2)>::operator=( else if (__f_) __f_->destroy_deallocate(); __f_ = 0; + return *this; } template @@ -2099,14 +2091,16 @@ public: result_type operator()(_Args&& ...__args) { - return base::operator()(_VSTD::forward<_Args>(__args)...); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(static_cast(*this), _VSTD::forward<_Args>(__args)...); } template result_type operator()(_Args&& ...__args) const { - return base::operator()(_VSTD::forward<_Args>(__args)...); + typedef __invoke_void_return_wrapper<_Rp> _Invoker; + return _Invoker::__call(static_cast(*this), _VSTD::forward<_Args>(__args)...); } }; Modified: projects/clang370-import/contrib/libc++/include/__functional_base ============================================================================== --- projects/clang370-import/contrib/libc++/include/__functional_base Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__functional_base Wed Sep 16 22:26:52 2015 (r287877) @@ -70,7 +70,9 @@ struct _LIBCPP_TYPE_VIS_ONLY less template _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY auto operator()(_T1&& __t, _T2&& __u) const - { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } + _NOEXCEPT_(noexcept(_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u))) + -> decltype (_VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u)) + { return _VSTD::forward<_T1>(__t) < _VSTD::forward<_T2>(__u); } typedef void is_transparent; }; #endif @@ -419,6 +421,26 @@ struct __invoke_return typedef decltype(__invoke(_VSTD::declval<_Tp>(), _VSTD::declval<_Args>()...)) type; }; +template +struct __invoke_void_return_wrapper +{ + template + static _Ret __call(_Args&&... __args) + { + return __invoke(_VSTD::forward<_Args>(__args)...); + } +}; + +template <> +struct __invoke_void_return_wrapper +{ + template + static void __call(_Args&&... __args) + { + __invoke(_VSTD::forward<_Args>(__args)...); + } +}; + template class _LIBCPP_TYPE_VIS_ONLY reference_wrapper : public __weak_result_type<_Tp> Modified: projects/clang370-import/contrib/libc++/include/__functional_base_03 ============================================================================== --- projects/clang370-import/contrib/libc++/include/__functional_base_03 Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__functional_base_03 Wed Sep 16 22:26:52 2015 (r287877) @@ -995,6 +995,63 @@ struct __invoke_return2 _VSTD::declval<_A2>())) type; }; +template +struct __invoke_void_return_wrapper +{ + template + static _Ret __call(_Fn __f) + { + return __invoke(__f); + } + + template + static _Ret __call(_Fn __f, _A0& __a0) + { + return __invoke(__f, __a0); + } + + template + static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1) + { + return __invoke(__f, __a0, __a1); + } + + template + static _Ret __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) + { + return __invoke(__f, __a0, __a1, __a2); + } +}; + + +template <> +struct __invoke_void_return_wrapper +{ + template + static void __call(_Fn __f) + { + __invoke(__f); + } + + template + static void __call(_Fn __f, _A0& __a0) + { + __invoke(__f, __a0); + } + + template + static void __call(_Fn __f, _A0& __a0, _A1& __a1) + { + __invoke(__f, __a0, __a1); + } + + template + static void __call(_Fn __f, _A0& __a0, _A1& __a1, _A2& __a2) + { + __invoke(__f, __a0, __a1, __a2); + } +}; + template class _LIBCPP_TYPE_VIS_ONLY reference_wrapper : public __weak_result_type<_Tp> Modified: projects/clang370-import/contrib/libc++/include/__hash_table ============================================================================== --- projects/clang370-import/contrib/libc++/include/__hash_table Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__hash_table Wed Sep 16 22:26:52 2015 (r287877) @@ -19,6 +19,7 @@ #include #include <__undef_min_max> +#include <__undef___deallocate> #include <__debug> @@ -61,7 +62,7 @@ struct __hash_node inline _LIBCPP_INLINE_VISIBILITY bool -__is_power2(size_t __bc) +__is_hash_power2(size_t __bc) { return __bc > 2 && !(__bc & (__bc - 1)); } @@ -75,7 +76,7 @@ __constrain_hash(size_t __h, size_t __bc inline _LIBCPP_INLINE_VISIBILITY size_t -__next_pow2(size_t __n) +__next_hash_pow2(size_t __n) { return size_t(1) << (std::numeric_limits::digits - __clz(__n-1)); } @@ -84,8 +85,6 @@ template class _LIBCPP_TYPE_VIS_ONLY __hash_const_iterator; template class _LIBCPP_TYPE_VIS_ONLY __hash_map_iterator; template class _LIBCPP_TYPE_VIS_ONLY __hash_map_const_iterator; -template - class _LIBCPP_TYPE_VIS_ONLY unordered_map; template class _LIBCPP_TYPE_VIS_ONLY __hash_iterator @@ -776,13 +775,7 @@ public: public: // Create __node typedef __hash_node __node; - typedef typename __alloc_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<__node> -#else - rebind_alloc<__node>::other -#endif - __node_allocator; + typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator; typedef allocator_traits<__node_allocator> __node_traits; typedef typename __node_traits::pointer __node_pointer; typedef typename __node_traits::pointer __node_const_pointer; @@ -797,13 +790,7 @@ public: private: - typedef typename __node_traits::template -#ifndef _LIBCPP_HAS_NO_TEMPLATE_ALIASES - rebind_alloc<__node_pointer> -#else - rebind_alloc<__node_pointer>::other -#endif - __pointer_allocator; + typedef typename __rebind_alloc_helper<__node_traits, __node_pointer>::type __pointer_allocator; typedef __bucket_list_deallocator<__pointer_allocator> __bucket_list_deleter; typedef unique_ptr<__node_pointer[], __bucket_list_deleter> __bucket_list; typedef allocator_traits<__pointer_allocator> __pointer_alloc_traits; @@ -909,11 +896,21 @@ public: iterator __emplace_hint_multi(const_iterator __p, _Args&&... __args); #endif // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS) +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + template + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique_value(_ValueTp&& __x); +#else + _LIBCPP_INLINE_VISIBILITY + pair __insert_unique_value(const value_type& __x); +#endif + pair __insert_unique(const value_type& __x); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES + pair __insert_unique(value_type&& __x); template - pair __insert_unique(_Pp&& __x); + pair __insert_unique(_Pp&& __x); #endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES @@ -988,12 +985,14 @@ public: void swap(__hash_table& __u) _NOEXCEPT_( - (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || - __is_nothrow_swappable<__pointer_allocator>::value) && - (!__node_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value) && - __is_nothrow_swappable::value && - __is_nothrow_swappable::value); + __is_nothrow_swappable::value && __is_nothrow_swappable::value +#if _LIBCPP_STD_VER <= 11 + && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value + || __is_nothrow_swappable<__pointer_allocator>::value) + && (!__node_traits::propagate_on_container_swap::value + || __is_nothrow_swappable<__node_allocator>::value) +#endif + ); _LIBCPP_INLINE_VISIBILITY size_type max_bucket_count() const _NOEXCEPT @@ -1121,38 +1120,6 @@ private: _LIBCPP_INLINE_VISIBILITY void __move_assign_alloc(__hash_table&, false_type) _NOEXCEPT {} - template - _LIBCPP_INLINE_VISIBILITY - static - void - __swap_alloc(_Ap& __x, _Ap& __y) - _NOEXCEPT_( - !allocator_traits<_Ap>::propagate_on_container_swap::value || - __is_nothrow_swappable<_Ap>::value) - { - __swap_alloc(__x, __y, - integral_constant::propagate_on_container_swap::value - >()); - } - - template - _LIBCPP_INLINE_VISIBILITY - static - void - __swap_alloc(_Ap& __x, _Ap& __y, true_type) - _NOEXCEPT_(__is_nothrow_swappable<_Ap>::value) - { - using _VSTD::swap; - swap(__x, __y); - } - - template - _LIBCPP_INLINE_VISIBILITY - static - void - __swap_alloc(_Ap&, _Ap&, false_type) _NOEXCEPT {} - void __deallocate(__node_pointer __np) _NOEXCEPT; __node_pointer __detach() _NOEXCEPT; @@ -1615,7 +1582,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> { if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), + rehash(_VSTD::max(2 * __bc + !__is_hash_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); __chash = __constrain_hash(__nd->__hash_, __bc); @@ -1658,7 +1625,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), + rehash(_VSTD::max(2 * __bc + !__is_hash_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } @@ -1728,7 +1695,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> size_type __bc = bucket_count(); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), + rehash(_VSTD::max(2 * __bc + !__is_hash_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); } @@ -1752,6 +1719,26 @@ template ::iterator, bool> __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(const value_type& __x) { + return __insert_unique_value(__x); +} + + +#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +template +template +_LIBCPP_INLINE_VISIBILITY +pair::iterator, bool> +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(_ValueTp&& __x) +#else +template +_LIBCPP_INLINE_VISIBILITY +pair::iterator, bool> +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique_value(const value_type& __x) +#endif +{ +#if defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) + typedef const value_type& _ValueTp; +#endif size_t __hash = hash_function()(__x); size_type __bc = bucket_count(); bool __inserted = false; @@ -1773,10 +1760,10 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> } } { - __node_holder __h = __construct_node(__x, __hash); + __node_holder __h = __construct_node(_VSTD::forward<_ValueTp>(__x), __hash); if (size()+1 > __bc * max_load_factor() || __bc == 0) { - rehash(_VSTD::max(2 * __bc + !__is_power2(__bc), + rehash(_VSTD::max(2 * __bc + !__is_hash_power2(__bc), size_type(ceil(float(size() + 1) / max_load_factor())))); __bc = bucket_count(); __chash = __constrain_hash(__hash, __bc); @@ -1857,6 +1844,13 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> #endif // _LIBCPP_HAS_NO_VARIADICS template +pair::iterator, bool> +__hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(value_type&& __x) +{ + return __insert_unique_value(_VSTD::move(__x)); +} + +template template pair::iterator, bool> __hash_table<_Tp, _Hash, _Equal, _Alloc>::__insert_unique(_Pp&& __x) @@ -1946,8 +1940,8 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __n = _VSTD::max ( __n, - __is_power2(__bc) ? __next_pow2(size_t(ceil(float(size()) / max_load_factor()))) : - __next_prime(size_t(ceil(float(size()) / max_load_factor()))) + __is_hash_power2(__bc) ? __next_hash_pow2(size_t(ceil(float(size()) / max_load_factor()))) : + __next_prime(size_t(ceil(float(size()) / max_load_factor()))) ); if (__n < __bc) __rehash(__n); @@ -2358,12 +2352,14 @@ template ::swap(__hash_table& __u) _NOEXCEPT_( - (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value || - __is_nothrow_swappable<__pointer_allocator>::value) && - (!__node_traits::propagate_on_container_swap::value || - __is_nothrow_swappable<__node_allocator>::value) && - __is_nothrow_swappable::value && - __is_nothrow_swappable::value) + __is_nothrow_swappable::value && __is_nothrow_swappable::value +#if _LIBCPP_STD_VER <= 11 + && (!allocator_traits<__pointer_allocator>::propagate_on_container_swap::value + || __is_nothrow_swappable<__pointer_allocator>::value) + && (!__node_traits::propagate_on_container_swap::value + || __is_nothrow_swappable<__node_allocator>::value) +#endif + ) { { __node_pointer_pointer __npp = __bucket_list_.release(); @@ -2371,9 +2367,9 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc> __u.__bucket_list_.reset(__npp); } _VSTD::swap(__bucket_list_.get_deleter().size(), __u.__bucket_list_.get_deleter().size()); - __swap_alloc(__bucket_list_.get_deleter().__alloc(), + __swap_allocator(__bucket_list_.get_deleter().__alloc(), __u.__bucket_list_.get_deleter().__alloc()); - __swap_alloc(__node_alloc(), __u.__node_alloc()); + __swap_allocator(__node_alloc(), __u.__node_alloc()); _VSTD::swap(__p1_.first().__next_, __u.__p1_.first().__next_); __p2_.swap(__u.__p2_); __p3_.swap(__u.__p3_); Modified: projects/clang370-import/contrib/libc++/include/__locale ============================================================================== --- projects/clang370-import/contrib/libc++/include/__locale Wed Sep 16 22:15:50 2015 (r287876) +++ projects/clang370-import/contrib/libc++/include/__locale Wed Sep 16 22:26:52 2015 (r287877) @@ -30,6 +30,7 @@ # include # endif #elif defined(__sun__) +# include # include #elif defined(_NEWLIB_VERSION) # include @@ -352,16 +353,15 @@ public: static const mask punct = _PUNCT; static const mask xdigit = _HEX; static const mask blank = _BLANK; -#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) || defined(__ANDROID__) -#ifdef __APPLE__ +# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT +#elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) +# ifdef __APPLE__ typedef __uint32_t mask; -#elif defined(__FreeBSD__) +# elif defined(__FreeBSD__) typedef unsigned long mask; -#elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) +# elif defined(__EMSCRIPTEN__) || defined(__NetBSD__) typedef unsigned short mask; -#elif defined(__ANDROID__) - typedef unsigned char mask; -#endif +# endif static const mask space = _CTYPE_S; static const mask print = _CTYPE_R; static const mask cntrl = _CTYPE_C; @@ -370,11 +370,7 @@ public: *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***