Revert "Merge to upstream r304942."

This reverts commit 83b1388ecd96b1cc641522ae3b6338898be32a17, reversing
changes made to f20819f925e1ca67fc187e5f08413624a5994efc.

Test: treehugger
Bug: None
diff --git a/.clang-format b/.clang-format
index dd59681..2d1d3be 100644
--- a/.clang-format
+++ b/.clang-format
@@ -2,7 +2,6 @@
 
 ---
 Language: Cpp
-Standard: Cpp03
 
 AlwaysBreakTemplateDeclarations: true
 PointerAlignment: Left
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 33d888b..9e9360e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,7 +23,7 @@
   project(libcxx CXX C)
 
   set(PACKAGE_NAME libcxx)
-  set(PACKAGE_VERSION 5.0.0svn)
+  set(PACKAGE_VERSION 4.0.0svn)
   set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
   set(PACKAGE_BUGREPORT "llvm-bugs@lists.llvm.org")
 
@@ -64,12 +64,8 @@
 option(LIBCXX_ENABLE_SHARED "Build libc++ as a shared library." ON)
 option(LIBCXX_ENABLE_STATIC "Build libc++ as a static library." ON)
 option(LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY "Build libc++experimental.a" ON)
-set(ENABLE_FILESYSTEM_DEFAULT ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
-if (WIN32)
-  set(ENABLE_FILESYSTEM_DEFAULT OFF)
-endif()
-option(LIBCXX_ENABLE_FILESYSTEM "Build filesystem as part of libc++experimental.a"
-    ${ENABLE_FILESYSTEM_DEFAULT})
+option(LIBCXX_ENABLE_FILESYSTEM
+        "Build filesystem as part of libc++experimental.a" ${LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY})
 option(LIBCXX_INCLUDE_TESTS "Build the libc++ tests." ${LLVM_INCLUDE_TESTS})
 
 # Benchmark options -----------------------------------------------------------
@@ -120,19 +116,21 @@
           ${LLVM_MAIN_SRC_DIR}/runtimes/libcxxabi/include
     NO_DEFAULT_PATH
   )
-  if (LIBCXX_TARGETING_MSVC)
-    # FIXME: Figure out how to configure the ABI library on Windows.
-    set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
-  elseif ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
-          IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
+  if ((NOT LIBCXX_STANDALONE_BUILD OR HAVE_LIBCXXABI) AND
+      IS_DIRECTORY "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
     set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
     set(LIBCXX_CXX_ABI_INCLUDE_PATHS "${LIBCXX_LIBCXXABI_INCLUDES_INTERNAL}")
     set(LIBCXX_CXX_ABI_INTREE 1)
-  elseif (APPLE)
-    set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
-    set(LIBCXX_CXX_ABI_SYSTEM 1)
   else()
-    set(LIBCXX_CXX_ABI_LIBNAME "default")
+    if (LIBCXX_TARGETING_MSVC)
+      # FIXME: Figure out how to configure the ABI library on Windows.
+      set(LIBCXX_CXX_ABI_LIBNAME "vcruntime")
+    elseif(APPLE)
+      set(LIBCXX_CXX_ABI_LIBNAME "libcxxabi")
+      set(LIBCXX_CXX_ABI_SYSTEM 1)
+    else()
+      set(LIBCXX_CXX_ABI_LIBNAME "default")
+    endif()
   endif()
 else()
   set(LIBCXX_CXX_ABI_LIBNAME "${LIBCXX_CXX_ABI}")
@@ -144,7 +142,7 @@
 
 # Generate and install a linker script inplace of libc++.so. The linker script
 # will link libc++ to the correct ABI library. This option is on by default
-# on UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
+# On UNIX platforms other than Apple unless 'LIBCXX_ENABLE_STATIC_ABI_LIBRARY'
 # is on. This option is also disabled when the ABI library is not specified
 # or is specified to be "none".
 set(ENABLE_LINKER_SCRIPT_DEFAULT_VALUE OFF)
@@ -163,7 +161,7 @@
 set(ENABLE_NEW_DELETE_DEFAULT ON)
 if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
 # FIXME: This option should default to off. Unfortunatly GCC 4.9 fails to link
-# programs due to undefined references to new/delete in libc++abi so to work
+# programs to due undefined references to new/delete in libc++abi so to work
 # around this libc++abi currently defaults LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS
 # to ON. Once the GCC bug has been worked around this option should be changed
 # back to OFF.
@@ -344,16 +342,11 @@
 set(LIBCXX_SOURCE_DIR  ${CMAKE_CURRENT_SOURCE_DIR})
 set(LIBCXX_BINARY_DIR  ${CMAKE_CURRENT_BINARY_DIR})
 set(LIBCXX_BINARY_INCLUDE_DIR "${LIBCXX_BINARY_DIR}/include/c++build")
-if (LLVM_LIBRARY_OUTPUT_INTDIR)
-  set(LIBCXX_LIBRARY_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
-else()
-  set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
-endif()
+set(LIBCXX_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LIBCXX_LIBDIR_SUFFIX})
 file(MAKE_DIRECTORY "${LIBCXX_BINARY_INCLUDE_DIR}")
 
 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${LIBCXX_LIBRARY_DIR})
 
 # Declare libc++ configuration variables.
 # They are intended for use as follows:
@@ -376,9 +369,9 @@
 # 'config-ix' use them during feature checks. It also adds them to both
 # 'LIBCXX_COMPILE_FLAGS' and 'LIBCXX_LINK_FLAGS'
 add_target_flags_if(LIBCXX_BUILD_32_BITS "-m32")
-add_target_flags_if(LIBCXX_TARGET_TRIPLE "--target=${LIBCXX_TARGET_TRIPLE}")
+add_target_flags_if(LIBCXX_TARGET_TRIPLE "-target ${LIBCXX_TARGET_TRIPLE}")
 add_target_flags_if(LIBCXX_SYSROOT "--sysroot=${LIBCXX_SYSROOT}")
-add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "--gcc-toolchain=${LIBCXX_GCC_TOOLCHAIN}")
+add_target_flags_if(LIBCXX_GCC_TOOLCHAIN "-gcc-toolchain ${LIBCXX_GCC_TOOLCHAIN}")
 if (LIBCXX_TARGET_TRIPLE)
   set(TARGET_TRIPLE "${LIBCXX_TARGET_TRIPLE}")
 endif()
@@ -421,9 +414,9 @@
 # non-debug DLLs
 remove_flags("/D_DEBUG" "/MTd" "/MDd" "/MT" "/Md")
 
-# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEDANTIC.
+# FIXME(EricWF): See the FIXME on LIBCXX_ENABLE_PEqDANTIC.
 # Remove the -pedantic flag and -Wno-pedantic and -pedantic-errors
-# so they don't get transformed into -Wno and -errors respectively.
+# so they don't get transformed into -Wno and -errors respectivly.
 remove_flags(-Wno-pedantic -pedantic-errors -pedantic)
 
 # Required flags ==============================================================
@@ -452,11 +445,6 @@
 # the dylib when get ODR used by another function.
 add_compile_flags_if_supported(-fvisibility-inlines-hidden)
 
-if (LIBCXX_CONFIGURE_IDE)
-  # This simply allows IDE to process <experimental/coroutine>
-  add_compile_flags_if_supported(-fcoroutines-ts)
-endif()
-
 # Let the library headers know they are currently being used to build the
 # library.
 add_definitions(-D_LIBCPP_BUILDING_LIBRARY)
@@ -478,8 +466,7 @@
 elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
     add_compile_flags_if_supported(
         -Wno-literal-suffix
-        -Wno-c++14-compat
-        -Wno-noexcept-type)
+        -Wno-c++14-compat)
 endif()
 if (LIBCXX_ENABLE_WERROR)
   add_compile_flags_if_supported(-Werror)
@@ -636,12 +623,7 @@
 # Create the lit.site.cfg file even when LIBCXX_INCLUDE_TESTS is OFF or
 # LLVM_FOUND is OFF. This allows users to run the tests manually using
 # LIT without requiring a full LLVM checkout.
-#
-# However, since some submission systems strip test/ subdirectories, check for
-# it before adding it.
-if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test")
-  add_subdirectory(test)
-endif()
+add_subdirectory(test)
 if (LIBCXX_INCLUDE_TESTS)
   add_subdirectory(lib/abi)
 endif()
diff --git a/appveyor-reqs-install.cmd b/appveyor-reqs-install.cmd
deleted file mode 100644
index e5b30cf..0000000
--- a/appveyor-reqs-install.cmd
+++ /dev/null
@@ -1,53 +0,0 @@
-@echo on
-
-if NOT EXIST C:\projects\deps (
-  mkdir C:\projects\deps
-)
-cd C:\projects\deps
-
-::###########################################################################
-:: Setup Compiler
-::###########################################################################
-if NOT EXIST llvm-installer.exe (
-  appveyor DownloadFile http://llvm.org/pre-releases/win-snapshots/LLVM-5.0.0-r303050-win32.exe -FileName llvm-installer.exe
-)
-if "%CLANG_VERSION%"=="ToT" (
-    START /WAIT llvm-installer.exe /S /D=C:\"Program Files\LLVM"
-)
-if DEFINED CLANG_VERSION  @set PATH="C:\Program Files\LLVM\bin";%PATH%
-if DEFINED CLANG_VERSION  clang-cl -v
-
-if DEFINED MINGW_PATH rename "C:\Program Files\Git\usr\bin\sh.exe" "sh-ignored.exe"
-if DEFINED MINGW_PATH @set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%"
-if DEFINED MINGW_PATH @set "PATH=%PATH%;%MINGW_PATH%"
-if DEFINED MINGW_PATH g++ -v
-
-::###########################################################################
-:: Install a recent CMake
-::###########################################################################
-if NOT EXIST cmake (
-  appveyor DownloadFile https://cmake.org/files/v3.7/cmake-3.7.2-win64-x64.zip -FileName cmake.zip
-  7z x cmake.zip -oC:\projects\deps > nul
-  move C:\projects\deps\cmake-* C:\projects\deps\cmake
-  rm cmake.zip
-)
-@set PATH=C:\projects\deps\cmake\bin;%PATH%
-cmake --version
-
-::###########################################################################
-:: Install Ninja
-::###########################################################################
-if NOT EXIST ninja (
-  appveyor DownloadFile https://github.com/ninja-build/ninja/releases/download/v1.6.0/ninja-win.zip -FileName ninja.zip
-  7z x ninja.zip -oC:\projects\deps\ninja > nul
-  rm ninja.zip
-)
-@set PATH=C:\projects\deps\ninja;%PATH%
-ninja --version
-
-::###########################################################################
-:: Setup the cached copy of LLVM
-::###########################################################################
-git clone --depth=1 http://llvm.org/git/llvm.git
-
-@echo off
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index be69a55..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,78 +0,0 @@
-version: '{build}'
-
-shallow_clone: true
-
-build:
-  verbosity: detailed
-
-configuration:
-  - Debug
-
-environment:
-  matrix:
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
-      CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
-      CLANG_VERSION: ToT
-      MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat
-      MSVC_SETUP_ARG: x86
-      GENERATOR: Ninja
-      MAKE_PROGRAM: ninja
-      APPVEYOR_SAVE_CACHE_ON_ERROR: true
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
-      CMAKE_OPTIONS: -DCMAKE_C_COMPILER=clang-cl.exe -DCMAKE_CXX_COMPILER=clang-cl.exe
-      CLANG_VERSION: 4
-      MSVC_SETUP_PATH: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
-      MSVC_SETUP_ARG: x86_amd64
-      GENERATOR: Ninja
-      MAKE_PROGRAM: ninja
-      APPVEYOR_SAVE_CACHE_ON_ERROR: true
-    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
-      MINGW_PATH: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
-      GENERATOR: MinGW Makefiles
-      MAKE_PROGRAM: mingw32-make
-      APPVEYOR_SAVE_CACHE_ON_ERROR: true
-
-install:
-  ############################################################################
-  # All external dependencies are installed in C:\projects\deps
-  ############################################################################
-  - call "%APPVEYOR_BUILD_FOLDER%\\appveyor-reqs-install.cmd"
-
-before_build:
-  - if DEFINED MSVC_SETUP_PATH call "%MSVC_SETUP_PATH%" %MSVC_SETUP_ARG%
-  - cd %APPVEYOR_BUILD_FOLDER%
-
-build_script:
-  - md C:\projects\build-libcxx
-  - cd C:\projects\build-libcxx
-  - echo %configuration%
-
-  #############################################################################
-  # Configuration Step
-  #############################################################################
-  - cmake -G "%GENERATOR%" %CMAKE_OPTIONS%
-    "-DCMAKE_BUILD_TYPE=%configuration%"
-    "-DLLVM_PATH=C:\projects\deps\llvm" -DLIBCXX_ENABLE_EXPERIMENTAL_LIBRARY=OFF
-    -DLLVM_LIT_ARGS="-sv --show-xfail --show-unsupported"
-    %APPVEYOR_BUILD_FOLDER%
-
-  #############################################################################
-  # Build Step
-  #############################################################################
-  - "%MAKE_PROGRAM%"
-
-test_script:
-  - "%MAKE_PROGRAM% check-cxx"
-
-on_failure:
-  - appveyor PushArtifact CMakeFiles/CMakeOutput.log
-  - appveyor PushArtifact CMakeFiles/CMakeError.log
-
-artifacts:
-  - path: '_build/CMakeFiles/*.log'
-    name: logs
-
-cache:
- - C:\projects\deps\ninja
- - C:\projects\deps\cmake
- - C:\projects\deps\llvm-installer.exe
diff --git a/benchmarks/CMakeLists.txt b/benchmarks/CMakeLists.txt
index 8211ebd..a4105be 100644
--- a/benchmarks/CMakeLists.txt
+++ b/benchmarks/CMakeLists.txt
@@ -63,7 +63,7 @@
 # Benchmark tests configuration
 #==============================================================================
 add_custom_target(cxx-benchmarks)
-set(BENCHMARK_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
+
 set(BENCHMARK_LIBCXX_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-libcxx)
 set(BENCHMARK_NATIVE_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/benchmark-native)
 set(BENCHMARK_TEST_COMPILE_FLAGS
@@ -111,7 +111,6 @@
   set_target_properties(${libcxx_target}
     PROPERTIES
           OUTPUT_NAME "${name}.libcxx.out"
-          RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
           COMPILE_FLAGS "${BENCHMARK_TEST_LIBCXX_COMPILE_FLAGS}"
           LINK_FLAGS "${BENCHMARK_TEST_LIBCXX_LINK_FLAGS}")
   if (LIBCXX_BENCHMARK_NATIVE_STDLIB)
@@ -132,7 +131,6 @@
     set_target_properties(${native_target}
       PROPERTIES
           OUTPUT_NAME "${name}.native.out"
-          RUNTIME_OUTPUT_DIRECTORY "${BENCHMARK_OUTPUT_DIR}"
           INCLUDE_DIRECTORIES ""
           COMPILE_FLAGS "${BENCHMARK_TEST_NATIVE_COMPILE_FLAGS}"
           LINK_FLAGS "${BENCHMARK_TEST_NATIVE_LINK_FLAGS}")
diff --git a/cmake/Modules/HandleCompilerRT.cmake b/cmake/Modules/HandleCompilerRT.cmake
index e9da3c4..9730008 100644
--- a/cmake/Modules/HandleCompilerRT.cmake
+++ b/cmake/Modules/HandleCompilerRT.cmake
@@ -5,9 +5,6 @@
   set(dest "" PARENT_SCOPE)
   set(CLANG_COMMAND ${CMAKE_CXX_COMPILER} ${LIBCXX_COMPILE_FLAGS}
       "--rtlib=compiler-rt" "--print-libgcc-file-name")
-  if (CMAKE_CXX_COMPILER_ID MATCHES Clang AND CMAKE_CXX_COMPILER_TARGET)
-    list(APPEND CLANG_COMMAND "--target=${CMAKE_CXX_COMPILER_TARGET}")
-  endif()
   execute_process(
       COMMAND ${CLANG_COMMAND}
       RESULT_VARIABLE HAD_ERROR
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index 730ee7e..4f13b78 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -1,5 +1,4 @@
 include(CheckLibraryExists)
-include(CheckCCompilerFlag)
 include(CheckCXXCompilerFlag)
 
 if(WIN32 AND NOT MINGW)
@@ -25,32 +24,17 @@
 # required during compilation (which has the -nodefaultlibs). libc is
 # required for the link to go through. We remove sanitizers from the
 # configuration checks to avoid spurious link errors.
-check_c_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
+check_cxx_compiler_flag(-nodefaultlibs LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
 if (LIBCXX_SUPPORTS_NODEFAULTLIBS_FLAG)
   set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -nodefaultlibs")
   if (LIBCXX_HAS_C_LIB)
     list(APPEND CMAKE_REQUIRED_LIBRARIES c)
   endif ()
   if (LIBCXX_USE_COMPILER_RT)
-    list(APPEND CMAKE_REQUIRED_FLAGS -rtlib=compiler-rt)
-    find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
-    list(APPEND CMAKE_REQUIRED_LIBRARIES "${LIBCXX_BUILTINS_LIBRARY}")
+    list(APPEND CMAKE_REQUIRED_LIBRARIES -rtlib=compiler-rt)
   elseif (LIBCXX_HAS_GCC_S_LIB)
     list(APPEND CMAKE_REQUIRED_LIBRARIES gcc_s)
   endif ()
-  if (MINGW)
-    # Mingw64 requires quite a few "C" runtime libraries in order for basic
-    # programs to link successfully with -nodefaultlibs.
-    if (LIBCXX_USE_COMPILER_RT)
-      set(MINGW_RUNTIME ${LIBCXX_BUILTINS_LIBRARY})
-    else ()
-      set(MINGW_RUNTIME gcc_s gcc)
-    endif()
-    set(MINGW_LIBRARIES mingw32 ${MINGW_RUNTIME} moldname mingwex msvcrt advapi32
-                        shell32 user32 kernel32 mingw32 ${MINGW_RUNTIME}
-                        moldname mingwex msvcrt)
-    list(APPEND CMAKE_REQUIRED_LIBRARIES ${MINGW_LIBRARIES})
-  endif()
   if (CMAKE_C_FLAGS MATCHES -fsanitize OR CMAKE_CXX_FLAGS MATCHES -fsanitize)
     set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fno-sanitize=all")
   endif ()
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index d679761..f63ee00 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,9 +1,9 @@
 
 if (LLVM_ENABLE_SPHINX)
-  include(AddSphinxTarget)
   if (SPHINX_FOUND)
+    include(AddSphinxTarget)
     if (${SPHINX_OUTPUT_HTML})
       add_sphinx_target(html libcxx)
     endif()
   endif()
-endif()
+endif()
\ No newline at end of file
diff --git a/docs/DesignDocs/AvailabilityMarkup.rst b/docs/DesignDocs/AvailabilityMarkup.rst
deleted file mode 100644
index 4a85c69..0000000
--- a/docs/DesignDocs/AvailabilityMarkup.rst
+++ /dev/null
@@ -1,114 +0,0 @@
-===================
-Availability Markup
-===================
-
-.. contents::
-   :local:
-
-Overview
-========
-
-Libc++ is used as a system library on macOS and iOS (amongst others). In order
-for users to be able to compile a binary that is intended to be deployed to an
-older version of the platform, clang provides the
-`availability attribute <https://clang.llvm.org/docs/AttributeReference.html#availability>`_
-that can be placed on declarations to describe the lifecycle of a symbol in the
-library.
-
-Design
-======
-
-When a new feature is introduced that requires dylib support, a macro should be
-created in include/__config to mark this feature as unavailable for all the
-systems. For example::
-
-    // Define availability macros.
-    #if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
-    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
-    #else  if defined(_LIBCPP_USE_AVAILABILITY_SOME_OTHER_VENDOR)
-    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
-	#else
-    #define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-    #endif
-
-When the library is updated by the platform vendor, the markup can be updated.
-For example::
-
-    #define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                  \
-      __attribute__((availability(macosx,strict,introduced=10.12)))            \
-      __attribute__((availability(ios,strict,introduced=10.0)))                \
-      __attribute__((availability(tvos,strict,introduced=10.0)))               \
-      __attribute__((availability(watchos,strict,introduced=3.0)))
-
-In the source code, the macro can be added on a class if the full class requires
-type info from the library for example::
-
-	_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-	class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
-	    : public std::logic_error {
-
-or on a particular symbol:
-
-    _LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
-
-
-Testing
-=======
-
-Some parameters can be passed to lit to run the test-suite and exercising the
-availability.
-
-* The `platform` parameter controls the deployement target. For example lit can
-  be invoked with `--param=platform=macosx10.8`. Default is the current host.
-* The `use_system_cxx_lib` parameter indicates to use another library than the
-  just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run
-  the test-suite against the host system library. Alternatively a path to the
-  directory containing a specific prebuilt libc++ can be used, for example:
-  `--param=use_system_cxx_lib=/path/to/macOS/10.8/`.
-* The `with_availability` boolean parameter enables the availability markup.
-
-Tests can be marked as XFAIL based on multiple features made available by lit:
-
-
-* if either `use_system_cxx_lib` or  `with_availability` is passed to lit,
-  assuming `--param=platform=macosx10.8` is passed as well the following
-  features will be available:
-
-  - availability
-  - availability=x86_64
-  - availability=macosx
-  - availability=x86_64-macosx
-  - availability=x86_64-apple-macosx10.8
-  - availability=macosx10.8
-
-  This feature is used to XFAIL a test that *is* using a class of a method marked
-  as unavailable *and* that is expected to *fail* if deployed on an older system.
-
-* if `use_system_cxx_lib` is passed to lit, the following features will also
-  be available:
-
-  - with_system_cxx_lib
-  - with_system_cxx_lib=x86_64
-  - with_system_cxx_lib=macosx
-  - with_system_cxx_lib=x86_64-macosx
-  - with_system_cxx_lib=x86_64-apple-macosx10.8
-  - with_system_cxx_lib=macosx10.8
-
-  This feature is used to XFAIL a test that is *not* using a class of a method
-  marked as unavailable *but* that is expected to fail if deployed on an older
-  system. For example if we know that it exhibits a but in the libc on a
-  particular system version.
-
-* if `with_availability` is passed to lit, the following features will also
-  be available:
-
-  - availability_markup
-  - availability_markup=x86_64
-  - availability_markup=macosx
-  - availability_markup=x86_64-macosx
-  - availability_markup=x86_64-apple-macosx10.8
-  - availability_markup=macosx10.8
-
-  This feature is used to XFAIL a test that *is* using a class of a method
-  marked as unavailable *but* that is expected to *pass* if deployed on an older
-  system. For example if it is using a symbol in a statically evaluated context.
diff --git a/docs/TestingLibcxx.rst b/docs/TestingLibcxx.rst
index 5c48ebe..e429276 100644
--- a/docs/TestingLibcxx.rst
+++ b/docs/TestingLibcxx.rst
@@ -119,7 +119,7 @@
 .. option:: libcxx_site_config=<path/to/lit.site.cfg>
 
   Specify the site configuration to use when running the tests.  This option
-  overrides the environment variable LIBCXX_SITE_CONFIG.
+  overrides the enviroment variable LIBCXX_SITE_CONFIG.
 
 .. option:: cxx_headers=<path/to/headers>
 
diff --git a/docs/UsingLibcxx.rst b/docs/UsingLibcxx.rst
index 1836646..fe32f5e 100644
--- a/docs/UsingLibcxx.rst
+++ b/docs/UsingLibcxx.rst
@@ -146,11 +146,6 @@
   build of libc++ which does not export any symbols, which can be useful when
   building statically for inclusion into another library.
 
-**_LIBCPP_DISABLE_EXTERN_TEMPLATE**:
-  This macro is used to disable extern template declarations in the libc++
-  headers. The intended use case is for clients who wish to use the libc++
-  headers without taking a dependency on the libc++ library itself.
-
 **_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION**:
   This macro is used to re-enable an extension in `std::tuple` which allowed
   it to be implicitly constructed from fewer initializers than contained
diff --git a/docs/index.rst b/docs/index.rst
index 3526b47..58043f5 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -128,7 +128,6 @@
 .. toctree::
    :maxdepth: 1
 
-   DesignDocs/AvailabilityMarkup
    DesignDocs/DebugMode
    DesignDocs/CapturingConfigInfo
    DesignDocs/ABIVersioning
@@ -146,7 +145,7 @@
 
 * `LLVM Buildbot Builders <http://lab.llvm.org:8011/console>`_
 * `Apple Jenkins Builders <http://lab.llvm.org:8080/green/view/Libcxx/>`_
-* `Windows Appveyor Builders <https://ci.appveyor.com/project/llvm-mirror/libcxx>`_
+* `EricWF's Nightly Builders <http://ds2.efcs.ca:8080/console>`_
 * `Code Coverage Results <http://efcs.ca/libcxx-coverage>`_
 
 Getting Involved
diff --git a/include/__bit_reference b/include/__bit_reference
index 3e4a21d..9aea961 100644
--- a/include/__bit_reference
+++ b/include/__bit_reference
@@ -14,14 +14,12 @@
 #include <__config>
 #include <algorithm>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
@@ -1275,6 +1273,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP___BIT_REFERENCE
diff --git a/include/__bsd_locale_fallbacks.h b/include/__bsd_locale_fallbacks.h
index 5719947..537614c 100644
--- a/include/__bsd_locale_fallbacks.h
+++ b/include/__bsd_locale_fallbacks.h
@@ -23,24 +23,27 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+typedef _VSTD::remove_pointer<locale_t>::type __use_locale_struct;
+typedef _VSTD::unique_ptr<__use_locale_struct, decltype(&uselocale)> __locale_raii;
+
 inline _LIBCPP_ALWAYS_INLINE
 decltype(MB_CUR_MAX) __libcpp_mb_cur_max_l(locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return MB_CUR_MAX;
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 wint_t __libcpp_btowc_l(int __c, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return btowc(__c);
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 int __libcpp_wctob_l(wint_t __c, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return wctob(__c);
 }
 
@@ -48,14 +51,14 @@
 size_t __libcpp_wcsnrtombs_l(char *__dest, const wchar_t **__src, size_t __nwc,
                          size_t __len, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return wcsnrtombs(__dest, __src, __nwc, __len, __ps);
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_wcrtomb_l(char *__s, wchar_t __wc, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return wcrtomb(__s, __wc, __ps);
 }
 
@@ -63,7 +66,7 @@
 size_t __libcpp_mbsnrtowcs_l(wchar_t * __dest, const char **__src, size_t __nms,
                       size_t __len, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return mbsnrtowcs(__dest, __src, __nms, __len, __ps);
 }
 
@@ -71,28 +74,28 @@
 size_t __libcpp_mbrtowc_l(wchar_t *__pwc, const char *__s, size_t __n,
                    mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return mbrtowc(__pwc, __s, __n, __ps);
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 int __libcpp_mbtowc_l(wchar_t *__pwc, const char *__pmb, size_t __max, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return mbtowc(__pwc, __pmb, __max);
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 size_t __libcpp_mbrlen_l(const char *__s, size_t __n, mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return mbrlen(__s, __n, __ps);
 }
 
 inline _LIBCPP_ALWAYS_INLINE
 lconv *__libcpp_localeconv_l(locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return localeconv();
 }
 
@@ -100,7 +103,7 @@
 size_t __libcpp_mbsrtowcs_l(wchar_t *__dest, const char **__src, size_t __len,
                      mbstate_t *__ps, locale_t __l)
 {
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     return mbsrtowcs(__dest, __src, __len, __ps);
 }
 
@@ -108,7 +111,7 @@
 int __libcpp_snprintf_l(char *__s, size_t __n, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     int __res = vsnprintf(__s, __n, __format, __va);
     va_end(__va);
     return __res;
@@ -118,7 +121,7 @@
 int __libcpp_asprintf_l(char **__s, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     int __res = vasprintf(__s, __format, __va);
     va_end(__va);
     return __res;
@@ -128,7 +131,7 @@
 int __libcpp_sscanf_l(const char *__s, locale_t __l, const char *__format, ...) {
     va_list __va;
     va_start(__va, __format);
-    __libcpp_locale_guard __current(__l);
+    __locale_raii __current( uselocale(__l), uselocale );
     int __res = vsscanf(__s, __format, __va);
     va_end(__va);
     return __res;
diff --git a/include/__config b/include/__config
index 03612ea..861adb0 100644
--- a/include/__config
+++ b/include/__config
@@ -25,12 +25,8 @@
 
 #ifdef __GNUC__
 #define _GNUC_VER (__GNUC__ * 100 + __GNUC_MINOR__)
-// The _GNUC_VER_NEW macro better represents the new GCC versioning scheme
-// introduced in GCC 5.0.
-#define _GNUC_VER_NEW (_GNUC_VER * 10 + __GNUC_PATCHLEVEL__)
 #else
 #define _GNUC_VER 0
-#define _GNUC_VER_NEW 0
 #endif
 
 #define _LIBCPP_VERSION 5000
@@ -39,16 +35,6 @@
 #define _LIBCPP_ABI_VERSION 1
 #endif
 
-#if defined(__ELF__)
-#define _LIBCPP_OBJECT_FORMAT_ELF   1
-#elif defined(__MACH__)
-#define _LIBCPP_OBJECT_FORMAT_MACHO 1
-#elif defined(_WIN32)
-#define _LIBCPP_OBJECT_FORMAT_COFF  1
-#else
-#error Unknown object file format
-#endif
-
 #if defined(_LIBCPP_ABI_UNSTABLE) || _LIBCPP_ABI_VERSION >= 2
 // Change short string representation so that string data starts at offset 0,
 // improving its alignment in some cases.
@@ -63,6 +49,7 @@
 #define _LIBCPP_ABI_FIX_UNORDERED_NODE_POINTER_UB
 #define _LIBCPP_ABI_FORWARD_LIST_REMOVE_NODE_POINTER_UB
 #define _LIBCPP_ABI_FIX_UNORDERED_CONTAINER_SIZE_TYPE
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 // Don't use a nullptr_t simulation type in C++03 instead using C++11 nullptr
 // provided under the alternate keyword __nullptr, which changes the mangling
 // of nullptr_t. This option is ABI incompatible with GCC in C++03 mode.
@@ -72,17 +59,10 @@
 // `pointer_safety` and `get_pointer_safety()` will no longer be available
 // in C++03.
 #define _LIBCPP_ABI_POINTER_SAFETY_ENUM_TYPE
-// Define a key function for `bad_function_call` in the library, to centralize
-// its vtable and typeinfo to libc++ rather than having all other libraries
-// using that class define their own copies.
-#define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
 #elif _LIBCPP_ABI_VERSION == 1
-#if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
+#if !defined(_WIN32)
 // Enable compiling copies of now inline methods into the dylib to support
-// applications compiled against older libraries. This is unnecessary with
-// COFF dllexport semantics, since dllexport forces a non-inline definition
-// of inline functions to be emitted anyway. Our own non-inline copy would
-// conflict with the dllexport-emitted copy, so we disable it.
+// applications compiled against older libraries.
 #define _LIBCPP_DEPRECATED_ABI_LEGACY_LIBRARY_DEFINITIONS_FOR_INLINE_FUNCTIONS
 #endif
 // Feature macros for disabling pre ABI v1 features. All of these options
@@ -129,12 +109,6 @@
 
 #define __has_keyword(__x) !(__is_identifier(__x))
 
-#ifdef __has_include
-#define __libcpp_has_include(__x) __has_include(__x)
-#else
-#define __libcpp_has_include(__x) 0
-#endif
-
 #if defined(__clang__)
 #define _LIBCPP_COMPILER_CLANG
 # ifndef __apple_build_version__
@@ -220,12 +194,10 @@
 #endif  // __NetBSD__
 
 #if defined(_WIN32)
-#  define _LIBCPP_WIN32API
+#  define _LIBCPP_WIN32API      1
 #  define _LIBCPP_LITTLE_ENDIAN 1
 #  define _LIBCPP_BIG_ENDIAN    0
 #  define _LIBCPP_SHORT_WCHAR   1
-// Both MinGW and native MSVC provide a "MSVC"-like enviroment
-#  define _LIBCPP_MSVCRT_LIKE
 // If mingw not explicitly detected, assume using MS C runtime only.
 #  ifndef __MINGW32__
 #    define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
@@ -236,16 +208,6 @@
 # if defined(_LIBCPP_MSVCRT)
 #   define _LIBCPP_HAS_QUICK_EXIT
 # endif
-
-// Some CRT APIs are unavailable to store apps
-#if defined(WINAPI_FAMILY)
-#include <winapifamily.h>
-#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) &&                      \
-    (!defined(WINAPI_PARTITION_SYSTEM) ||                                      \
-     !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_SYSTEM))
-#define _LIBCPP_WINDOWS_STORE_APP
-#endif
-#endif
 #endif // defined(_WIN32)
 
 #ifdef __sun__
@@ -300,7 +262,7 @@
 // _LIBCPP_ALTERNATE_STRING_LAYOUT is an old name for
 // _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT left here for backward compatibility.
 #if (defined(__APPLE__) && !defined(__i386__) && !defined(__x86_64__) &&       \
-     (!defined(__arm__) || __ARM_ARCH_7K__ >= 2)) ||                           \
+     !defined(__arm__)) ||                                                     \
     defined(_LIBCPP_ALTERNATE_STRING_LAYOUT)
 #define _LIBCPP_ABI_ALTERNATE_STRING_LAYOUT
 #endif
@@ -322,7 +284,7 @@
 #define _LIBCPP_NO_EXCEPTIONS
 #endif
 
-#if !(__has_feature(cxx_rtti)) && !defined(_LIBCPP_NO_RTTI)
+#if !(__has_feature(cxx_rtti))
 #define _LIBCPP_NO_RTTI
 #endif
 
@@ -383,6 +345,7 @@
 
 #if __has_feature(objc_arc_weak)
 #define _LIBCPP_HAS_OBJC_ARC_WEAK
+#define _LIBCPP_HAS_NO_STRONG_ENUMS
 #endif
 
 #if !(__has_feature(cxx_constexpr))
@@ -597,6 +560,14 @@
 
 #endif // _LIBCPP_COMPILER_[CLANG|GCC|MSVC|IBM]
 
+#if defined(__ELF__)
+#define _LIBCPP_OBJECT_FORMAT_ELF   1
+#elif defined(__MACH__)
+#define _LIBCPP_OBJECT_FORMAT_MACHO 1
+#else
+#define _LIBCPP_OBJECT_FORMAT_COFF  1
+#endif
+
 #if defined(_LIBCPP_OBJECT_FORMAT_COFF)
 #if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS)
 # define _LIBCPP_DLL_VIS
@@ -864,11 +835,6 @@
 # endif
 #endif
 
-#ifdef _LIBCPP_DISABLE_EXTERN_TEMPLATE
-#define _LIBCPP_EXTERN_TEMPLATE(...)
-#define _LIBCPP_EXTERN_TEMPLATE2(...)
-#endif
-
 #ifndef _LIBCPP_EXTERN_TEMPLATE
 #define _LIBCPP_EXTERN_TEMPLATE(...)
 #endif
@@ -976,7 +942,7 @@
 #  if defined(__GNUC__) && ((__GNUC__ >= 5) || (__GNUC__ == 4 && \
    (__GNUC_MINOR__ >= 3 || __GNUC_PATCHLEVEL__ >= 2))) && !defined(__GXX_RTTI)
 #    define _LIBCPP_NO_RTTI
-#  elif defined(_LIBCPP_COMPILER_MSVC) && !defined(_CPPRTTI)
+#  elif defined(_LIBCPP_MSVC) && !defined(_CPPRTTI)
 #    define _LIBCPP_NO_RTTI
 #  endif
 #endif
@@ -988,7 +954,6 @@
 // Thread API
 #if !defined(_LIBCPP_HAS_NO_THREADS) && \
     !defined(_LIBCPP_HAS_THREAD_API_PTHREAD) && \
-    !defined(_LIBCPP_HAS_THREAD_API_WIN32) && \
     !defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
 # if defined(__FreeBSD__) || \
     defined(__Fuchsia__) || \
@@ -996,8 +961,7 @@
     defined(__linux__) || \
     defined(__APPLE__) || \
     defined(__CloudABI__) || \
-    defined(__sun__) || \
-    (defined(__MINGW32__) && __libcpp_has_include(<pthread.h>))
+    defined(__sun__)
 #   define _LIBCPP_HAS_THREAD_API_PTHREAD
 # elif defined(_LIBCPP_WIN32API)
 #  define _LIBCPP_HAS_THREAD_API_WIN32
@@ -1037,7 +1001,7 @@
 #endif
 
 #if defined(__BIONIC__) || defined(__CloudABI__) ||                            \
-    defined(__Fuchsia__) || defined(_LIBCPP_HAS_MUSL_LIBC)
+    defined(_LIBCPP_HAS_MUSL_LIBC)
 #define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
 #endif
 
@@ -1080,7 +1044,7 @@
 #endif
 
 #if !__has_builtin(__builtin_addressof) && _GNUC_VER < 700
-# define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
+#define _LIBCPP_HAS_NO_BUILTIN_ADDRESSOF
 #endif
 
 #if !defined(_LIBCPP_HAS_NO_OFF_T_FUNCTIONS)
@@ -1099,13 +1063,6 @@
 # define _LIBCPP_DIAGNOSE_ERROR(...)
 #endif
 
-#if __has_attribute(fallthough) || _GNUC_VER >= 700
-// Use a function like macro to imply that it must be followed by a semicolon
-#define _LIBCPP_FALLTHROUGH() __attribute__((__fallthrough__))
-#else
-#define _LIBCPP_FALLTHROUGH() ((void)0)
-#endif
-
 #if defined(_LIBCPP_ABI_MICROSOFT) && \
    (defined(_LIBCPP_COMPILER_MSVC) || __has_declspec_attribute(empty_bases))
 # define _LIBCPP_DECLSPEC_EMPTY_BASES __declspec(empty_bases)
@@ -1116,125 +1073,8 @@
 #if defined(_LIBCPP_ENABLE_CXX17_REMOVED_FEATURES)
 # define _LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR
 # define _LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-# define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
-# define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
 #endif // _LIBCPP_ENABLE_CXX17_REMOVED_FEATURES
 
-#if !defined(__cpp_deduction_guides) || __cpp_deduction_guides < 201611
-# define _LIBCPP_HAS_NO_DEDUCTION_GUIDES
-#endif
-
-#if !__has_keyword(__is_aggregate) && (_GNUC_VER_NEW < 7001)
-# define _LIBCPP_HAS_NO_IS_AGGREGATE
-#endif
-
-#if !defined(__cpp_coroutines) || __cpp_coroutines < 201703L
-# define _LIBCPP_HAS_NO_COROUTINES
-#endif
-
 #endif // __cplusplus
 
-// Decide whether to use availability macros.
-#if !defined(_LIBCPP_BUILDING_LIBRARY) &&                                      \
-    !defined(_LIBCPP_DISABLE_AVAILABILITY) &&                                  \
-    __has_feature(attribute_availability_with_strict) &&                       \
-    __has_feature(attribute_availability_in_templates)
-#ifdef __APPLE__
-#define _LIBCPP_USE_AVAILABILITY_APPLE
-#endif
-#endif
-
-// Define availability macros.
-#if defined(_LIBCPP_USE_AVAILABILITY_APPLE)
-#define _LIBCPP_AVAILABILITY_SHARED_MUTEX                                      \
-  __attribute__((availability(macosx,strict,introduced=10.12)))                \
-  __attribute__((availability(ios,strict,introduced=10.0)))                    \
-  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
-  __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS __attribute__((unavailable))
-#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable))
-#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS                               \
-  __attribute__((availability(macosx,strict,introduced=10.12)))                \
-  __attribute__((availability(ios,strict,introduced=10.0)))                    \
-  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
-  __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE                                  \
-  __attribute__((availability(macosx,strict,introduced=10.12)))                \
-  __attribute__((availability(ios,strict,introduced=10.0)))                    \
-  __attribute__((availability(tvos,strict,introduced=10.0)))                   \
-  __attribute__((availability(watchos,strict,introduced=3.0)))
-#define _LIBCPP_AVAILABILITY_FUTURE_ERROR                                      \
-  __attribute__((availability(ios,strict,introduced=6.0)))
-#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE                                   \
-  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
-  __attribute__((availability(ios,strict,introduced=7.0)))
-#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY                                   \
-  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
-  __attribute__((availability(ios,strict,introduced=7.0)))
-#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR                                 \
-  __attribute__((availability(macosx,strict,introduced=10.9)))                 \
-  __attribute__((availability(ios,strict,introduced=7.0)))
-#else
-#define _LIBCPP_AVAILABILITY_SHARED_MUTEX
-#define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-#define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS
-#define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE
-#define _LIBCPP_AVAILABILITY_FUTURE_ERROR
-#define _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
-#define _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
-#define _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-#endif
-
-// Define availability that depends on _LIBCPP_NO_EXCEPTIONS.
-#ifdef _LIBCPP_NO_EXCEPTIONS
-#define _LIBCPP_AVAILABILITY_DYNARRAY
-#define _LIBCPP_AVAILABILITY_FUTURE
-#else
-#define _LIBCPP_AVAILABILITY_DYNARRAY _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-#define _LIBCPP_AVAILABILITY_FUTURE _LIBCPP_AVAILABILITY_FUTURE_ERROR
-#endif
-
-// Availability of stream API in the dylib got dropped and re-added.  The
-// extern template should effectively be available at:
-//    availability(macosx,introduced=10.9)
-//    availability(ios,introduced=7.0)
-#if defined(_LIBCPP_USE_AVAILABILITY_APPLE) &&                                 \
-    ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) &&                \
-      __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ <= 1090) ||                \
-     (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) &&               \
-      __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ <= 70000))
-#define _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
-#endif
-
-#if defined(_LIBCPP_COMPILER_IBM)
-#define _LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO
-#endif
-
-#if defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
-# define _LIBCPP_PUSH_MACROS
-# define _LIBCPP_POP_MACROS
-#else
-  // Don't warn about macro conflicts when we can restore them at the
-  // end of the header.
-# ifndef _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
-#   define _LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS
-# endif
-# if defined(_LIBCPP_COMPILER_MSVC)
-#   define _LIBCPP_PUSH_MACROS    \
-      __pragma(push_macro("min")) \
-      __pragma(push_macro("max"))
-#   define _LIBCPP_POP_MACROS     \
-      __pragma(pop_macro("min"))  \
-      __pragma(pop_macro("max"))
-# else
-#   define _LIBCPP_PUSH_MACROS        \
-      _Pragma("push_macro(\"min\")")  \
-      _Pragma("push_macro(\"max\")")
-#   define _LIBCPP_POP_MACROS         \
-      _Pragma("pop_macro(\"min\")")   \
-      _Pragma("pop_macro(\"max\")")
-# endif
-#endif // defined(_LIBCPP_HAS_NO_PRAGMA_PUSH_POP_MACRO)
-
 #endif // _LIBCPP_CONFIG
diff --git a/include/__functional_base b/include/__functional_base
index 0d2c2fc..4e2b7eb 100644
--- a/include/__functional_base
+++ b/include/__functional_base
@@ -251,7 +251,7 @@
 };
 
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 // 3 or more arguments
 
 template <class _Rp, class _A1, class _A2, class _A3, class ..._A4>
@@ -296,6 +296,10 @@
     typedef _Rp result_type;
 };
 
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
+#ifndef _LIBCPP_CXX03_LANG
+
 template <class _Tp, class ..._Args>
 struct __invoke_return
 {
@@ -312,7 +316,7 @@
 template <class _Ret>
 struct __invoke_void_return_wrapper
 {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class ..._Args>
     static _Ret __call(_Args&&... __args) {
         return __invoke(_VSTD::forward<_Args>(__args)...);
@@ -343,7 +347,7 @@
 template <>
 struct __invoke_void_return_wrapper<void>
 {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class ..._Args>
     static void __call(_Args&&... __args) {
         __invoke(_VSTD::forward<_Args>(__args)...);
@@ -385,7 +389,7 @@
     // construct/copy/destroy
     _LIBCPP_INLINE_VISIBILITY reference_wrapper(type& __f) _NOEXCEPT
         : __f_(_VSTD::addressof(__f)) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     private: reference_wrapper(type&&); public: // = delete; // do not bind to temps
 #endif
 
@@ -393,7 +397,7 @@
     _LIBCPP_INLINE_VISIBILITY operator type&    () const _NOEXCEPT {return *__f_;}
     _LIBCPP_INLINE_VISIBILITY          type& get() const _NOEXCEPT {return *__f_;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     // invoke
     template <class... _ArgTypes>
     _LIBCPP_INLINE_VISIBILITY
@@ -506,7 +510,7 @@
     operator() (_A0 const& __a0, _A1 const& __a1, _A2 const& __a2) const {
         return __invoke(get(), __a0, __a1, __a2);
     }
-#endif // _LIBCPP_CXX03_LANG
+#endif // _LIBCPP_HAS_NO_VARIADICS
 };
 
 
@@ -564,7 +568,7 @@
 
 struct _LIBCPP_TEMPLATE_VIS allocator_arg_t { };
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MEMORY)
+#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
 extern const allocator_arg_t allocator_arg;
 #else
 constexpr allocator_arg_t allocator_arg = allocator_arg_t();
@@ -607,7 +611,7 @@
 constexpr size_t uses_allocator_v = uses_allocator<_Tp, _Alloc>::value;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 // allocator construction
 
@@ -659,7 +663,7 @@
              __storage, __a, _VSTD::forward<_Args>(__args)...
         );
 }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/__hash_table b/include/__hash_table
index b9cd515..83a4345 100644
--- a/include/__hash_table
+++ b/include/__hash_table
@@ -20,18 +20,17 @@
 #include <utility>
 #include <type_traits>
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
+
 #ifndef _LIBCPP_CXX03_LANG
 template <class _Key, class _Tp>
 union __hash_value_type;
@@ -137,7 +136,7 @@
 size_t
 __next_hash_pow2(size_t __n)
 {
-    return __n < 2 ? __n : (size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1)));
+    return size_t(1) << (std::numeric_limits<size_t>::digits - __clz(__n-1));
 }
 
 
@@ -799,7 +798,8 @@
         _NOEXCEPT_(is_nothrow_copy_constructible<allocator_type>::value)
         : __data_(__size, __a) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     _LIBCPP_INLINE_VISIBILITY
     __bucket_list_deallocator(__bucket_list_deallocator&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value)
@@ -807,7 +807,8 @@
     {
         __x.size() = 0;
     }
-#endif
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     size_type& size() _NOEXCEPT {return __data_.first();}
@@ -1401,7 +1402,7 @@
                                                        const key_equal& __eql,
                                                        const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
-      __p1_(__second_tag(), __node_allocator(__a)),
+      __p1_(__node_allocator(__a)),
       __p2_(0, __hf),
       __p3_(1.0f, __eql)
 {
@@ -1410,7 +1411,7 @@
 template <class _Tp, class _Hash, class _Equal, class _Alloc>
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
-      __p1_(__second_tag(), __node_allocator(__a)),
+      __p1_(__node_allocator(__a)),
       __p2_(0),
       __p3_(1.0f)
 {
@@ -1422,7 +1423,7 @@
           __bucket_list_deleter(allocator_traits<__pointer_allocator>::
               select_on_container_copy_construction(
                   __u.__bucket_list_.get_deleter().__alloc()), 0)),
-      __p1_(__second_tag(), allocator_traits<__node_allocator>::
+      __p1_(allocator_traits<__node_allocator>::
           select_on_container_copy_construction(__u.__node_alloc())),
       __p2_(0, __u.hash_function()),
       __p3_(__u.__p3_)
@@ -1433,7 +1434,7 @@
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(const __hash_table& __u,
                                                        const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
-      __p1_(__second_tag(), __node_allocator(__a)),
+      __p1_(__node_allocator(__a)),
       __p2_(0, __u.hash_function()),
       __p3_(__u.__p3_)
 {
@@ -1467,7 +1468,7 @@
 __hash_table<_Tp, _Hash, _Equal, _Alloc>::__hash_table(__hash_table&& __u,
                                                        const allocator_type& __a)
     : __bucket_list_(nullptr, __bucket_list_deleter(__pointer_allocator(__a), 0)),
-      __p1_(__second_tag(), __node_allocator(__a)),
+      __p1_(__node_allocator(__a)),
       __p2_(0, _VSTD::move(__u.hash_function())),
       __p3_(_VSTD::move(__u.__p3_))
 {
@@ -2669,9 +2670,6 @@
 }
 
 #endif  // _LIBCPP_DEBUG_LEVEL >= 2
-
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP__HASH_TABLE
diff --git a/include/__locale b/include/__locale
index 7668422..a878e25 100644
--- a/include/__locale
+++ b/include/__locale
@@ -19,7 +19,7 @@
 #include <cstdint>
 #include <cctype>
 #include <locale.h>
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
 # include <support/win32/locale_win32.h>
 #elif defined(_AIX)
 # include <support/ibm/xlocale.h>
@@ -37,11 +37,9 @@
 #elif (defined(__GLIBC__) || defined(__APPLE__)      || defined(__FreeBSD__) \
     || defined(__EMSCRIPTEN__) || defined(__IBMCPP__))
 # include <xlocale.h>
-#elif defined(__Fuchsia__)
-# include <support/fuchsia/xlocale.h>
 #elif defined(_LIBCPP_HAS_MUSL_LIBC)
 # include <support/musl/xlocale.h>
-#endif
+#endif // __GLIBC__ || __APPLE__ || __FreeBSD__ || __sun__ || __EMSCRIPTEN__ || __IBMCPP__
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
@@ -49,25 +47,6 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#if !defined(_LIBCPP_LOCALE__L_EXTENSIONS) || defined(_LIBCPP_MSVCRT)
-struct __libcpp_locale_guard {
-  _LIBCPP_INLINE_VISIBILITY
-  __libcpp_locale_guard(locale_t& __loc) : __old_loc_(uselocale(__loc)) {}
-
-  _LIBCPP_INLINE_VISIBILITY
-  ~__libcpp_locale_guard() {
-    if (__old_loc_)
-      uselocale(__old_loc_);
-  }
-
-  locale_t __old_loc_;
-private:
-  __libcpp_locale_guard(__libcpp_locale_guard const&);
-  __libcpp_locale_guard& operator=(__libcpp_locale_guard const&);
-};
-#endif
-
-
 class _LIBCPP_TYPE_VIS locale;
 
 template <class _Facet>
@@ -88,7 +67,6 @@
     class _LIBCPP_TYPE_VIS id;
 
     typedef int category;
-    _LIBCPP_AVAILABILITY_LOCALE_CATEGORY
     static const category // values assigned here are for exposition only
         none     = 0,
         collate  = LC_COLLATE_MASK,
@@ -367,7 +345,7 @@
     static const mask punct  = _ISpunct;
     static const mask xdigit = _ISxdigit;
     static const mask blank  = _ISblank;
-#elif defined(_LIBCPP_MSVCRT_LIKE)
+#elif defined(_LIBCPP_MSVCRT)
     typedef unsigned short mask;
     static const mask space  = _SPACE;
     static const mask print  = _BLANK|_PUNCT|_ALPHA|_DIGIT;
diff --git a/include/__mutex_base b/include/__mutex_base
index 3b2453f..f76e966 100644
--- a/include/__mutex_base
+++ b/include/__mutex_base
@@ -16,15 +16,10 @@
 #include <system_error>
 #include <__threading_support>
 
-
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #ifndef _LIBCPP_HAS_NO_THREADS
@@ -39,7 +34,7 @@
 
 class _LIBCPP_TYPE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(capability("mutex")) mutex
 {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     __libcpp_mutex_t __m_ = _LIBCPP_MUTEX_INITIALIZER;
 #else
     __libcpp_mutex_t __m_;
@@ -47,8 +42,8 @@
 
 public:
     _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
-    constexpr mutex() = default;
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+    constexpr mutex() _NOEXCEPT = default;
 #else
     mutex() _NOEXCEPT {__m_ = (__libcpp_mutex_t)_LIBCPP_MUTEX_INITIALIZER;}
 #endif
@@ -67,14 +62,11 @@
     _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() {return &__m_;}
 };
 
-static_assert(is_nothrow_default_constructible<mutex>::value,
-              "the default constructor for std::mutex must be nothrow");
-
 struct _LIBCPP_TYPE_VIS defer_lock_t {};
 struct _LIBCPP_TYPE_VIS try_to_lock_t {};
 struct _LIBCPP_TYPE_VIS adopt_lock_t {};
 
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_MUTEX)
+#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MUTEX)
 
 extern const defer_lock_t  defer_lock;
 extern const try_to_lock_t try_to_lock;
@@ -88,9 +80,21 @@
 
 #endif
 
+
+// Forward declare lock_guard as a variadic template even in C++03 to keep
+// the mangling consistent between dialects.
+#if defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD)
+template <class ..._Mutexes>
+class _LIBCPP_TEMPLATE_VIS lock_guard;
+#endif
+
 template <class _Mutex>
 class _LIBCPP_TEMPLATE_VIS _LIBCPP_THREAD_SAFETY_ANNOTATION(scoped_lockable)
+#if !defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD)
 lock_guard
+#else
+lock_guard<_Mutex>
+#endif
 {
 public:
     typedef _Mutex mutex_type;
@@ -158,7 +162,7 @@
     unique_lock& operator=(unique_lock const&); // = delete;
 
 public:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unique_lock(unique_lock&& __u) _NOEXCEPT
         : __m_(__u.__m_), __owns_(__u.__owns_)
@@ -175,7 +179,7 @@
             return *this;
         }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     void lock();
     bool try_lock();
@@ -287,7 +291,7 @@
 
 class _LIBCPP_TYPE_VIS condition_variable
 {
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     __libcpp_condvar_t __cv_ = _LIBCPP_CONDVAR_INITIALIZER;
 #else
     __libcpp_condvar_t __cv_;
@@ -295,7 +299,7 @@
 
 public:
     _LIBCPP_INLINE_VISIBILITY
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr condition_variable() _NOEXCEPT = default;
 #else
     condition_variable() _NOEXCEPT {__cv_ = (__libcpp_condvar_t)_LIBCPP_CONDVAR_INITIALIZER;}
@@ -435,6 +439,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP___MUTEX_BASE
diff --git a/include/__split_buffer b/include/__split_buffer
index 1daa4e5..79d1aa1 100644
--- a/include/__split_buffer
+++ b/include/__split_buffer
@@ -6,14 +6,12 @@
 #include <type_traits>
 #include <algorithm>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <bool>
@@ -68,7 +66,7 @@
     __split_buffer(size_type __cap, size_type __start, __alloc_rr& __a);
     ~__split_buffer();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     __split_buffer(__split_buffer&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
     __split_buffer(__split_buffer&& __c, const __alloc_rr& __a);
@@ -76,7 +74,7 @@
         _NOEXCEPT_((__alloc_traits::propagate_on_container_move_assignment::value &&
                 is_nothrow_move_assignable<allocator_type>::value) ||
                !__alloc_traits::propagate_on_container_move_assignment::value);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY       iterator begin() _NOEXCEPT       {return __begin_;}
     _LIBCPP_INLINE_VISIBILITY const_iterator begin() const _NOEXCEPT {return __begin_;}
@@ -101,12 +99,14 @@
     void shrink_to_fit() _NOEXCEPT;
     void push_front(const_reference __x);
     _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
     void push_front(value_type&& __x);
     void push_back(value_type&& __x);
+#if !defined(_LIBCPP_HAS_NO_VARIADICS)
     template <class... _Args>
         void emplace_back(_Args&&... __args);
-#endif  // !defined(_LIBCPP_CXX03_LANG)
+#endif  // !defined(_LIBCPP_HAS_NO_VARIADICS)
+#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
 
     _LIBCPP_INLINE_VISIBILITY void pop_front() {__destruct_at_begin(__begin_+1);}
     _LIBCPP_INLINE_VISIBILITY void pop_back() {__destruct_at_end(__end_-1);}
@@ -343,7 +343,7 @@
         __alloc_traits::deallocate(__alloc(), __first_, capacity());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c)
@@ -361,7 +361,7 @@
 
 template <class _Tp, class _Allocator>
 __split_buffer<_Tp, _Allocator>::__split_buffer(__split_buffer&& __c, const __alloc_rr& __a)
-    : __end_cap_(__second_tag(), __a)
+    : __end_cap_(__a)
 {
     if (__a == __c.__alloc())
     {
@@ -405,7 +405,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 void
@@ -492,7 +492,7 @@
     --__begin_;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 void
@@ -524,7 +524,7 @@
     --__begin_;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -556,7 +556,7 @@
     ++__end_;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 void
@@ -588,6 +588,8 @@
     ++__end_;
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Allocator>
 template <class... _Args>
 void
@@ -619,7 +621,9 @@
     ++__end_;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -630,8 +634,7 @@
     __x.swap(__y);
 }
 
-_LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
+_LIBCPP_END_NAMESPACE_STD
 
 #endif  // _LIBCPP_SPLIT_BUFFER
diff --git a/include/__std_stream b/include/__std_stream
index db90795..fb5a346 100644
--- a/include/__std_stream
+++ b/include/__std_stream
@@ -17,14 +17,12 @@
 #include <__locale>
 #include <cstdio>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 static const int __limit = 8;
@@ -357,6 +355,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP___STD_STREAM
diff --git a/include/__string b/include/__string
index d30c7fd..75608ce 100644
--- a/include/__string
+++ b/include/__string
@@ -57,16 +57,14 @@
 #include <cstdio>     // For EOF.
 #include <memory>     // for __murmur2_or_cityhash
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // char_traits
@@ -872,6 +870,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP___STRING
diff --git a/include/__threading_support b/include/__threading_support
index 5d4c907..aa94713 100644
--- a/include/__threading_support
+++ b/include/__threading_support
@@ -27,15 +27,11 @@
 # include <pthread.h>
 # include <sched.h>
 #elif defined(_LIBCPP_HAS_THREAD_API_WIN32)
-#include <windows.h>
+#include <Windows.h>
 #include <process.h>
 #include <fibersapi.h>
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 #if defined(_LIBCPP_HAS_THREAD_LIBRARY_EXTERNAL) || \
     defined(_LIBCPP_BUILDING_THREAD_LIBRARY_EXTERNAL)
 #define _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_FUNC_VIS
@@ -478,10 +474,7 @@
                                  timeout_ms.count() > 0 ? timeout_ms.count()
                                                         : 0,
                                  0))
-    {
-      auto __ec = GetLastError();
-      return __ec == ERROR_TIMEOUT ? ETIMEDOUT : __ec;
-    }
+    return GetLastError();
   return 0;
 }
 
@@ -632,8 +625,6 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif // !_LIBCPP_HAS_NO_THREADS
 
 #endif // _LIBCPP_THREADING_SUPPORT
diff --git a/include/__tree b/include/__tree
index 792870a..708fe97 100644
--- a/include/__tree
+++ b/include/__tree
@@ -17,14 +17,12 @@
 #include <stdexcept>
 #include <algorithm>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _Compare, class _Allocator> class __tree;
@@ -1107,7 +1105,7 @@
         void __assign_unique(_InputIterator __first, _InputIterator __last);
     template <class _InputIterator>
         void __assign_multi(_InputIterator __first, _InputIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     __tree(__tree&& __t)
         _NOEXCEPT_(
             is_nothrow_move_constructible<__node_allocator>::value &&
@@ -1118,7 +1116,7 @@
             __node_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<value_compare>::value &&
             is_nothrow_move_assignable<__node_allocator>::value);
-#endif // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     ~__tree();
 
@@ -1504,7 +1502,7 @@
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
     : __begin_node_(__iter_pointer()),
-      __pair1_(__second_tag(), __node_allocator(__a)),
+      __pair1_(__node_allocator(__a)),
       __pair3_(0)
 {
     __begin_node() = __end_node();
@@ -1514,7 +1512,7 @@
 __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp,
                                            const allocator_type& __a)
     : __begin_node_(__iter_pointer()),
-      __pair1_(__second_tag(), __node_allocator(__a)),
+      __pair1_(__node_allocator(__a)),
       __pair3_(0, __comp)
 {
     __begin_node() = __end_node();
@@ -1671,13 +1669,13 @@
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
     : __begin_node_(__iter_pointer()),
-      __pair1_(__second_tag(), __node_traits::select_on_container_copy_construction(__t.__node_alloc())),
+      __pair1_(__node_traits::select_on_container_copy_construction(__t.__node_alloc())),
       __pair3_(0, __t.value_comp())
 {
     __begin_node() = __end_node();
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t)
@@ -1701,7 +1699,7 @@
 
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::__tree(__tree&& __t, const allocator_type& __a)
-    : __pair1_(__second_tag(), __node_allocator(__a)),
+    : __pair1_(__node_allocator(__a)),
       __pair3_(0, _VSTD::move(__t.value_comp()))
 {
     if (__a == __t.__alloc())
@@ -1807,7 +1805,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Compare, class _Allocator>
 __tree<_Tp, _Compare, _Allocator>::~__tree()
@@ -2687,6 +2685,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP___TREE
diff --git a/include/__tuple b/include/__tuple
index 69d6ee9..4193d2c 100644
--- a/include/__tuple
+++ b/include/__tuple
@@ -85,7 +85,7 @@
 
 // tuple specializations
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_VARIADICS)
 
 template <size_t...> struct __tuple_indices {};
 
@@ -189,8 +189,7 @@
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
 get(const tuple<_Tp...>&&) _NOEXCEPT;
-
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif
 
 // pair specializations
 
@@ -206,7 +205,7 @@
 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
 get(const pair<_T1, _T2>&) _NOEXCEPT;
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
 template <size_t _Ip, class _T1, class _T2>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -234,7 +233,7 @@
 const _Tp&
 get(const array<_Tp, _Size>&) _NOEXCEPT;
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
 template <size_t _Ip, class _Tp, size_t _Size>
 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
 _Tp&&
@@ -246,7 +245,8 @@
 get(const array<_Tp, _Size>&&) _NOEXCEPT;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_VARIADICS)
+
 
 // __tuple_types
 
@@ -468,6 +468,9 @@
 using tuple_element_t = typename tuple_element <_Ip, _Tp...>::type;
 #endif
 
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+#ifndef _LIBCPP_CXX03_LANG
 template <bool _IsTuple, class _SizeTrait, size_t _Expected>
 struct __tuple_like_with_size_imp : false_type {};
 
@@ -492,7 +495,7 @@
     template <class ...>
     static constexpr bool __enable_assign() { return false; }
 };
-#endif // !defined(_LIBCPP_CXX03_LANG)
+#endif
 
 #if _LIBCPP_STD_VER > 14
 
diff --git a/include/__undef_macros b/include/__undef_min_max
similarity index 75%
rename from include/__undef_macros
rename to include/__undef_min_max
index 60ab1db..f4ca091 100644
--- a/include/__undef_macros
+++ b/include/__undef_min_max
@@ -1,17 +1,16 @@
 // -*- C++ -*-
-//===------------------------ __undef_macros ------------------------------===//
+//===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 
-
 #ifdef min
 #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
-#if defined(_LIBCPP_WARNING)
+#if defined(_LIBCPP_MSVC)
 _LIBCPP_WARNING("macro min is incompatible with C++.  Try #define NOMINMAX "
                 "before any Windows header. #undefing min")
 #else
@@ -23,7 +22,7 @@
 
 #ifdef max
 #if !defined(_LIBCPP_DISABLE_MACRO_CONFLICT_WARNINGS)
-#if defined(_LIBCPP_WARNING)
+#if defined(_LIBCPP_MSVC)
 _LIBCPP_WARNING("macro max is incompatible with C++.  Try #define NOMINMAX "
                 "before any Windows header. #undefing max")
 #else
diff --git a/include/algorithm b/include/algorithm
index 9fe0361..5eec80c 100644
--- a/include/algorithm
+++ b/include/algorithm
@@ -35,9 +35,6 @@
     Function
     for_each(InputIterator first, InputIterator last, Function f);
 
-template<class InputIterator, class Size, class Function>
-    InputIterator for_each_n(InputIterator first, Size n, Function f); // C++17
-
 template <class InputIterator, class T>
     InputIterator
     find(InputIterator first, InputIterator last, const T& value);
@@ -284,12 +281,12 @@
 
 template <class RandomAccessIterator>
     void
-    random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14, removed in C++17
+    random_shuffle(RandomAccessIterator first, RandomAccessIterator last); // deprecated in C++14
 
 template <class RandomAccessIterator, class RandomNumberGenerator>
     void
     random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
-                   RandomNumberGenerator& rand);  // deprecated in C++14, removed in C++17
+                   RandomNumberGenerator& rand);  // deprecated in C++14
 
 template<class PopulationIterator, class SampleIterator,
          class Distance, class UniformRandomBitGenerator>
@@ -647,20 +644,18 @@
 #if defined(__IBMCPP__)
 #include "support/ibm/support.h"
 #endif
-#if defined(_LIBCPP_COMPILER_MSVC)
-#include <intrin.h>
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
+#include "support/win32/support.h"
 #endif
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // I'd like to replace these with _VSTD::equal_to<void>, but can't because:
@@ -788,132 +783,51 @@
 
 // Precondition:  __x != 0
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned __ctz(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned
+__ctz(unsigned __x)
+{
     return static_cast<unsigned>(__builtin_ctz(__x));
-#else
-  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-  static_assert(sizeof(unsigned long) == 4, "");
-  unsigned long where;
-  // Search from LSB to MSB for first set bit.
-  // Returns zero if no set bit is found.
-  if (_BitScanForward(&where, mask))
-    return where;
-  return 32;
-#endif
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned long __ctz(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned long
+__ctz(unsigned long __x)
+{
     return static_cast<unsigned long>(__builtin_ctzl(__x));
-#else
-    static_assert(sizeof(unsigned long) == sizeof(unsigned), "");
-    return __ctz(static_cast<unsigned>(__x));
-#endif
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long __ctz(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned long long
+__ctz(unsigned long long __x)
+{
     return static_cast<unsigned long long>(__builtin_ctzll(__x));
-#else
-    unsigned long where;
-// Search from LSB to MSB for first set bit.
-// Returns zero if no set bit is found.
-#if defined(_LIBCPP_HAS_BITSCAN64)
-    (defined(_M_AMD64) || defined(__x86_64__))
-  if (_BitScanForward64(&where, mask))
-    return static_cast<int>(where);
-#else
-  // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
-  // Scan the Low Word.
-  if (_BitScanForward(&where, static_cast<unsigned long>(mask)))
-    return where;
-  // Scan the High Word.
-  if (_BitScanForward(&where, static_cast<unsigned long>(mask >> 32)))
-    return where + 32; // Create a bit offset from the LSB.
-#endif
-  return 64;
-#endif // _LIBCPP_COMPILER_MSVC
 }
 
 // Precondition:  __x != 0
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned __clz(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned
+__clz(unsigned __x)
+{
     return static_cast<unsigned>(__builtin_clz(__x));
-#else
-  static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-  static_assert(sizeof(unsigned long) == 4, "");
-  unsigned long where;
-  // Search from LSB to MSB for first set bit.
-  // Returns zero if no set bit is found.
-  if (_BitScanReverse(&where, mask))
-    return 31 - where;
-  return 32; // Undefined Behavior.
-#endif
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned long __clz(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned long
+__clz(unsigned long __x)
+{
     return static_cast<unsigned long>(__builtin_clzl (__x));
-#else
-    static_assert(sizeof(unsigned) == sizeof(unsigned long), "");
-    return __clz(static_cast<unsigned>(__x));
-#endif
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
-unsigned long long __clz(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
+unsigned long long
+__clz(unsigned long long __x)
+{
     return static_cast<unsigned long long>(__builtin_clzll(__x));
-#else
-  unsigned long where;
-// BitScanReverse scans from MSB to LSB for first set bit.
-// Returns 0 if no set bit is found.
-#if defined(_LIBCPP_HAS_BITSCAN64)
-  if (_BitScanReverse64(&where, mask))
-    return static_cast<int>(63 - where);
-#else
-  // Scan the high 32 bits.
-  if (_BitScanReverse(&where, static_cast<unsigned long>(mask >> 32)))
-    return 63 - (where + 32); // Create a bit offset from the MSB.
-  // Scan the low 32 bits.
-  if (_BitScanReverse(&where, static_cast<unsigned long>(mask)))
-    return 63 - where;
-#endif
-  return 64; // Undefined Behavior.
-#endif // _LIBCPP_COMPILER_MSVC
 }
 
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcount  (__x);
-#else
-  static_assert(sizeof(unsigned) == 4, "");
-  return __popcnt(__x);
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcountl (__x);
-#else
-  static_assert(sizeof(unsigned long) == 4, "");
-  return __popcnt(__x);
-#endif
-}
-
-inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {
-#ifndef _LIBCPP_COMPILER_MSVC
-  return __builtin_popcountll(__x);
-#else
-  static_assert(sizeof(unsigned long long) == 8, "");
-  return __popcnt64(__x);
-#endif
-}
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned           __x) {return __builtin_popcount  (__x);}
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned      long __x) {return __builtin_popcountl (__x);}
+inline _LIBCPP_INLINE_VISIBILITY int __pop_count(unsigned long long __x) {return __builtin_popcountll(__x);}
 
 // all_of
 
@@ -966,26 +880,6 @@
     return __f;
 }
 
-#if _LIBCPP_STD_VER > 14
-// for_each_n
-
-template <class _InputIterator, class _Size, class _Function>
-inline _LIBCPP_INLINE_VISIBILITY
-_InputIterator
-for_each_n(_InputIterator __first, _Size __orig_n, _Function __f)
-{
-    typedef decltype(__convert_to_integral(__orig_n)) _IntegralSize;
-    _IntegralSize __n = __orig_n;
-    while (__n > 0)
-    {
-         __f(*__first);
-         ++__first;
-         --__n;
-    }
-    return __first;
-}
-#endif
-
 // find
 
 template <class _InputIterator, class _Tp>
@@ -2654,7 +2548,7 @@
     return _VSTD::min(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _Tp, class _Compare>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2672,7 +2566,7 @@
     return *_VSTD::min_element(__t.begin(), __t.end(), __less<_Tp>());
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 // max_element
 
@@ -2719,7 +2613,7 @@
     return _VSTD::max(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _Tp, class _Compare>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2737,7 +2631,7 @@
     return *_VSTD::max_element(__t.begin(), __t.end(), __less<_Tp>());
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 #if _LIBCPP_STD_VER > 14
 // clamp
@@ -2838,7 +2732,7 @@
     return _VSTD::minmax(__a, __b, __less<_Tp>());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _Tp, class _Compare>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -2885,7 +2779,7 @@
     return _VSTD::minmax(__t, __less<_Tp>());
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 // random_shuffle
 
@@ -2910,11 +2804,11 @@
     static const size_t value = _Rp + 1;
 };
 
-template <class _UIntType, _UIntType _Xp>
+template <class _UI, _UI _Xp>
 struct __log2
 {
     static const size_t value = __log2_imp<_Xp,
-                                         sizeof(_UIntType) * __CHAR_BIT__ - 1>::value;
+                                         sizeof(_UI) * __CHAR_BIT__ - 1>::value;
 };
 
 template<class _Engine, class _UIntType>
@@ -2943,7 +2837,7 @@
     _Engine_result_type __mask0_;
     _Engine_result_type __mask1_;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
                                           + _Working_result_type(1);
 #else
@@ -3132,8 +3026,6 @@
     return static_cast<result_type>(__u + __p.a());
 }
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE) \
-  || defined(_LIBCPP_BUILDING_LIBRARY)
 class _LIBCPP_TYPE_VIS __rs_default;
 
 _LIBCPP_FUNC_VIS __rs_default __rs_get();
@@ -3186,7 +3078,7 @@
 template <class _RandomAccessIterator, class _RandomNumberGenerator>
 void
 random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
                _RandomNumberGenerator&& __rand)
 #else
                _RandomNumberGenerator& __rand)
@@ -3203,7 +3095,6 @@
         }
     }
 }
-#endif
 
 template <class _PopulationIterator, class _SampleIterator, class _Distance,
           class _UniformRandomNumberGenerator>
@@ -3279,7 +3170,7 @@
 
 template<class _RandomAccessIterator, class _UniformRandomNumberGenerator>
     void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
                  _UniformRandomNumberGenerator&& __g)
 #else
                  _UniformRandomNumberGenerator& __g)
@@ -5906,6 +5797,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_ALGORITHM
diff --git a/include/any b/include/any
index d7161b0..823e130 100644
--- a/include/any
+++ b/include/any
@@ -45,10 +45,6 @@
       any& operator=(ValueType&& rhs);
 
     // 6.3.3 any modifiers
-    template <class ValueType, class... Args>
-      decay_t<ValueType>& emplace(Args&&... args);
-    template <class ValueType, class U, class... Args>
-      decay_t<ValueType>& emplace(initializer_list<U>, Args&&...);
     void reset() noexcept;
     void swap(any& rhs) noexcept;
 
@@ -77,6 +73,8 @@
   template<class ValueType>
     ValueType* any_cast(any* operand) noexcept;
 
+} // namespace fundamentals_v1
+} // namespace experimental
 } // namespace std
 
 */
@@ -260,7 +258,7 @@
         is_copy_constructible<_Tp>::value>
     >
   _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(_Args&&... args);
+  void emplace(_Args&&... args);
 
   template <class _ValueType, class _Up, class ..._Args,
     class _Tp = decay_t<_ValueType>,
@@ -269,7 +267,7 @@
         is_copy_constructible<_Tp>::value>
   >
   _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(initializer_list<_Up>, _Args&&...);
+  void emplace(initializer_list<_Up>, _Args&&...);
 
   // 6.3.3 any modifiers
   _LIBCPP_INLINE_VISIBILITY
@@ -366,10 +364,9 @@
 
     template <class ..._Args>
     _LIBCPP_INLINE_VISIBILITY
-    static _Tp& __create(any & __dest, _Args&&... __args) {
-        _Tp* __ret = ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);
+    static void __create(any & __dest, _Args&&... __args) {
+        ::new (static_cast<void*>(&__dest.__s.__buf)) _Tp(_VSTD::forward<_Args>(__args)...);
         __dest.__h = &_SmallHandler::__handle;
-        return *__ret;
     }
 
   private:
@@ -442,15 +439,14 @@
 
     template <class ..._Args>
     _LIBCPP_INLINE_VISIBILITY
-    static _Tp& __create(any & __dest, _Args&&... __args) {
+    static void __create(any & __dest, _Args&&... __args) {
         typedef allocator<_Tp> _Alloc;
         typedef __allocator_destructor<_Alloc> _Dp;
         _Alloc __a;
         unique_ptr<_Tp, _Dp> __hold(__a.allocate(1), _Dp(__a, 1));
-        _Tp* __ret = ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
+        ::new ((void*)__hold.get()) _Tp(_VSTD::forward<_Args>(__args)...);
         __dest.__s.__ptr = __hold.release();
         __dest.__h = &_LargeHandler::__handle;
-        return *__ret;
     }
 
   private:
@@ -523,16 +519,16 @@
 
 template <class _ValueType, class ..._Args, class _Tp, class>
 inline _LIBCPP_INLINE_VISIBILITY
-_Tp& any::emplace(_Args&&... __args) {
+void any::emplace(_Args&&... __args) {
   reset();
-  return __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
+  __any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_Args>(__args)...);
 }
 
 template <class _ValueType, class _Up, class ..._Args, class _Tp, class>
 inline _LIBCPP_INLINE_VISIBILITY
-_Tp& any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
+void any::emplace(initializer_list<_Up> __il, _Args&&... __args) {
   reset();
-  return __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
+  __any_imp::_Handler<_Tp>::__create(*this, __il, _VSTD::forward<_Args>(__args)...);
 }
 
 inline _LIBCPP_INLINE_VISIBILITY
diff --git a/include/array b/include/array
index 79f7e0d..165ffad 100644
--- a/include/array
+++ b/include/array
@@ -113,8 +113,6 @@
 #pragma GCC system_header
 #endif
 
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, size_t _Size>
@@ -318,7 +316,7 @@
     return __a.__elems_[_Ip];
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <size_t _Ip, class _Tp, size_t _Size>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -338,7 +336,7 @@
     return _VSTD::move(__a.__elems_[_Ip]);
 }
 
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/atomic b/include/atomic
index f55e28f..a17bdce 100644
--- a/include/atomic
+++ b/include/atomic
@@ -861,29 +861,16 @@
     return __y;
 }
 
-#if defined(__CLANG_ATOMIC_BOOL_LOCK_FREE)
-# define ATOMIC_BOOL_LOCK_FREE      __CLANG_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE      __CLANG_ATOMIC_CHAR_LOCK_FREE
-# define ATOMIC_CHAR16_T_LOCK_FREE  __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE  __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE   __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE     __CLANG_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE       __CLANG_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE      __CLANG_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE     __CLANG_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE   __CLANG_ATOMIC_POINTER_LOCK_FREE
-#else
-# define ATOMIC_BOOL_LOCK_FREE      __GCC_ATOMIC_BOOL_LOCK_FREE
-# define ATOMIC_CHAR_LOCK_FREE      __GCC_ATOMIC_CHAR_LOCK_FREE
-# define ATOMIC_CHAR16_T_LOCK_FREE  __GCC_ATOMIC_CHAR16_T_LOCK_FREE
-# define ATOMIC_CHAR32_T_LOCK_FREE  __GCC_ATOMIC_CHAR32_T_LOCK_FREE
-# define ATOMIC_WCHAR_T_LOCK_FREE   __GCC_ATOMIC_WCHAR_T_LOCK_FREE
-# define ATOMIC_SHORT_LOCK_FREE     __GCC_ATOMIC_SHORT_LOCK_FREE
-# define ATOMIC_INT_LOCK_FREE       __GCC_ATOMIC_INT_LOCK_FREE
-# define ATOMIC_LONG_LOCK_FREE      __GCC_ATOMIC_LONG_LOCK_FREE
-# define ATOMIC_LLONG_LOCK_FREE     __GCC_ATOMIC_LLONG_LOCK_FREE
-# define ATOMIC_POINTER_LOCK_FREE   __GCC_ATOMIC_POINTER_LOCK_FREE
-#endif
+#define ATOMIC_BOOL_LOCK_FREE      __GCC_ATOMIC_BOOL_LOCK_FREE
+#define ATOMIC_CHAR_LOCK_FREE      __GCC_ATOMIC_CHAR_LOCK_FREE
+#define ATOMIC_CHAR16_T_LOCK_FREE  __GCC_ATOMIC_CHAR16_T_LOCK_FREE
+#define ATOMIC_CHAR32_T_LOCK_FREE  __GCC_ATOMIC_CHAR32_T_LOCK_FREE
+#define ATOMIC_WCHAR_T_LOCK_FREE   __GCC_ATOMIC_WCHAR_T_LOCK_FREE
+#define ATOMIC_SHORT_LOCK_FREE     __GCC_ATOMIC_SHORT_LOCK_FREE
+#define ATOMIC_INT_LOCK_FREE       __GCC_ATOMIC_INT_LOCK_FREE
+#define ATOMIC_LONG_LOCK_FREE      __GCC_ATOMIC_LONG_LOCK_FREE
+#define ATOMIC_LLONG_LOCK_FREE     __GCC_ATOMIC_LLONG_LOCK_FREE
+#define ATOMIC_POINTER_LOCK_FREE   __GCC_ATOMIC_POINTER_LOCK_FREE
 
 // general atomic<T>
 
diff --git a/include/bitset b/include/bitset
index 583122f..827a901 100644
--- a/include/bitset
+++ b/include/bitset
@@ -113,6 +113,10 @@
 
 */
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 #include <__config>
 #include <__bit_reference>
 #include <cstddef>
@@ -122,13 +126,7 @@
 #include <iosfwd>
 #include <__functional_base>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
+#include <__undef_min_max>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -199,11 +197,11 @@
     _LIBCPP_INLINE_VISIBILITY
     size_t __hash_code() const _NOEXCEPT;
 private:
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     void __init(unsigned long long __v, false_type) _NOEXCEPT;
     _LIBCPP_INLINE_VISIBILITY
     void __init(unsigned long long __v, true_type) _NOEXCEPT;
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_CONSTEXPR
     unsigned long to_ulong(false_type) const;
     _LIBCPP_INLINE_VISIBILITY
     unsigned long to_ulong(true_type) const;
@@ -219,16 +217,16 @@
 inline
 _LIBCPP_CONSTEXPR
 __bitset<_N_words, _Size>::__bitset() _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     : __first_{0}
 #endif
 {
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     _VSTD::fill_n(__first_, _N_words, __storage_type(0));
 #endif
 }
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
 
 template <size_t _N_words, size_t _Size>
 void
@@ -251,13 +249,13 @@
     _VSTD::fill(__first_ + 1, __first_ + sizeof(__first_)/sizeof(__first_[0]), __storage_type(0));
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_CONSTEXPR
 
 template <size_t _N_words, size_t _Size>
 inline
 _LIBCPP_CONSTEXPR
 __bitset<_N_words, _Size>::__bitset(unsigned long long __v) _NOEXCEPT
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
 #if __SIZEOF_SIZE_T__ == 8
     : __first_{__v}
 #elif __SIZEOF_SIZE_T__ == 4
@@ -267,7 +265,7 @@
 #endif
 #endif
 {
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     __init(__v, integral_constant<bool, sizeof(unsigned long long) == sizeof(__storage_type)>());
 #endif
 }
@@ -1092,6 +1090,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_BITSET
diff --git a/include/chrono b/include/chrono
index 4b793c7..4e82ef2 100644
--- a/include/chrono
+++ b/include/chrono
@@ -48,7 +48,7 @@
     static_assert(Period::num > 0, "duration period must be positive");
 public:
     typedef Rep rep;
-    typedef typename _Period::type period;
+    typedef Period period;
 
     constexpr duration() = default;
     template <class Rep2>
@@ -75,8 +75,8 @@
 
     // arithmetic
 
-    constexpr common_type<duration>::type  operator+() const;
-    constexpr common_type<duration>::type  operator-() const;
+    constexpr duration  operator+() const;
+    constexpr duration  operator-() const;
     constexpr duration& operator++();
     constexpr duration  operator++(int);
     constexpr duration& operator--();
@@ -305,14 +305,12 @@
 #include <ratio>
 #include <limits>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 namespace chrono
@@ -525,7 +523,7 @@
     
 public:
     typedef _Rep rep;
-    typedef typename _Period::type period;
+    typedef _Period period;
 private:
     rep __rep_;
 public:
@@ -567,8 +565,8 @@
 
     // arithmetic
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator+() const {return typename common_type<duration>::type(*this);}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR typename common_type<duration>::type operator-() const {return typename common_type<duration>::type(-__rep_);}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration  operator+() const {return *this;}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR duration  operator-() const {return duration(-__rep_);}
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator++()      {++__rep_; return *this;}
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration  operator++(int)   {return duration(__rep_++);}
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 duration& operator--()      {--__rep_; return *this;}
@@ -1162,6 +1160,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_CHRONO
diff --git a/include/cmath b/include/cmath
index b41f247..74b4ab8 100644
--- a/include/cmath
+++ b/include/cmath
@@ -398,6 +398,7 @@
 using ::copysign;
 using ::copysignf;
 
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 using ::erf;
 using ::erff;
 using ::erfc;
@@ -434,10 +435,12 @@
 using ::lrintf;
 using ::lround;
 using ::lroundf;
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 
 using ::nan;
 using ::nanf;
 
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 using ::nearbyint;
 using ::nearbyintf;
 using ::nextafter;
@@ -460,6 +463,7 @@
 using ::tgammaf;
 using ::trunc;
 using ::truncf;
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 
 using ::acosl;
 using ::asinl;
@@ -491,6 +495,7 @@
 
 using ::copysignl;
 
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 using ::erfl;
 using ::erfcl;
 using ::exp2l;
@@ -521,6 +526,7 @@
 using ::scalbnl;
 using ::tgammal;
 using ::truncl;
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
 
 #if _LIBCPP_STD_VER > 14
 inline _LIBCPP_INLINE_VISIBILITY float       hypot(       float x,       float y,       float z ) { return sqrt(x*x + y*y + z*z); }
diff --git a/include/cstddef b/include/cstddef
index 6258449..103898b 100644
--- a/include/cstddef
+++ b/include/cstddef
@@ -28,7 +28,6 @@
     size_t
     max_align_t
     nullptr_t
-    byte // C++17
 
 }  // std
 
@@ -59,32 +58,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
-namespace std  // purposefully not versioned
-{
-enum class byte : unsigned char {};
-
-constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept
-{ return __lhs = byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
-constexpr byte  operator| (byte  __lhs, byte __rhs) noexcept
-{ return         byte(static_cast<unsigned char>(__lhs) | static_cast<unsigned char>(__rhs)); }
-
-constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept
-{ return __lhs = byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
-constexpr byte  operator& (byte  __lhs, byte __rhs) noexcept
-{ return         byte(static_cast<unsigned char>(__lhs) & static_cast<unsigned char>(__rhs)); }
-
-constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept 
-{ return __lhs = byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
-constexpr byte  operator^ (byte  __lhs, byte __rhs) noexcept
-{ return         byte(static_cast<unsigned char>(__lhs) ^ static_cast<unsigned char>(__rhs)); }
-
-constexpr byte  operator~ (byte __b) noexcept
-{ return  byte(~static_cast<unsigned char>(__b)); }
-
-}
-
-#include <type_traits>  // rest of byte
-#endif
-
 #endif  // _LIBCPP_CSTDDEF
diff --git a/include/cstdio b/include/cstdio
index 00b989f..35941ce 100644
--- a/include/cstdio
+++ b/include/cstdio
@@ -98,6 +98,9 @@
 
 #include <__config>
 #include <stdio.h>
+#if defined(_LIBCPP_MSVCRT)
+#include <crtversion.h>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
@@ -153,7 +156,8 @@
 
 #ifndef _LIBCPP_HAS_NO_STDIN
 using ::getchar;
-#if _LIBCPP_STD_VER <= 11 && !defined(_LIBCPP_MSVCRT)
+#if _LIBCPP_STD_VER <= 11 && \
+    (!defined(_VC_CRT_MAJOR_VERSION) || _VC_CRT_MAJOR_VERSION < 14)
 using ::gets;
 #endif
 using ::scanf;
diff --git a/include/cstdlib b/include/cstdlib
index 78c4284..2ca25ed 100644
--- a/include/cstdlib
+++ b/include/cstdlib
@@ -130,10 +130,8 @@
 using ::atexit;
 using ::exit;
 using ::_Exit;
-#ifndef _LIBCPP_WINDOWS_STORE_APP
 using ::getenv;
 using ::system;
-#endif
 using ::bsearch;
 using ::qsort;
 using ::abs;
diff --git a/include/ctype.h b/include/ctype.h
index e97ff3c..22d6c49 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -40,6 +40,15 @@
 
 #ifdef __cplusplus
 
+#if defined(_LIBCPP_MSVCRT)
+// We support including .h headers inside 'extern "C"' contexts, so switch
+// back to C++ linkage before including these C++ headers.
+extern "C++" {
+  #include "support/win32/support.h"
+  #include "support/win32/locale_win32.h"
+}
+#endif // _LIBCPP_MSVCRT
+
 #undef isalnum
 #undef isalpha
 #undef isblank
diff --git a/include/deque b/include/deque
index f795b48..9280154 100644
--- a/include/deque
+++ b/include/deque
@@ -150,6 +150,10 @@
 
 */
 
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 #include <__config>
 #include <__split_buffer>
 #include <type_traits>
@@ -158,13 +162,7 @@
 #include <algorithm>
 #include <stdexcept>
 
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
+#include <__undef_min_max>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -970,12 +968,13 @@
 public:
     ~__deque_base();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     __deque_base(__deque_base&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
     __deque_base(__deque_base&& __c, const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void swap(__deque_base& __c)
 #if _LIBCPP_STD_VER >= 14
         _NOEXCEPT;
@@ -1109,7 +1108,7 @@
         __alloc_traits::deallocate(__alloc(), *__i, __block_size);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 __deque_base<_Tp, _Allocator>::__deque_base(__deque_base&& __c)
@@ -1141,7 +1140,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 void
@@ -1231,16 +1230,18 @@
               typename enable_if<__is_input_iterator<_InputIter>::value>::type* = 0);
     deque(const deque& __c);
     deque(const deque& __c, const allocator_type& __a);
-
-    deque& operator=(const deque& __c);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     deque(initializer_list<value_type> __il);
     deque(initializer_list<value_type> __il, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+    deque& operator=(const deque& __c);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     deque& operator=(initializer_list<value_type> __il) {assign(__il); return *this;}
+#endif   // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     deque(deque&& __c) _NOEXCEPT_(is_nothrow_move_constructible<__base>::value);
     _LIBCPP_INLINE_VISIBILITY
@@ -1249,10 +1250,7 @@
     deque& operator=(deque&& __c)
         _NOEXCEPT_(__alloc_traits::propagate_on_container_move_assignment::value &&
                    is_nothrow_move_assignable<allocator_type>::value);
-
-    _LIBCPP_INLINE_VISIBILITY
-    void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     template <class _InputIter>
         void assign(_InputIter __f, _InputIter __l,
@@ -1262,6 +1260,10 @@
         void assign(_RAIter __f, _RAIter __l,
                     typename enable_if<__is_random_access_iterator<_RAIter>::value>::type* = 0);
     void assign(size_type __n, const value_type& __v);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    void assign(initializer_list<value_type> __il) {assign(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT;
@@ -1338,7 +1340,8 @@
     // 23.2.2.3 modifiers:
     void push_front(const value_type& __v);
     void push_back(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 #if _LIBCPP_STD_VER > 14
     template <class... _Args> reference emplace_front(_Args&&... __args);
     template <class... _Args> reference emplace_back (_Args&&... __args);
@@ -1347,16 +1350,11 @@
     template <class... _Args> void      emplace_back (_Args&&... __args);
 #endif
     template <class... _Args> iterator emplace(const_iterator __p, _Args&&... __args);
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
     void push_front(value_type&& __v);
     void push_back(value_type&& __v);
     iterator insert(const_iterator __p, value_type&& __v);
-
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, initializer_list<value_type> __il)
-        {return insert(__p, __il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert(const_iterator __p, const value_type& __v);
     iterator insert(const_iterator __p, size_type __n, const value_type& __v);
     template <class _InputIter>
@@ -1370,7 +1368,11 @@
     template <class _BiIter>
         iterator insert(const_iterator __p, _BiIter __f, _BiIter __l,
                          typename enable_if<__is_bidirectional_iterator<_BiIter>::value>::type* = 0);
-
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, initializer_list<value_type> __il)
+        {return insert(__p, __il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     void pop_front();
     void pop_back();
     iterator erase(const_iterator __p);
@@ -1525,19 +1527,7 @@
     __append(__c.begin(), __c.end());
 }
 
-template <class _Tp, class _Allocator>
-deque<_Tp, _Allocator>&
-deque<_Tp, _Allocator>::operator=(const deque& __c)
-{
-    if (this != &__c)
-    {
-        __copy_assign_alloc(__c);
-        assign(__c.begin(), __c.end());
-    }
-    return *this;
-}
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Allocator>
 deque<_Tp, _Allocator>::deque(initializer_list<value_type> __il)
@@ -1552,6 +1542,22 @@
     __append(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+template <class _Tp, class _Allocator>
+deque<_Tp, _Allocator>&
+deque<_Tp, _Allocator>::operator=(const deque& __c)
+{
+    if (this != &__c)
+    {
+        __copy_assign_alloc(__c);
+        assign(__c.begin(), __c.end());
+    }
+    return *this;
+}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Tp, class _Allocator>
 inline
 deque<_Tp, _Allocator>::deque(deque&& __c)
@@ -1607,7 +1613,7 @@
     __base::__move_assign(__c);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 template <class _InputIter>
@@ -1803,20 +1809,8 @@
     ++__base::size();
 }
 
-template <class _Tp, class _Allocator>
-void
-deque<_Tp, _Allocator>::push_front(const value_type& __v)
-{
-    allocator_type& __a = __base::__alloc();
-    if (__front_spare() == 0)
-        __add_front_capacity();
-    // __front_spare() >= 1
-    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
-    --__base::__start_;
-    ++__base::size();
-}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-#ifndef _LIBCPP_CXX03_LANG
 template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::push_back(value_type&& __v)
@@ -1829,6 +1823,8 @@
     ++__base::size();
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Allocator>
 template <class... _Args>
 #if _LIBCPP_STD_VER > 14
@@ -1850,6 +1846,24 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp, class _Allocator>
+void
+deque<_Tp, _Allocator>::push_front(const value_type& __v)
+{
+    allocator_type& __a = __base::__alloc();
+    if (__front_spare() == 0)
+        __add_front_capacity();
+    // __front_spare() >= 1
+    __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), __v);
+    --__base::__start_;
+    ++__base::size();
+}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Tp, class _Allocator>
 void
 deque<_Tp, _Allocator>::push_front(value_type&& __v)
@@ -1863,6 +1877,7 @@
     ++__base::size();
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Tp, class _Allocator>
 template <class... _Args>
@@ -1885,121 +1900,8 @@
 #endif
 }
 
-template <class _Tp, class _Allocator>
-typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
-{
-    size_type __pos = __p - __base::begin();
-    size_type __to_end = __base::size() - __pos;
-    allocator_type& __a = __base::__alloc();
-    if (__pos < __to_end)
-    {   // insert by shifting things backward
-        if (__front_spare() == 0)
-            __add_front_capacity();
-        // __front_spare() >= 1
-        if (__pos == 0)
-        {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
-            --__base::__start_;
-            ++__base::size();
-        }
-        else
-        {
-            iterator __b = __base::begin();
-            iterator __bm1 = _VSTD::prev(__b);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
-            --__base::__start_;
-            ++__base::size();
-            if (__pos > 1)
-                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__v);
-        }
-    }
-    else
-    {   // insert by shifting things forward
-        if (__back_spare() == 0)
-            __add_back_capacity();
-        // __back_capacity >= 1
-        size_type __de = __base::size() - __pos;
-        if (__de == 0)
-        {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
-            ++__base::size();
-        }
-        else
-        {
-            iterator __e = __base::end();
-            iterator __em1 = _VSTD::prev(__e);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
-            ++__base::size();
-            if (__de > 1)
-                __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__v);
-        }
-    }
-    return __base::begin() + __pos;
-}
-
-template <class _Tp, class _Allocator>
-template <class... _Args>
-typename deque<_Tp, _Allocator>::iterator
-deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
-{
-    size_type __pos = __p - __base::begin();
-    size_type __to_end = __base::size() - __pos;
-    allocator_type& __a = __base::__alloc();
-    if (__pos < __to_end)
-    {   // insert by shifting things backward
-        if (__front_spare() == 0)
-            __add_front_capacity();
-        // __front_spare() >= 1
-        if (__pos == 0)
-        {
-            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
-            --__base::__start_;
-            ++__base::size();
-        }
-        else
-        {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
-            iterator __b = __base::begin();
-            iterator __bm1 = _VSTD::prev(__b);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
-            --__base::__start_;
-            ++__base::size();
-            if (__pos > 1)
-                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
-            *__b = _VSTD::move(__tmp.get());
-        }
-    }
-    else
-    {   // insert by shifting things forward
-        if (__back_spare() == 0)
-            __add_back_capacity();
-        // __back_capacity >= 1
-        size_type __de = __base::size() - __pos;
-        if (__de == 0)
-        {
-            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
-            ++__base::size();
-        }
-        else
-        {
-            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
-            iterator __e = __base::end();
-            iterator __em1 = _VSTD::prev(__e);
-            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
-            ++__base::size();
-            if (__de > 1)
-                __e = _VSTD::move_backward(__e - __de, __em1, __e);
-            *--__e = _VSTD::move(__tmp.get());
-        }
-    }
-    return __base::begin() + __pos;
-}
-
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 typename deque<_Tp, _Allocator>::iterator
@@ -2062,6 +1964,126 @@
     return __base::begin() + __pos;
 }
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class _Tp, class _Allocator>
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::insert(const_iterator __p, value_type&& __v)
+{
+    size_type __pos = __p - __base::begin();
+    size_type __to_end = __base::size() - __pos;
+    allocator_type& __a = __base::__alloc();
+    if (__pos < __to_end)
+    {   // insert by shifting things backward
+        if (__front_spare() == 0)
+            __add_front_capacity();
+        // __front_spare() >= 1
+        if (__pos == 0)
+        {
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::move(__v));
+            --__base::__start_;
+            ++__base::size();
+        }
+        else
+        {
+            iterator __b = __base::begin();
+            iterator __bm1 = _VSTD::prev(__b);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
+            --__base::__start_;
+            ++__base::size();
+            if (__pos > 1)
+                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+            *__b = _VSTD::move(__v);
+        }
+    }
+    else
+    {   // insert by shifting things forward
+        if (__back_spare() == 0)
+            __add_back_capacity();
+        // __back_capacity >= 1
+        size_type __de = __base::size() - __pos;
+        if (__de == 0)
+        {
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::move(__v));
+            ++__base::size();
+        }
+        else
+        {
+            iterator __e = __base::end();
+            iterator __em1 = _VSTD::prev(__e);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
+            ++__base::size();
+            if (__de > 1)
+                __e = _VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _VSTD::move(__v);
+        }
+    }
+    return __base::begin() + __pos;
+}
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+template <class _Tp, class _Allocator>
+template <class... _Args>
+typename deque<_Tp, _Allocator>::iterator
+deque<_Tp, _Allocator>::emplace(const_iterator __p, _Args&&... __args)
+{
+    size_type __pos = __p - __base::begin();
+    size_type __to_end = __base::size() - __pos;
+    allocator_type& __a = __base::__alloc();
+    if (__pos < __to_end)
+    {   // insert by shifting things backward
+        if (__front_spare() == 0)
+            __add_front_capacity();
+        // __front_spare() >= 1
+        if (__pos == 0)
+        {
+            __alloc_traits::construct(__a, _VSTD::addressof(*--__base::begin()), _VSTD::forward<_Args>(__args)...);
+            --__base::__start_;
+            ++__base::size();
+        }
+        else
+        {
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            iterator __b = __base::begin();
+            iterator __bm1 = _VSTD::prev(__b);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__bm1), _VSTD::move(*__b));
+            --__base::__start_;
+            ++__base::size();
+            if (__pos > 1)
+                __b = _VSTD::move(_VSTD::next(__b), __b + __pos, __b);
+            *__b = _VSTD::move(__tmp.get());
+        }
+    }
+    else
+    {   // insert by shifting things forward
+        if (__back_spare() == 0)
+            __add_back_capacity();
+        // __back_capacity >= 1
+        size_type __de = __base::size() - __pos;
+        if (__de == 0)
+        {
+            __alloc_traits::construct(__a, _VSTD::addressof(*__base::end()), _VSTD::forward<_Args>(__args)...);
+            ++__base::size();
+        }
+        else
+        {
+            __temp_value<value_type, _Allocator> __tmp(this->__alloc(), _VSTD::forward<_Args>(__args)...);
+            iterator __e = __base::end();
+            iterator __em1 = _VSTD::prev(__e);
+            __alloc_traits::construct(__a, _VSTD::addressof(*__e), _VSTD::move(*__em1));
+            ++__base::size();
+            if (__de > 1)
+                __e = _VSTD::move_backward(__e - __de, __em1, __e);
+            *--__e = _VSTD::move(__tmp.get());
+        }
+    }
+    return __base::begin() + __pos;
+}
+
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Tp, class _Allocator>
 typename deque<_Tp, _Allocator>::iterator
 deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_type& __v)
@@ -2902,6 +2924,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_DEQUE
diff --git a/include/exception b/include/exception
index ca2eaf5..216ae0c 100644
--- a/include/exception
+++ b/include/exception
@@ -127,33 +127,30 @@
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void terminate() _NOEXCEPT;
 
 _LIBCPP_FUNC_VIS bool uncaught_exception() _NOEXCEPT;
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS int uncaught_exceptions() _NOEXCEPT;
+_LIBCPP_FUNC_VIS int uncaught_exceptions() _NOEXCEPT;
 
 class _LIBCPP_TYPE_VIS exception_ptr;
 
 _LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr);
 
-#ifndef _LIBCPP_ABI_MICROSOFT
-
 class _LIBCPP_TYPE_VIS exception_ptr
 {
     void* __ptr_;
 public:
     _LIBCPP_INLINE_VISIBILITY exception_ptr() _NOEXCEPT : __ptr_() {}
     _LIBCPP_INLINE_VISIBILITY exception_ptr(nullptr_t) _NOEXCEPT : __ptr_() {}
-
     exception_ptr(const exception_ptr&) _NOEXCEPT;
     exception_ptr& operator=(const exception_ptr&) _NOEXCEPT;
     ~exception_ptr() _NOEXCEPT;
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
-    {return __ptr_ != nullptr;}
+    _LIBCPP_INLINE_VISIBILITY
+    _LIBCPP_EXPLICIT
+        operator bool() const _NOEXCEPT {return __ptr_ != nullptr;}
 
     friend _LIBCPP_INLINE_VISIBILITY
     bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return __x.__ptr_ == __y.__ptr_;}
-
     friend _LIBCPP_INLINE_VISIBILITY
     bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
         {return !(__x == __y);}
@@ -181,54 +178,6 @@
 #endif
 }
 
-#else // _LIBCPP_ABI_MICROSOFT
-
-class _LIBCPP_TYPE_VIS exception_ptr
-{
-#if defined(__clang__)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-private-field"
-#endif
-    void* __ptr1_;
-    void* __ptr2_;
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-public:
-    exception_ptr() _NOEXCEPT;
-    exception_ptr(nullptr_t) _NOEXCEPT;
-    exception_ptr(const exception_ptr& __other) _NOEXCEPT;
-    exception_ptr& operator=(const exception_ptr& __other) _NOEXCEPT;
-    exception_ptr& operator=(nullptr_t) _NOEXCEPT;
-    ~exception_ptr() _NOEXCEPT;
-    _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT;
-};
-
-_LIBCPP_FUNC_VIS
-bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT;
-
-inline _LIBCPP_INLINE_VISIBILITY
-bool operator!=(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT
-    {return !(__x == __y);}
-
-_LIBCPP_FUNC_VIS void swap(exception_ptr&, exception_ptr&) _NOEXCEPT;
-
-_LIBCPP_FUNC_VIS exception_ptr __copy_exception_ptr(void *__except, const void* __ptr);
-_LIBCPP_FUNC_VIS exception_ptr current_exception() _NOEXCEPT;
-_LIBCPP_NORETURN _LIBCPP_FUNC_VIS void rethrow_exception(exception_ptr p);
-
-// This is a built-in template function which automagically extracts the required
-// information.
-template <class _E> void *__GetExceptionInfo(_E);
-
-template<class _Ep>
-exception_ptr
-make_exception_ptr(_Ep __e) _NOEXCEPT
-{
-  return __copy_exception_ptr(_VSTD::addressof(__e), __GetExceptionInfo(__e));
-}
-
-#endif // _LIBCPP_ABI_MICROSOFT
 // nested_exception
 
 class _LIBCPP_EXCEPTION_ABI nested_exception
@@ -253,54 +202,46 @@
     _LIBCPP_INLINE_VISIBILITY explicit __nested(const _Tp& __t) : _Tp(__t) {}
 };
 
+template <class _Tp>
+_LIBCPP_NORETURN
+void
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+throw_with_nested(_Tp&& __t, typename enable_if<
+                  is_class<typename remove_reference<_Tp>::type>::value &&
+                  !is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
+                  && !__libcpp_is_final<typename remove_reference<_Tp>::type>::value
+                                    >::type* = 0)
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+throw_with_nested (_Tp& __t, typename enable_if<
+                  is_class<_Tp>::value && !is_base_of<nested_exception, _Tp>::value
+                                    >::type* = 0)
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+{
 #ifndef _LIBCPP_NO_EXCEPTIONS
-template <class _Tp, class _Up, bool>
-struct __throw_with_nested;
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, true> {
-    _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void
-#ifndef _LIBCPP_CXX03_LANG
-    __do_throw(_Tp&& __t)
+    throw __nested<typename remove_reference<_Tp>::type>(_VSTD::forward<_Tp>(__t));
 #else
-    __do_throw (_Tp& __t)
-#endif  // _LIBCPP_CXX03_LANG
-    {
-        throw __nested<_Up>(_VSTD::forward<_Tp>(__t));
-    }
-};
-
-template <class _Tp, class _Up>
-struct __throw_with_nested<_Tp, _Up, false> {
-    _LIBCPP_NORETURN static inline _LIBCPP_ALWAYS_INLINE void
-#ifndef _LIBCPP_CXX03_LANG
-    __do_throw(_Tp&& __t)
-#else
-    __do_throw (_Tp& __t)
-#endif  // _LIBCPP_CXX03_LANG
-    {
-        throw _VSTD::forward<_Tp>(__t);
-    }
-};
+    ((void)__t);
+    // FIXME: Make this abort.
 #endif
+}
 
 template <class _Tp>
 _LIBCPP_NORETURN
 void
-#ifndef _LIBCPP_CXX03_LANG
-throw_with_nested(_Tp&& __t)
-#else
-throw_with_nested (_Tp& __t)
-#endif // _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+throw_with_nested(_Tp&& __t, typename enable_if<
+                  !is_class<typename remove_reference<_Tp>::type>::value ||
+                  is_base_of<nested_exception, typename remove_reference<_Tp>::type>::value
+                  || __libcpp_is_final<typename remove_reference<_Tp>::type>::value
+                                    >::type* = 0)
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+throw_with_nested (_Tp& __t, typename enable_if<
+                  !is_class<_Tp>::value || is_base_of<nested_exception, _Tp>::value
+                                    >::type* = 0)
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
-    typedef typename decay<_Tp>::type _Up;
-    static_assert( is_copy_constructible<_Up>::value, "type thrown must be CopyConstructible");
-    __throw_with_nested<_Tp, _Up,
-        is_class<_Up>::value &&
-        !is_base_of<nested_exception, _Up>::value &&
-        !__libcpp_is_final<_Up>::value>::
-            __do_throw(_VSTD::forward<_Tp>(__t));
+    throw _VSTD::forward<_Tp>(__t);
 #else
     ((void)__t);
     // FIXME: Make this abort
diff --git a/include/experimental/__config b/include/experimental/__config
index 37f88c1..9a7bbe8 100644
--- a/include/experimental/__config
+++ b/include/experimental/__config
@@ -44,13 +44,6 @@
 #define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_FILESYSTEM \
     } } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
 
-#define _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES \
-  _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL inline namespace coroutines_v1 {
-
-#define _LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES \
-  } _LIBCPP_END_NAMESPACE_EXPERIMENTAL
-
-#define _VSTD_CORO _VSTD_EXPERIMENTAL::coroutines_v1
 
 #define _VSTD_FS ::std::experimental::filesystem::v1
 
diff --git a/include/experimental/algorithm b/include/experimental/algorithm
index 3801cae..b32d7ca 100644
--- a/include/experimental/algorithm
+++ b/include/experimental/algorithm
@@ -39,18 +39,17 @@
 #include <algorithm>
 #include <type_traits>
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
+
 template <class _ForwardIterator, class _Searcher>
 _LIBCPP_INLINE_VISIBILITY
 _ForwardIterator search(_ForwardIterator __f, _ForwardIterator __l, const _Searcher &__s)
@@ -68,6 +67,4 @@
 
 _LIBCPP_END_NAMESPACE_LFTS
 
-_LIBCPP_POP_MACROS
-
 #endif /* _LIBCPP_EXPERIMENTAL_ALGORITHM */
diff --git a/include/experimental/coroutine b/include/experimental/coroutine
deleted file mode 100644
index 21c1ea5..0000000
--- a/include/experimental/coroutine
+++ /dev/null
@@ -1,294 +0,0 @@
-// -*- C++ -*-
-//===----------------------------- coroutine -----------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_EXPERIMENTAL_COROUTINE
-#define _LIBCPP_EXPERIMENTAL_COROUTINE
-
-/**
-    experimental/coroutine synopsis
-
-// C++next
-
-namespace std {
-namespace experimental {
-inline namespace coroutines_v1 {
-
-  // 18.11.1 coroutine traits
-template <typename R, typename... ArgTypes>
-class coroutine_traits;
-// 18.11.2 coroutine handle
-template <typename Promise = void>
-class coroutine_handle;
-// 18.11.2.7 comparison operators:
-bool operator==(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator!=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator<(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator<=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator>=(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-bool operator>(coroutine_handle<> x, coroutine_handle<> y) _NOEXCEPT;
-// 18.11.3 trivial awaitables
-struct suspend_never;
-struct suspend_always;
-// 18.11.2.8 hash support:
-template <class T> struct hash;
-template <class P> struct hash<coroutine_handle<P>>;
-
-} // namespace coroutines_v1
-} // namespace experimental
-} // namespace std
-
- */
-
-#include <experimental/__config>
-#include <new>
-#include <type_traits>
-#include <functional>
-#include <memory> // for hash<T*>
-#include <cstddef>
-#include <cassert>
-#include <__debug>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
-#ifdef _LIBCPP_HAS_NO_COROUTINES
-# if defined(_LIBCPP_WARNING)
-    _LIBCPP_WARNING("<experimental/coroutine> cannot be used with this compiler")
-# else
-#   warning <experimental/coroutine> cannot be used with this compiler
-# endif
-#endif
-
-#ifndef _LIBCPP_HAS_NO_COROUTINES
-
-_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_COROUTINES
-
-template <class _Tp, class = void>
-struct __coroutine_traits_sfinae {};
-
-template <class _Tp>
-struct __coroutine_traits_sfinae<
-    _Tp, typename __void_t<typename _Tp::promise_type>::type>
-{
-  using promise_type = typename _Tp::promise_type;
-};
-
-template <typename _Ret, typename... _Args>
-struct _LIBCPP_TEMPLATE_VIS coroutine_traits
-    : public __coroutine_traits_sfinae<_Ret>
-{
-};
-
-template <typename _Promise = void>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle;
-
-template <>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle<void> {
-public:
-    _LIBCPP_ALWAYS_INLINE
-    _LIBCPP_CONSTEXPR coroutine_handle() _NOEXCEPT : __handle_(nullptr) {}
-
-    _LIBCPP_ALWAYS_INLINE
-    _LIBCPP_CONSTEXPR coroutine_handle(nullptr_t) _NOEXCEPT : __handle_(nullptr) {}
-
-    _LIBCPP_ALWAYS_INLINE
-    coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
-        __handle_ = nullptr;
-        return *this;
-    }
-
-    _LIBCPP_ALWAYS_INLINE
-    _LIBCPP_CONSTEXPR void* address() const _NOEXCEPT { return __handle_; }
-
-    _LIBCPP_ALWAYS_INLINE
-    _LIBCPP_CONSTEXPR explicit operator bool() const _NOEXCEPT { return __handle_; }
-
-    _LIBCPP_ALWAYS_INLINE
-    void operator()() { resume(); }
-
-    _LIBCPP_ALWAYS_INLINE
-    void resume() {
-      _LIBCPP_ASSERT(__is_suspended(),
-                     "resume() can only be called on suspended coroutines");
-      _LIBCPP_ASSERT(!done(),
-                "resume() has undefined behavior when the coroutine is done");
-      __builtin_coro_resume(__handle_);
-    }
-
-    _LIBCPP_ALWAYS_INLINE
-    void destroy() {
-      _LIBCPP_ASSERT(__is_suspended(),
-                     "destroy() can only be called on suspended coroutines");
-      __builtin_coro_destroy(__handle_);
-    }
-
-    _LIBCPP_ALWAYS_INLINE
-    bool done() const {
-      _LIBCPP_ASSERT(__is_suspended(),
-                     "done() can only be called on suspended coroutines");
-      return __builtin_coro_done(__handle_);
-    }
-
-public:
-    _LIBCPP_ALWAYS_INLINE
-    static coroutine_handle from_address(void* __addr) _NOEXCEPT {
-        coroutine_handle __tmp;
-        __tmp.__handle_ = __addr;
-        return __tmp;
-    }
-
-    // FIXME: Should from_address(nullptr) be allowed?
-    _LIBCPP_ALWAYS_INLINE
-    static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
-      return coroutine_handle(nullptr);
-    }
-
-    template <class _Tp, bool _CallIsValid = false>
-    static coroutine_handle from_address(_Tp*) {
-      static_assert(_CallIsValid,
-       "coroutine_handle<void>::from_address cannot be called with "
-        "non-void pointers");
-    }
-
-private:
-  bool __is_suspended() const _NOEXCEPT  {
-    // FIXME actually implement a check for if the coro is suspended.
-    return __handle_;
-  }
-
-  template <class _PromiseT> friend class coroutine_handle;
-  void* __handle_;
-};
-
-// 18.11.2.7 comparison operators:
-inline _LIBCPP_ALWAYS_INLINE
-bool operator==(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return __x.address() == __y.address();
-}
-inline _LIBCPP_ALWAYS_INLINE
-bool operator!=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return !(__x == __y);
-}
-inline _LIBCPP_ALWAYS_INLINE
-bool operator<(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return less<void*>()(__x.address(), __y.address());
-}
-inline _LIBCPP_ALWAYS_INLINE
-bool operator>(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return __y < __x;
-}
-inline _LIBCPP_ALWAYS_INLINE
-bool operator<=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return !(__x > __y);
-}
-inline _LIBCPP_ALWAYS_INLINE
-bool operator>=(coroutine_handle<> __x, coroutine_handle<> __y) _NOEXCEPT {
-    return !(__x < __y);
-}
-
-template <typename _Promise>
-class _LIBCPP_TEMPLATE_VIS coroutine_handle : public coroutine_handle<> {
-    using _Base = coroutine_handle<>;
-public:
-#ifndef _LIBCPP_CXX03_LANG
-    // 18.11.2.1 construct/reset
-    using coroutine_handle<>::coroutine_handle;
-#else
-    _LIBCPP_ALWAYS_INLINE coroutine_handle() _NOEXCEPT : _Base() {}
-    _LIBCPP_ALWAYS_INLINE coroutine_handle(nullptr_t) _NOEXCEPT : _Base(nullptr) {}
-#endif
-    _LIBCPP_INLINE_VISIBILITY
-    coroutine_handle& operator=(nullptr_t) _NOEXCEPT {
-        _Base::operator=(nullptr);
-        return *this;
-    }
-
-    _LIBCPP_INLINE_VISIBILITY
-    _Promise& promise() const {
-        return *reinterpret_cast<_Promise*>(
-            __builtin_coro_promise(this->__handle_, __alignof(_Promise), false));
-    }
-
-public:
-    _LIBCPP_ALWAYS_INLINE
-    static coroutine_handle from_address(void* __addr) _NOEXCEPT {
-        coroutine_handle __tmp;
-        __tmp.__handle_ = __addr;
-        return __tmp;
-    }
-
-    // NOTE: this overload isn't required by the standard but is needed so
-    // the deleted _Promise* overload doesn't make from_address(nullptr)
-    // ambiguous.
-    // FIXME: should from_address work with nullptr?
-    _LIBCPP_ALWAYS_INLINE
-    static coroutine_handle from_address(nullptr_t) _NOEXCEPT {
-      return coroutine_handle(nullptr);
-    }
-
-    template <class _Tp, bool _CallIsValid = false>
-    static coroutine_handle from_address(_Tp*) {
-      static_assert(_CallIsValid,
-       "coroutine_handle<promise_type>::from_address cannot be called with "
-        "non-void pointers");
-    }
-
-    template <bool _CallIsValid = false>
-    static coroutine_handle from_address(_Promise*) {
-      static_assert(_CallIsValid,
-       "coroutine_handle<promise_type>::from_address cannot be used with "
-        "pointers to the coroutine's promise type; use 'from_promise' instead");
-    }
-
-    _LIBCPP_ALWAYS_INLINE
-    static coroutine_handle from_promise(_Promise& __promise) _NOEXCEPT {
-        coroutine_handle __tmp;
-        __tmp.__handle_ = __builtin_coro_promise(_VSTD::addressof(__promise),
-                                                 __alignof(_Promise), true);
-        return __tmp;
-    }
-};
-
-struct _LIBCPP_TYPE_VIS suspend_never {
-  _LIBCPP_ALWAYS_INLINE
-  bool await_ready() const _NOEXCEPT { return true; }
-  _LIBCPP_ALWAYS_INLINE
-  void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
-  _LIBCPP_ALWAYS_INLINE
-  void await_resume() const _NOEXCEPT {}
-};
-
-struct _LIBCPP_TYPE_VIS suspend_always {
-  _LIBCPP_ALWAYS_INLINE
-  bool await_ready() const _NOEXCEPT { return false; }
-  _LIBCPP_ALWAYS_INLINE
-  void await_suspend(coroutine_handle<>) const _NOEXCEPT {}
-  _LIBCPP_ALWAYS_INLINE
-  void await_resume() const _NOEXCEPT {}
-};
-
-_LIBCPP_END_NAMESPACE_EXPERIMENTAL_COROUTINES
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class _Tp>
-struct hash<_VSTD_CORO::coroutine_handle<_Tp> > {
-    using __arg_type = _VSTD_CORO::coroutine_handle<_Tp>;
-    _LIBCPP_INLINE_VISIBILITY
-    size_t operator()(__arg_type const& __v) const _NOEXCEPT
-    {return hash<void*>()(__v.address());}
-};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // !defined(_LIBCPP_HAS_NO_COROUTINES)
-
-#endif /* _LIBCPP_EXPERIMENTAL_COROUTINE */
diff --git a/include/experimental/dynarray b/include/experimental/dynarray
index 1619331..8c97337 100644
--- a/include/experimental/dynarray
+++ b/include/experimental/dynarray
@@ -107,13 +107,10 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 namespace std { namespace experimental { inline namespace __array_extensions_v1 {
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_DYNARRAY dynarray
+struct _LIBCPP_TEMPLATE_VIS dynarray
 {
 public:
     // types:
@@ -298,7 +295,5 @@
 struct _LIBCPP_TEMPLATE_VIS uses_allocator<std::experimental::dynarray<_Tp>, _Alloc> : true_type {};
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // if _LIBCPP_STD_VER > 11 
 #endif  // _LIBCPP_DYNARRAY
diff --git a/include/experimental/filesystem b/include/experimental/filesystem
index 42157ba..cf62ca2 100644
--- a/include/experimental/filesystem
+++ b/include/experimental/filesystem
@@ -1091,13 +1091,10 @@
 {
 public:
     typedef bidirectional_iterator_tag iterator_category;
-
     typedef path                       value_type;
     typedef std::ptrdiff_t             difference_type;
     typedef const path*                pointer;
     typedef const path&                reference;
-
-    typedef void __stashing_iterator_tag; // See reverse_iterator and __is_stashing_iterator
 public:
     _LIBCPP_INLINE_VISIBILITY
     iterator() : __stashed_elem_(), __path_ptr_(nullptr),
diff --git a/include/experimental/functional b/include/experimental/functional
index a136cbb..75fc8e9 100644
--- a/include/experimental/functional
+++ b/include/experimental/functional
@@ -89,22 +89,21 @@
 
 #include <experimental/__config>
 #include <functional>
+
 #include <algorithm>
 #include <type_traits>
 #include <vector>
 #include <array>
 #include <unordered_map>
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
 #if _LIBCPP_STD_VER > 11
@@ -457,6 +456,4 @@
 
 _LIBCPP_END_NAMESPACE_LFTS
 
-_LIBCPP_POP_MACROS
-
 #endif /* _LIBCPP_EXPERIMENTAL_FUNCTIONAL */
diff --git a/include/experimental/memory_resource b/include/experimental/memory_resource
index d101f3e..743f9cb 100644
--- a/include/experimental/memory_resource
+++ b/include/experimental/memory_resource
@@ -82,9 +82,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
 
 // Round __s up to next multiple of __a.
@@ -422,6 +419,4 @@
 
 _LIBCPP_END_NAMESPACE_LFTS_PMR
 
-_LIBCPP_POP_MACROS
-
 #endif /* _LIBCPP_EXPERIMENTAL_MEMORY_RESOURCE */
diff --git a/include/experimental/numeric b/include/experimental/numeric
index d784c08..d1209db 100644
--- a/include/experimental/numeric
+++ b/include/experimental/numeric
@@ -41,9 +41,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 #if _LIBCPP_STD_VER > 11
 
 _LIBCPP_BEGIN_NAMESPACE_LFTS_V2
@@ -69,11 +66,11 @@
 
 
 template<class _Tp>
-_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN
-inline _Tp __gcd(_Tp __m, _Tp __n)
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
+_Tp __gcd(_Tp __m, _Tp __n)
 {
     static_assert((!is_signed<_Tp>::value), "" );
-    return __n == 0 ? __m : _VSTD_LFTS_V2::__gcd<_Tp>(__n, __m % __n);
+    return __n == 0 ? __m : __gcd<_Tp>(__n, __m % __n);
 }
 
 
@@ -87,9 +84,8 @@
     static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
     using _Rp = common_type_t<_Tp,_Up>;
     using _Wp = make_unsigned_t<_Rp>;
-    return static_cast<_Rp>(_VSTD_LFTS_V2::__gcd(
-      static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
-      static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
+    return static_cast<_Rp>(__gcd(static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
+                                  static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
 }
 
 template<class _Tp, class _Up>
@@ -104,7 +100,7 @@
         return 0;
 
     using _Rp = common_type_t<_Tp,_Up>;
-    _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD_LFTS_V2::gcd(__m, __n);
+    _Rp __val1 = __abs<_Rp, _Tp>()(__m) / gcd(__m, __n);
     _Rp __val2 = __abs<_Rp, _Up>()(__n);
     _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
     return __val1 * __val2;
@@ -113,7 +109,4 @@
 _LIBCPP_END_NAMESPACE_LFTS_V2
 
 #endif /* _LIBCPP_STD_VER > 11 */
-
-_LIBCPP_POP_MACROS
-
 #endif /* _LIBCPP_EXPERIMENTAL_NUMERIC */
diff --git a/include/experimental/optional b/include/experimental/optional
index b251748..f32941b 100644
--- a/include/experimental/optional
+++ b/include/experimental/optional
@@ -143,24 +143,9 @@
 #include <experimental/__config>
 #include <functional>
 #include <stdexcept>
-#if _LIBCPP_STD_VER > 11
-#include <initializer_list>
-#include <type_traits>
-#include <new>
-#include <__functional_base>
-#include <__debug>
-#endif
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-#pragma GCC system_header
-#endif
-
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 
 _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS bad_optional_access
+class _LIBCPP_EXCEPTION_ABI bad_optional_access
     : public std::logic_error
 {
 public:
@@ -175,6 +160,17 @@
 
 #if _LIBCPP_STD_VER > 11
 
+#include <initializer_list>
+#include <type_traits>
+#include <new>
+#include <__functional_base>
+#include <__undef_min_max>
+#include <__debug>
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#pragma GCC system_header
+#endif
+
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
 struct in_place_t {};
@@ -527,9 +523,6 @@
     constexpr explicit operator bool() const noexcept {return this->__engaged_;}
 
 	_LIBCPP_NORETURN _LIBCPP_INLINE_VISIBILITY 
-#ifndef _LIBCPP_NO_EXCEPTIONS
-_LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
-#endif
 	constexpr void __throw_bad_optional_access() const
 	{
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -539,7 +532,7 @@
 #endif
 	}
 	
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+    _LIBCPP_INLINE_VISIBILITY
     constexpr value_type const& value() const
     {
         if (!this->__engaged_)
@@ -547,7 +540,7 @@
         return this->__val_;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS
+    _LIBCPP_INLINE_VISIBILITY
     value_type& value()
     {
         if (!this->__engaged_)
@@ -917,6 +910,4 @@
 
 #endif  // _LIBCPP_STD_VER > 11
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_EXPERIMENTAL_OPTIONAL
diff --git a/include/experimental/string_view b/include/experimental/string_view
index da104f9..41c0d34 100644
--- a/include/experimental/string_view
+++ b/include/experimental/string_view
@@ -189,9 +189,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 _LIBCPP_BEGIN_NAMESPACE_LFTS
 
     template<class _CharT, class _Traits = _VSTD::char_traits<_CharT> >
@@ -813,6 +810,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif // _LIBCPP_LFTS_STRING_VIEW
diff --git a/include/ext/hash_map b/include/ext/hash_map
index 998e8f6..fab36a1 100644
--- a/include/ext/hash_map
+++ b/include/ext/hash_map
@@ -207,7 +207,7 @@
 #include <ext/__hash>
 
 #if __DEPRECATED
-#if defined(_LIBCPP_WARNING)
+#if defined(_LIBCPP_MSVC)
     _LIBCPP_WARNING("Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>")
 #else
 #   warning Use of the header <ext/hash_map> is deprecated.  Migrate to <unordered_map>
@@ -331,7 +331,7 @@
           __second_constructed(false)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
         : __na_(__x.__na_),
@@ -340,7 +340,7 @@
         {
             __x.__value_constructed = false;
         }
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
         : __na_(__x.__na_),
@@ -349,7 +349,7 @@
         {
             const_cast<bool&>(__x.__value_constructed) = false;
         }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     void operator()(pointer __p)
diff --git a/include/ext/hash_set b/include/ext/hash_set
index 38f81ed..916ed69 100644
--- a/include/ext/hash_set
+++ b/include/ext/hash_set
@@ -199,7 +199,7 @@
 #include <ext/__hash>
 
 #if __DEPRECATED
-#if defined(_LIBCPP_WARNING)
+#if defined(_LIBCPP_MSVC)
     _LIBCPP_WARNING("Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>")
 #else
 #   warning Use of the header <ext/hash_set> is deprecated.  Migrate to <unordered_set>
diff --git a/include/forward_list b/include/forward_list
index 8bfa9a0..879f2d3c 100644
--- a/include/forward_list
+++ b/include/forward_list
@@ -167,20 +167,19 @@
 */
 
 #include <__config>
+
 #include <initializer_list>
 #include <memory>
 #include <limits>
 #include <iterator>
 #include <algorithm>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _VoidPtr> struct __forward_list_node;
@@ -479,14 +478,14 @@
     __forward_list_base(const allocator_type& __a)
         : __before_begin_(__begin_node(), __node_allocator(__a)) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 public:
     _LIBCPP_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
     _LIBCPP_INLINE_VISIBILITY
     __forward_list_base(__forward_list_base&& __x, const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 private:
     __forward_list_base(const __forward_list_base&);
@@ -540,7 +539,7 @@
         {__alloc() = _VSTD::move(__x.__alloc());}
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 inline
@@ -564,7 +563,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 __forward_list_base<_Tp, _Alloc>::~__forward_list_base()
@@ -657,33 +656,32 @@
                      >::type* = nullptr);
     forward_list(const forward_list& __x);
     forward_list(const forward_list& __x, const allocator_type& __a);
-
-    forward_list& operator=(const forward_list& __x);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     forward_list(forward_list&& __x)
         _NOEXCEPT_(is_nothrow_move_constructible<base>::value)
         : base(_VSTD::move(__x)) {}
     forward_list(forward_list&& __x, const allocator_type& __a);
-
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     forward_list(initializer_list<value_type> __il);
     forward_list(initializer_list<value_type> __il, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+    // ~forward_list() = default;
+
+    forward_list& operator=(const forward_list& __x);
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     forward_list& operator=(forward_list&& __x)
         _NOEXCEPT_(
              __node_traits::propagate_on_container_move_assignment::value &&
              is_nothrow_move_assignable<allocator_type>::value);
-
+#endif
+#ifndef  _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     forward_list& operator=(initializer_list<value_type> __il);
-
-    _LIBCPP_INLINE_VISIBILITY
-    void assign(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
-
-    // ~forward_list() = default;
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template <class _InputIterator>
         typename enable_if
@@ -693,6 +691,10 @@
         >::type
         assign(_InputIterator __f, _InputIterator __l);
     void assign(size_type __n, const value_type& __v);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    void assign(initializer_list<value_type> __il);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -743,26 +745,27 @@
     _LIBCPP_INLINE_VISIBILITY
     const_reference front() const {return base::__before_begin()->__next_->__value_;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 #if _LIBCPP_STD_VER > 14
     template <class... _Args> reference emplace_front(_Args&&... __args);
 #else
     template <class... _Args> void      emplace_front(_Args&&... __args);
 #endif
+#endif
     void push_front(value_type&& __v);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void push_front(const value_type& __v);
 
     void pop_front();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         iterator emplace_after(const_iterator __p, _Args&&... __args);
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
     iterator insert_after(const_iterator __p, value_type&& __v);
-    iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
-        {return insert_after(__p, __il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert_after(const_iterator __p, const value_type& __v);
     iterator insert_after(const_iterator __p, size_type __n, const value_type& __v);
     template <class _InputIterator>
@@ -773,6 +776,10 @@
             iterator
         >::type
         insert_after(const_iterator __p, _InputIterator __f, _InputIterator __l);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    iterator insert_after(const_iterator __p, initializer_list<value_type> __il)
+        {return insert_after(__p, __il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     iterator erase_after(const_iterator __p);
     iterator erase_after(const_iterator __f, const_iterator __l);
@@ -792,7 +799,7 @@
     _LIBCPP_INLINE_VISIBILITY
     void clear() _NOEXCEPT {base::clear();}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void splice_after(const_iterator __p, forward_list&& __x);
     _LIBCPP_INLINE_VISIBILITY
@@ -800,7 +807,7 @@
     _LIBCPP_INLINE_VISIBILITY
     void splice_after(const_iterator __p, forward_list&& __x,
                       const_iterator __f, const_iterator __l);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void splice_after(const_iterator __p, forward_list& __x);
     void splice_after(const_iterator __p, forward_list& __x, const_iterator __i);
     void splice_after(const_iterator __p, forward_list& __x,
@@ -810,14 +817,14 @@
     _LIBCPP_INLINE_VISIBILITY
     void unique() {unique(__equal_to<value_type>());}
     template <class _BinaryPredicate> void unique(_BinaryPredicate __binary_pred);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void merge(forward_list&& __x) {merge(__x, __less<value_type>());}
     template <class _Compare>
         _LIBCPP_INLINE_VISIBILITY
         void merge(forward_list&& __x, _Compare __comp)
         {merge(__x, _VSTD::move(__comp));}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void merge(forward_list& __x) {merge(__x, __less<value_type>());}
     template <class _Compare> void merge(forward_list& __x, _Compare __comp);
@@ -828,11 +835,11 @@
 
 private:
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void __move_assign(forward_list& __x, true_type)
         _NOEXCEPT_(is_nothrow_move_assignable<allocator_type>::value);
     void __move_assign(forward_list& __x, false_type);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     template <class _Compare>
         static
@@ -948,19 +955,8 @@
     insert_after(cbefore_begin(), __x.begin(), __x.end());
 }
 
-template <class _Tp, class _Alloc>
-forward_list<_Tp, _Alloc>&
-forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
-{
-    if (this != &__x)
-    {
-        base::__copy_assign_alloc(__x);
-        assign(__x.begin(), __x.end());
-    }
-    return *this;
-}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-#ifndef _LIBCPP_CXX03_LANG
 template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>::forward_list(forward_list&& __x,
                                         const allocator_type& __a)
@@ -973,6 +969,10 @@
     }
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp, class _Alloc>
 forward_list<_Tp, _Alloc>::forward_list(initializer_list<value_type> __il)
 {
@@ -987,6 +987,22 @@
     insert_after(cbefore_begin(), __il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+template <class _Tp, class _Alloc>
+forward_list<_Tp, _Alloc>&
+forward_list<_Tp, _Alloc>::operator=(const forward_list& __x)
+{
+    if (this != &__x)
+    {
+        base::__copy_assign_alloc(__x);
+        assign(__x.begin(), __x.end());
+    }
+    return *this;
+}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Tp, class _Alloc>
 void
 forward_list<_Tp, _Alloc>::__move_assign(forward_list& __x, true_type)
@@ -1024,6 +1040,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp, class _Alloc>
 inline
 forward_list<_Tp, _Alloc>&
@@ -1033,7 +1053,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Alloc>
 template <class _InputIterator>
@@ -1070,7 +1090,7 @@
         erase_after(__i, __e);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Alloc>
 inline
@@ -1080,6 +1100,11 @@
     assign(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Alloc>
 template <class... _Args>
 #if _LIBCPP_STD_VER > 14
@@ -1101,6 +1126,8 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Alloc>
 void
 forward_list<_Tp, _Alloc>::push_front(value_type&& __v)
@@ -1113,7 +1140,7 @@
     base::__before_begin()->__next_ = __h.release();
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 void
@@ -1138,7 +1165,8 @@
     __node_traits::deallocate(__a, __p, 1);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Tp, class _Alloc>
 template <class... _Args>
@@ -1156,6 +1184,8 @@
     return iterator(__r->__next_);
 }
 
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Alloc>
 typename forward_list<_Tp, _Alloc>::iterator
 forward_list<_Tp, _Alloc>::insert_after(const_iterator __p, value_type&& __v)
@@ -1170,7 +1200,7 @@
     return iterator(__r->__next_);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 typename forward_list<_Tp, _Alloc>::iterator
@@ -1438,7 +1468,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1469,7 +1499,7 @@
     splice_after(__p, __x, __f, __l);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 void
@@ -1720,6 +1750,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_FORWARD_LIST
diff --git a/include/fstream b/include/fstream
index e41a53a..7bcc5d4 100644
--- a/include/fstream
+++ b/include/fstream
@@ -171,14 +171,12 @@
 #include <__locale>
 #include <cstdio>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
@@ -195,13 +193,13 @@
 
     // 27.9.1.2 Constructors/destructor:
     basic_filebuf();
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     basic_filebuf(basic_filebuf&& __rhs);
 #endif
     virtual ~basic_filebuf();
 
     // 27.9.1.3 Assign/swap:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_filebuf& operator=(basic_filebuf&& __rhs);
 #endif
@@ -278,7 +276,7 @@
     setbuf(0, 4096);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_filebuf<_CharT, _Traits>::basic_filebuf(basic_filebuf&& __rhs)
@@ -354,7 +352,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_filebuf<_CharT, _Traits>::~basic_filebuf()
@@ -1019,10 +1017,12 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit basic_ifstream(const string& __s, ios_base::openmode __mode = ios_base::in);
 #endif
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_ifstream(basic_ifstream&& __rhs);
+#endif
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_ifstream& operator=(basic_ifstream&& __rhs);
 #endif
@@ -1071,7 +1071,7 @@
 }
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1092,7 +1092,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1177,10 +1177,12 @@
     explicit basic_ofstream(const char* __s, ios_base::openmode __mode = ios_base::out);
     _LIBCPP_INLINE_VISIBILITY
     explicit basic_ofstream(const string& __s, ios_base::openmode __mode = ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_ofstream(basic_ofstream&& __rhs);
+#endif
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_ofstream& operator=(basic_ofstream&& __rhs);
 #endif
@@ -1229,7 +1231,7 @@
 }
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1250,7 +1252,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1337,10 +1339,12 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit basic_fstream(const string& __s, ios_base::openmode __mode = ios_base::in | ios_base::out);
 #endif
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_fstream(basic_fstream&& __rhs);
+#endif
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_fstream& operator=(basic_fstream&& __rhs);
 #endif
@@ -1389,7 +1393,7 @@
 }
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1410,7 +1414,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 inline
@@ -1478,6 +1482,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_FSTREAM
diff --git a/include/functional b/include/functional
index ea35697..2a810b1 100644
--- a/include/functional
+++ b/include/functional
@@ -235,7 +235,7 @@
 }
 
 template <class Operation>
-class binder1st     // deprecated in C++11, removed in C++17
+class binder1st
     : public unary_function<typename Operation::second_argument_type,
                             typename Operation::result_type>
 {
@@ -249,10 +249,10 @@
 };
 
 template <class Operation, class T>
-binder1st<Operation> bind1st(const Operation& op, const T& x);  // deprecated in C++11, removed in C++17
+binder1st<Operation> bind1st(const Operation& op, const T& x);
 
 template <class Operation>
-class binder2nd     // deprecated in C++11, removed in C++17
+class binder2nd
     : public unary_function<typename Operation::first_argument_type,
                             typename Operation::result_type>
 {
@@ -266,9 +266,9 @@
 };
 
 template <class Operation, class T>
-binder2nd<Operation> bind2nd(const Operation& op, const T& x);  // deprecated in C++11, removed in C++17
+binder2nd<Operation> bind2nd(const Operation& op, const T& x);
 
-template <class Arg, class Result>      // deprecated in C++11, removed in C++17
+template <class Arg, class Result>
 class pointer_to_unary_function : public unary_function<Arg, Result>
 {
 public:
@@ -277,9 +277,9 @@
 };
 
 template <class Arg, class Result>
-pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg));      // deprecated in C++11, removed in C++17
+pointer_to_unary_function<Arg,Result> ptr_fun(Result (*f)(Arg));
 
-template <class Arg1, class Arg2, class Result>      // deprecated in C++11, removed in C++17
+template <class Arg1, class Arg2, class Result>
 class pointer_to_binary_function : public binary_function<Arg1, Arg2, Result>
 {
 public:
@@ -288,9 +288,9 @@
 };
 
 template <class Arg1, class Arg2, class Result>
-pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2));      // deprecated in C++11, removed in C++17
+pointer_to_binary_function<Arg1,Arg2,Result> ptr_fun(Result (*f)(Arg1,Arg2));
 
-template<class S, class T>      // deprecated in C++11, removed in C++17
+template<class S, class T>
 class mem_fun_t : public unary_function<T*, S>
 {
 public:
@@ -299,18 +299,18 @@
 };
 
 template<class S, class T, class A>
-class mem_fun1_t : public binary_function<T*, A, S>      // deprecated in C++11, removed in C++17
+class mem_fun1_t : public binary_function<T*, A, S>
 {
 public:
     explicit mem_fun1_t(S (T::*p)(A));
     S operator()(T* p, A x) const;
 };
 
-template<class S, class T>          mem_fun_t<S,T>    mem_fun(S (T::*f)());      // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A));     // deprecated in C++11, removed in C++17
+template<class S, class T>          mem_fun_t<S,T>    mem_fun(S (T::*f)());
+template<class S, class T, class A> mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A));
 
 template<class S, class T>
-class mem_fun_ref_t : public unary_function<T, S>      // deprecated in C++11, removed in C++17
+class mem_fun_ref_t : public unary_function<T, S>
 {
 public:
     explicit mem_fun_ref_t(S (T::*p)());
@@ -318,18 +318,18 @@
 };
 
 template<class S, class T, class A>
-class mem_fun1_ref_t : public binary_function<T, A, S>      // deprecated in C++11, removed in C++17
+class mem_fun1_ref_t : public binary_function<T, A, S>
 {
 public:
     explicit mem_fun1_ref_t(S (T::*p)(A));
     S operator()(T& p, A x) const;
 };
 
-template<class S, class T>          mem_fun_ref_t<S,T>    mem_fun_ref(S (T::*f)());      // deprecated in C++11, removed in C++17
-template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A));     // deprecated in C++11, removed in C++17
+template<class S, class T>          mem_fun_ref_t<S,T>    mem_fun_ref(S (T::*f)());
+template<class S, class T, class A> mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A));
 
 template <class S, class T>
-class const_mem_fun_t : public unary_function<const T*, S>      // deprecated in C++11, removed in C++17
+class const_mem_fun_t : public unary_function<const T*, S>
 {
 public:
     explicit const_mem_fun_t(S (T::*p)() const);
@@ -337,18 +337,18 @@
 };
 
 template <class S, class T, class A>
-class const_mem_fun1_t : public binary_function<const T*, A, S>      // deprecated in C++11, removed in C++17
+class const_mem_fun1_t : public binary_function<const T*, A, S>
 {
 public:
     explicit const_mem_fun1_t(S (T::*p)(A) const);
     S operator()(const T* p, A x) const;
 };
 
-template <class S, class T>          const_mem_fun_t<S,T>    mem_fun(S (T::*f)() const);      // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const);     // deprecated in C++11, removed in C++17
+template <class S, class T>          const_mem_fun_t<S,T>    mem_fun(S (T::*f)() const);
+template <class S, class T, class A> const_mem_fun1_t<S,T,A> mem_fun(S (T::*f)(A) const);
 
 template <class S, class T>
-class const_mem_fun_ref_t : public unary_function<T, S>      // deprecated in C++11, removed in C++17
+class const_mem_fun_ref_t : public unary_function<T, S>
 {
 public:
     explicit const_mem_fun_ref_t(S (T::*p)() const);
@@ -356,15 +356,15 @@
 };
 
 template <class S, class T, class A>
-class const_mem_fun1_ref_t : public binary_function<T, A, S>      // deprecated in C++11, removed in C++17
+class const_mem_fun1_ref_t : public binary_function<T, A, S>
 {
 public:
     explicit const_mem_fun1_ref_t(S (T::*p)(A) const);
     S operator()(const T& p, A x) const;
 };
 
-template <class S, class T>          const_mem_fun_ref_t<S,T>    mem_fun_ref(S (T::*f)() const);   // deprecated in C++11, removed in C++17
-template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const);  // deprecated in C++11, removed in C++17
+template <class S, class T>          const_mem_fun_ref_t<S,T>    mem_fun_ref(S (T::*f)() const);
+template <class S, class T, class A> const_mem_fun1_ref_t<S,T,A> mem_fun_ref(S (T::*f)(A) const);
 
 template<class R, class T> unspecified mem_fn(R T::*);
 
@@ -470,7 +470,6 @@
 template <> struct hash<long double>;
 
 template<class T> struct hash<T*>;
-template <> struct hash<nullptr_t>;  // C++17
 
 }  // std
 
@@ -1020,7 +1019,6 @@
 binary_negate<_Predicate>
 not2(const _Predicate& __pred) {return binary_negate<_Predicate>(__pred);}
 
-#if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_BINDERS)
 template <class __Operation>
 class _LIBCPP_TEMPLATE_VIS binder1st
     : public unary_function<typename __Operation::second_argument_type,
@@ -1245,7 +1243,6 @@
 const_mem_fun1_ref_t<_Sp,_Tp,_Ap>
 mem_fun_ref(_Sp (_Tp::*__f)(_Ap) const)
     {return const_mem_fun1_ref_t<_Sp,_Tp,_Ap>(__f);}
-#endif
 
 ////////////////////////////////////////////////////////////////////////////////
 //                                MEMFUN
@@ -1264,7 +1261,7 @@
 public:
     _LIBCPP_INLINE_VISIBILITY __mem_fn(type __f) _NOEXCEPT : __f_(__f) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     // invoke
     template <class... _ArgTypes>
     _LIBCPP_INLINE_VISIBILITY
@@ -1391,12 +1388,6 @@
 class _LIBCPP_EXCEPTION_ABI bad_function_call
     : public exception
 {
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-public:
-    virtual ~bad_function_call() _NOEXCEPT;
-
-    virtual const char* what() const _NOEXCEPT;
-#endif
 };
 
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
@@ -1454,7 +1445,7 @@
 
 } // namespace __function
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 namespace __function {
 
@@ -1983,7 +1974,7 @@
 swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
 {return __x.swap(__y);}
 
-#else // _LIBCPP_CXX03_LANG
+#else // _LIBCPP_HAS_NO_VARIADICS
 
 #include <__functional_03>
 
@@ -2047,7 +2038,7 @@
     : public integral_constant<int, _Np> {};
 
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Tp, class _Uj>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -2224,7 +2215,7 @@
 __apply_functor(_Fp& __f, _BoundArgs& __bound_args, __tuple_indices<_Indx...>,
                 _Args&& __args)
 {
-    return _VSTD::__invoke(__f, _VSTD::__mu(_VSTD::get<_Indx>(__bound_args), __args)...);
+    return __invoke(__f, __mu(_VSTD::get<_Indx>(__bound_args), __args)...);
 }
 
 template<class _Fp, class ..._BoundArgs>
@@ -2257,7 +2248,7 @@
         typename __bind_return<_Fd, _Td, tuple<_Args&&...> >::type
         operator()(_Args&& ...__args)
         {
-            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+            return __apply_functor(__f_, __bound_args_, __indices(),
                                   tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 
@@ -2266,7 +2257,7 @@
         typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
         operator()(_Args&& ...__args) const
         {
-            return _VSTD::__apply_functor(__f_, __bound_args_, __indices(),
+            return __apply_functor(__f_, __bound_args_, __indices(),
                                    tuple<_Args&&...>(_VSTD::forward<_Args>(__args)...));
         }
 };
@@ -2347,7 +2338,7 @@
     return type(_VSTD::forward<_Fp>(__f), _VSTD::forward<_BoundArgs>(__bound_args)...);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 #if _LIBCPP_STD_VER > 14
 
diff --git a/include/future b/include/future
index e388767..1ceedf9 100644
--- a/include/future
+++ b/include/future
@@ -499,7 +499,7 @@
     return error_condition(static_cast<int>(__e), future_category());
 }
 
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_FUTURE_ERROR future_error
+class _LIBCPP_EXCEPTION_ABI future_error
     : public logic_error
 {
     error_code __ec_;
@@ -515,9 +515,6 @@
 };
 
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
-#ifndef _LIBCPP_NO_EXCEPTIONS
-_LIBCPP_AVAILABILITY_FUTURE_ERROR
-#endif
 void __throw_future_error(future_errc _Ev)
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
@@ -528,7 +525,7 @@
 #endif
 }
 
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state
+class _LIBCPP_TYPE_VIS __assoc_sub_state
     : public __shared_count
 {
 protected:
@@ -615,7 +612,7 @@
 }
 
 template <class _Rp>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state
+class __assoc_state
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -655,7 +652,6 @@
 
 template <class _Rp>
 template <class _Arg>
-_LIBCPP_AVAILABILITY_FUTURE
 void
 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 __assoc_state<_Rp>::set_value(_Arg&& __arg)
@@ -711,7 +707,7 @@
 }
 
 template <class _Rp>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state<_Rp&>
+class __assoc_state<_Rp&>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -771,7 +767,7 @@
 }
 
 template <class _Rp, class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc
+class __assoc_state_alloc
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -799,7 +795,7 @@
 }
 
 template <class _Rp, class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_state_alloc<_Rp&, _Alloc>
+class __assoc_state_alloc<_Rp&, _Alloc>
     : public __assoc_state<_Rp&>
 {
     typedef __assoc_state<_Rp&> base;
@@ -825,7 +821,7 @@
 }
 
 template <class _Alloc>
-class _LIBCPP_AVAILABILITY_FUTURE __assoc_sub_state_alloc
+class __assoc_sub_state_alloc
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -851,7 +847,7 @@
 }
 
 template <class _Rp, class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state
+class __deferred_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -898,7 +894,7 @@
 }
 
 template <class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __deferred_assoc_state<void, _Fp>
+class __deferred_assoc_state<void, _Fp>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -946,7 +942,7 @@
 }
 
 template <class _Rp, class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state
+class __async_assoc_state
     : public __assoc_state<_Rp>
 {
     typedef __assoc_state<_Rp> base;
@@ -1001,7 +997,7 @@
 }
 
 template <class _Fp>
-class _LIBCPP_AVAILABILITY_FUTURE __async_assoc_state<void, _Fp>
+class __async_assoc_state<void, _Fp>
     : public __assoc_sub_state
 {
     typedef __assoc_sub_state base;
@@ -1080,7 +1076,7 @@
 #endif
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future
+class _LIBCPP_TEMPLATE_VIS future
 {
     __assoc_state<_Rp>* __state_;
 
@@ -1183,7 +1179,7 @@
 }
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE future<_Rp&>
+class _LIBCPP_TEMPLATE_VIS future<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
@@ -1281,7 +1277,7 @@
 }
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE future<void>
+class _LIBCPP_TYPE_VIS future<void>
 {
     __assoc_sub_state* __state_;
 
@@ -1364,7 +1360,7 @@
 template <class _Callable> class packaged_task;
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise
+class _LIBCPP_TEMPLATE_VIS promise
 {
     __assoc_state<_Rp>* __state_;
 
@@ -1531,7 +1527,7 @@
 // promise<R&>
 
 template <class _Rp>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<_Rp&>
+class _LIBCPP_TEMPLATE_VIS promise<_Rp&>
 {
     __assoc_state<_Rp&>* __state_;
 
@@ -1667,7 +1663,7 @@
 // promise<void>
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE promise<void>
+class _LIBCPP_TYPE_VIS promise<void>
 {
     __assoc_sub_state* __state_;
 
@@ -1753,7 +1749,7 @@
 template<class _Fp> class __packaged_task_base;
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_base<_Rp(_ArgTypes...)>
+class __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __packaged_task_base(const __packaged_task_base&);
     __packaged_task_base& operator=(const __packaged_task_base&);
@@ -1771,7 +1767,7 @@
 template<class _FD, class _Alloc, class _FB> class __packaged_task_func;
 
 template<class _Fp, class _Alloc, class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
+class __packaged_task_func<_Fp, _Alloc, _Rp(_ArgTypes...)>
     : public  __packaged_task_base<_Rp(_ArgTypes...)>
 {
     __compressed_pair<_Fp, _Alloc> __f_;
@@ -1829,7 +1825,7 @@
 template <class _Callable> class __packaged_task_function;
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_AVAILABILITY_FUTURE __packaged_task_function<_Rp(_ArgTypes...)>
+class __packaged_task_function<_Rp(_ArgTypes...)>
 {
     typedef __packaged_task_base<_Rp(_ArgTypes...)> __base;
     typename aligned_storage<3*sizeof(void*)>::type __buf_;
@@ -2004,7 +2000,7 @@
 }
 
 template<class _Rp, class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<_Rp(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS packaged_task<_Rp(_ArgTypes...)>
 {
 public:
     typedef _Rp result_type; // extension
@@ -2133,7 +2129,7 @@
 }
 
 template<class ..._ArgTypes>
-class _LIBCPP_TEMPLATE_VIS _LIBCPP_AVAILABILITY_FUTURE packaged_task<void(_ArgTypes...)>
+class _LIBCPP_TEMPLATE_VIS packaged_task<void(_ArgTypes...)>
 {
 public:
     typedef void result_type; // extension
@@ -2521,7 +2517,7 @@
 }
 
 template <>
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_FUTURE shared_future<void>
+class _LIBCPP_TYPE_VIS shared_future<void>
 {
     __assoc_sub_state* __state_;
 
diff --git a/include/initializer_list b/include/initializer_list
index 8c234aa..d6dfa80 100644
--- a/include/initializer_list
+++ b/include/initializer_list
@@ -53,7 +53,7 @@
 namespace std  // purposefully not versioned
 {
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _Ep>
 class _LIBCPP_TEMPLATE_VIS initializer_list
@@ -111,7 +111,7 @@
     return __il.end();
 }
 
-#endif  // !defined(_LIBCPP_CXX03_LANG)
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 }  // std
 
diff --git a/include/ios b/include/ios
index 61d00b9..49f0c01 100644
--- a/include/ios
+++ b/include/ios
@@ -657,7 +657,7 @@
 
     _LIBCPP_INLINE_VISIBILITY 
     void move(basic_ios& __rhs);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_ALWAYS_INLINE
     void move(basic_ios&& __rhs) {move(__rhs);}
 #endif
diff --git a/include/istream b/include/istream
index 0b8e05d..774f38d 100644
--- a/include/istream
+++ b/include/istream
@@ -162,14 +162,12 @@
 #include <__config>
 #include <ostream>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
@@ -191,11 +189,12 @@
     { this->init(__sb); }
     virtual ~basic_istream();
 protected:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_istream(basic_istream&& __rhs);
-
+#endif
     // 27.7.1.1.2 Assign/swap:
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_istream& operator=(basic_istream&& __rhs);
 #endif
@@ -333,7 +332,7 @@
         __is.setstate(ios_base::failbit);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>::basic_istream(basic_istream&& __rhs)
@@ -351,7 +350,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_istream<_CharT, _Traits>::~basic_istream()
@@ -1425,7 +1424,7 @@
     return __is;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1436,7 +1435,7 @@
     return __is;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 class _LIBCPP_TEMPLATE_VIS basic_iostream
@@ -1459,11 +1458,13 @@
 
     virtual ~basic_iostream();
 protected:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_iostream(basic_iostream&& __rhs);
+#endif
 
     // assign/swap
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_iostream& operator=(basic_iostream&& __rhs);
 #endif
@@ -1473,7 +1474,7 @@
 public:
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_iostream<_CharT, _Traits>::basic_iostream(basic_iostream&& __rhs)
@@ -1489,7 +1490,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_iostream<_CharT, _Traits>::~basic_iostream()
@@ -1606,7 +1607,7 @@
     return getline(__is, __str, __is.widen('\n'));
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1626,7 +1627,7 @@
     return getline(__is, __str, __is.widen('\n'));
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, size_t _Size>
 basic_istream<_CharT, _Traits>&
@@ -1677,14 +1678,10 @@
     return __is;
 }
 
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream<wchar_t>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream<char>)
-#endif
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_ISTREAM
diff --git a/include/iterator b/include/iterator
index d163ab1..b8f6570 100644
--- a/include/iterator
+++ b/include/iterator
@@ -64,23 +64,14 @@
 struct bidirectional_iterator_tag : public forward_iterator_tag       {};
 struct random_access_iterator_tag : public bidirectional_iterator_tag {};
 
-// 27.4.3, iterator operations
 // extension: second argument not conforming to C++03
-template <class InputIterator>  // constexpr in C++17
-  constexpr void advance(InputIterator& i,
+template <class InputIterator>
+void advance(InputIterator& i,
              typename iterator_traits<InputIterator>::difference_type n);
 
-template <class InputIterator>  // constexpr in C++17
-  constexpr typename iterator_traits<InputIterator>::difference_type
-    distance(InputIterator first, InputIterator last);
-
-template <class InputIterator>  // constexpr in C++17
-  constexpr InputIterator next(InputIterator x,
-typename iterator_traits<InputIterator>::difference_type n = 1);
-
-template <class BidirectionalIterator>  // constexpr in C++17
-  constexpr BidirectionalIterator prev(BidirectionalIterator x,
-    typename iterator_traits<BidirectionalIterator>::difference_type n = 1);    
+template <class InputIterator>
+typename iterator_traits<InputIterator>::difference_type
+distance(InputIterator first, InputIterator last);
 
 template <class Iterator>
 class reverse_iterator
@@ -538,7 +529,7 @@
 };
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 void __advance(_InputIter& __i,
              typename iterator_traits<_InputIter>::difference_type __n, input_iterator_tag)
 {
@@ -547,7 +538,7 @@
 }
 
 template <class _BiDirIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 void __advance(_BiDirIter& __i,
              typename iterator_traits<_BiDirIter>::difference_type __n, bidirectional_iterator_tag)
 {
@@ -560,7 +551,7 @@
 }
 
 template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 void __advance(_RandIter& __i,
              typename iterator_traits<_RandIter>::difference_type __n, random_access_iterator_tag)
 {
@@ -568,7 +559,7 @@
 }
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 void advance(_InputIter& __i,
              typename iterator_traits<_InputIter>::difference_type __n)
 {
@@ -576,7 +567,7 @@
 }
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 typename iterator_traits<_InputIter>::difference_type
 __distance(_InputIter __first, _InputIter __last, input_iterator_tag)
 {
@@ -587,7 +578,7 @@
 }
 
 template <class _RandIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 typename iterator_traits<_RandIter>::difference_type
 __distance(_RandIter __first, _RandIter __last, random_access_iterator_tag)
 {
@@ -595,7 +586,7 @@
 }
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 typename iterator_traits<_InputIter>::difference_type
 distance(_InputIter __first, _InputIter __last)
 {
@@ -603,7 +594,7 @@
 }
 
 template <class _InputIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 _InputIter
 next(_InputIter __x,
      typename iterator_traits<_InputIter>::difference_type __n = 1,
@@ -614,7 +605,7 @@
 }
 
 template <class _BidiretionalIter>
-inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
+inline _LIBCPP_INLINE_VISIBILITY
 _BidiretionalIter
 prev(_BidiretionalIter __x,
      typename iterator_traits<_BidiretionalIter>::difference_type __n = 1,
@@ -624,14 +615,6 @@
     return __x;
 }
 
-
-template <class _Tp, class = void>
-struct __is_stashing_iterator : false_type {};
-
-template <class _Tp>
-struct __is_stashing_iterator<_Tp, typename __void_t<typename _Tp::__stashing_iterator_tag>::type>
-  : true_type {};
-
 template <class _Iter>
 class _LIBCPP_TEMPLATE_VIS reverse_iterator
     : public iterator<typename iterator_traits<_Iter>::iterator_category,
@@ -642,11 +625,6 @@
 {
 private:
     /*mutable*/ _Iter __t;  // no longer used as of LWG #2360, not removed due to ABI break
-
-    static_assert(!__is_stashing_iterator<_Iter>::value,
-      "The specified iterator type cannot be used with reverse_iterator; "
-      "Using stashing iterators with reverse_iterator causes undefined behavior");
-
 protected:
     _Iter current;
 public:
@@ -792,10 +770,10 @@
     _LIBCPP_INLINE_VISIBILITY explicit back_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(const typename _Container::value_type& __value_)
         {container->push_back(__value_); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator=(typename _Container::value_type&& __value_)
         {container->push_back(_VSTD::move(__value_)); return *this;}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator*()     {return *this;}
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator& operator++()    {return *this;}
     _LIBCPP_INLINE_VISIBILITY back_insert_iterator  operator++(int) {return *this;}
@@ -825,10 +803,10 @@
     _LIBCPP_INLINE_VISIBILITY explicit front_insert_iterator(_Container& __x) : container(_VSTD::addressof(__x)) {}
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(const typename _Container::value_type& __value_)
         {container->push_front(__value_); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator=(typename _Container::value_type&& __value_)
         {container->push_front(_VSTD::move(__value_)); return *this;}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator*()     {return *this;}
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator& operator++()    {return *this;}
     _LIBCPP_INLINE_VISIBILITY front_insert_iterator  operator++(int) {return *this;}
@@ -860,10 +838,10 @@
         : container(_VSTD::addressof(__x)), iter(__i) {}
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(const typename _Container::value_type& __value_)
         {iter = container->insert(iter, __value_); ++iter; return *this;}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator=(typename _Container::value_type&& __value_)
         {iter = container->insert(iter, _VSTD::move(__value_)); ++iter; return *this;}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator*()        {return *this;}
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++()       {return *this;}
     _LIBCPP_INLINE_VISIBILITY insert_iterator& operator++(int)    {return *this;}
@@ -990,6 +968,7 @@
 
     _LIBCPP_INLINE_VISIBILITY char_type  operator*() const
         {return static_cast<char_type>(__sbuf_->sgetc());}
+    _LIBCPP_INLINE_VISIBILITY char_type* operator->() const {return nullptr;}
     _LIBCPP_INLINE_VISIBILITY istreambuf_iterator& operator++()
         {
             __sbuf_->sbumpc();
@@ -1068,7 +1047,7 @@
     typedef typename iterator_traits<iterator_type>::value_type value_type;
     typedef typename iterator_traits<iterator_type>::difference_type difference_type;
     typedef iterator_type pointer;
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     typedef typename iterator_traits<iterator_type>::reference __reference;
     typedef typename conditional<
             is_reference<__reference>::value,
diff --git a/include/limits b/include/limits
index f530507..b15f8f1 100644
--- a/include/limits
+++ b/include/limits
@@ -101,24 +101,23 @@
 }  // std
 
 */
-#include <__config>
-#include <type_traits>
-
-#if defined(_LIBCPP_COMPILER_MSVC)
-#include "support/win32/limits_msvc_win32.h"
-#endif // _LIBCPP_MSVCRT
-
-#if defined(__IBMCPP__)
-#include "support/ibm/limits.h"
-#endif // __IBMCPP__
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
+#include <__config>
+#include <type_traits>
 
+#include <__undef_min_max>
+
+#if defined(_LIBCPP_MSVCRT)
+#include "support/win32/limits_win32.h"
+#endif // _LIBCPP_MSVCRT
+
+#if defined(__IBMCPP__)
+#include "support/ibm/limits.h"
+#endif // __IBMCPP__
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -183,14 +182,14 @@
     static _LIBCPP_CONSTEXPR const float_round_style round_style = round_toward_zero;
 };
 
-template <class _Tp, int __digits, bool _IsSigned>
+template <class _Tp, int digits, bool _IsSigned>
 struct __libcpp_compute_min
 {
-    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << __digits);
+    static _LIBCPP_CONSTEXPR const _Tp value = _Tp(_Tp(1) << digits);
 };
 
-template <class _Tp, int __digits>
-struct __libcpp_compute_min<_Tp, __digits, false>
+template <class _Tp, int digits>
+struct __libcpp_compute_min<_Tp, digits, false>
 {
     static _LIBCPP_CONSTEXPR const _Tp value = _Tp(0);
 };
@@ -812,6 +811,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_LIMITS
diff --git a/include/list b/include/list
index 20a66c3..fa148db 100644
--- a/include/list
+++ b/include/list
@@ -177,16 +177,14 @@
 #include <algorithm>
 #include <type_traits>
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _Tp, class _VoidPtr> struct __list_node;
@@ -862,10 +860,11 @@
     list(const list& __c, const allocator_type& __a);
     _LIBCPP_INLINE_VISIBILITY
     list& operator=(const list& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     list(initializer_list<value_type> __il);
     list(initializer_list<value_type> __il, const allocator_type& __a);
-
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     list(list&& __c)
         _NOEXCEPT_(is_nothrow_move_constructible<__node_allocator>::value);
@@ -876,20 +875,22 @@
         _NOEXCEPT_(
             __node_alloc_traits::propagate_on_container_move_assignment::value &&
             is_nothrow_move_assignable<__node_allocator>::value);
-
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     list& operator=(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end()); return *this;}
-
-    _LIBCPP_INLINE_VISIBILITY
-    void assign(initializer_list<value_type> __il)
-        {assign(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template <class _InpIter>
         void assign(_InpIter __f, _InpIter __l,
              typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
     void assign(size_type __n, const value_type& __x);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    void assign(initializer_list<value_type> __il)
+        {assign(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT;
@@ -963,10 +964,10 @@
         return base::__end_.__prev_->__as_node()->__value_;
     }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void push_front(value_type&& __x);
     void push_back(value_type&& __x);
-
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
 #if _LIBCPP_STD_VER > 14
        reference emplace_front(_Args&&... __args);
@@ -981,13 +982,9 @@
 #endif
     template <class... _Args>
         iterator emplace(const_iterator __p, _Args&&... __args);
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
     iterator insert(const_iterator __p, value_type&& __x);
-
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, initializer_list<value_type> __il)
-        {return insert(__p, __il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     void push_front(const value_type& __x);
     void push_back(const value_type& __x);
@@ -997,6 +994,11 @@
     template <class _InpIter>
         iterator insert(const_iterator __p, _InpIter __f, _InpIter __l,
              typename enable_if<__is_input_iterator<_InpIter>::value>::type* = 0);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, initializer_list<value_type> __il)
+        {return insert(__p, __il.begin(), __il.end());}
+#endif   // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     void swap(list& __c)
@@ -1020,18 +1022,22 @@
     void resize(size_type __n, const value_type& __x);
 
     void splice(const_iterator __p, list& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c) {splice(__p, __c);}
+#endif
+    void splice(const_iterator __p, list& __c, const_iterator __i);
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c, const_iterator __i)
         {splice(__p, __c, __i);}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void splice(const_iterator __p, list&& __c, const_iterator __f, const_iterator __l)
         {splice(__p, __c, __f, __l);}
-#endif
-    void splice(const_iterator __p, list& __c, const_iterator __i);
-    void splice(const_iterator __p, list& __c, const_iterator __f, const_iterator __l);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     void remove(const value_type& __x);
     template <class _Pred> void remove_if(_Pred __pred);
@@ -1041,17 +1047,17 @@
         void unique(_BinaryPred __binary_pred);
     _LIBCPP_INLINE_VISIBILITY
     void merge(list& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void merge(list&& __c) {merge(__c);}
-
-    template <class _Comp>
-    _LIBCPP_INLINE_VISIBILITY
-        void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
 #endif
     template <class _Comp>
         void merge(list& __c, _Comp __comp);
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    template <class _Comp>
+    _LIBCPP_INLINE_VISIBILITY
+        void merge(list&& __c, _Comp __comp) {merge(__c, __comp);}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void sort();
     template <class _Comp>
@@ -1140,7 +1146,7 @@
     __get_db()->__insert_c(this);
 #endif
     for (; __n > 0; --__n)
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
         emplace_back();
 #else
         push_back(value_type());
@@ -1155,7 +1161,11 @@
     __get_db()->__insert_c(this);
 #endif
     for (; __n > 0; --__n)
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
         emplace_back();
+#else
+        push_back(value_type());
+#endif
 }
 #endif
 
@@ -1229,7 +1239,7 @@
         push_back(*__i);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp, class _Alloc>
 list<_Tp, _Alloc>::list(initializer_list<value_type> __il, const allocator_type& __a)
@@ -1254,6 +1264,23 @@
         push_back(*__i);
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+template <class _Tp, class _Alloc>
+inline
+list<_Tp, _Alloc>&
+list<_Tp, _Alloc>::operator=(const list& __c)
+{
+    if (this != &__c)
+    {
+        base::__copy_assign_alloc(__c);
+        assign(__c.begin(), __c.end());
+    }
+    return *this;
+}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Tp, class _Alloc>
 inline
 list<_Tp, _Alloc>::list(list&& __c)
@@ -1319,20 +1346,7 @@
     splice(end(), __c);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
-
-template <class _Tp, class _Alloc>
-inline
-list<_Tp, _Alloc>&
-list<_Tp, _Alloc>::operator=(const list& __c)
-{
-    if (this != &__c)
-    {
-        base::__copy_assign_alloc(__c);
-        assign(__c.begin(), __c.end());
-    }
-    return *this;
-}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 template <class _InpIter>
@@ -1562,7 +1576,7 @@
     __hold.release();
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 void
@@ -1590,6 +1604,8 @@
     __hold.release();
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Alloc>
 template <class... _Args>
 #if _LIBCPP_STD_VER > 14
@@ -1661,6 +1677,8 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Alloc>
 typename list<_Tp, _Alloc>::iterator
 list<_Tp, _Alloc>::insert(const_iterator __p, value_type&& __x)
@@ -1686,7 +1704,7 @@
 #endif
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Alloc>
 void
@@ -2417,6 +2435,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_LIST
diff --git a/include/locale b/include/locale
index 6aaa22c..138ebf0 100644
--- a/include/locale
+++ b/include/locale
@@ -192,7 +192,14 @@
 #endif
 #include <cstdlib>
 #include <ctime>
-#include <cstdio>
+#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
+#include <support/win32/locale_win32.h>
+#elif defined(_NEWLIB_VERSION)
+// FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an
+// include of <sys/cdefs.h> once https://sourceware.org/ml/newlib-cvs/2014-q3/msg00038.html
+// has had a chance to bake for a bit
+#include <support/newlib/xlocale.h>
+#endif
 #ifdef _LIBCPP_HAS_CATOPEN
 #include <nl_types.h>
 #endif
@@ -201,19 +208,17 @@
 #include <Availability.h>
 #endif
 
-#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
-#include <__bsd_locale_defaults.h>
-#else
-#include <__bsd_locale_fallbacks.h>
-#endif
+#include <__undef_min_max>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
+#ifdef _LIBCPP_LOCALE__L_EXTENSIONS
+#include <__bsd_locale_defaults.h>
+#else
+#include <__bsd_locale_fallbacks.h>
+#endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -228,6 +233,9 @@
 #define __cloc_defined
 #endif
 
+typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
+typedef _VSTD::unique_ptr<__locale_struct, decltype(&freelocale)> __locale_unique_ptr;
+
 // __scan_keyword
 // Scans [__b, __e) until a match is found in the basic_strings range
 //  [__kb, __ke) or until it can be shown that there is no match in [__kb, __ke).
@@ -1394,7 +1402,6 @@
     this->__format_int(__fmt+1, __len, true, __iob.flags());
     const unsigned __nbuf = (numeric_limits<long>::digits / 3)
                           + ((numeric_limits<long>::digits % 3) != 0)
-                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 2;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1421,7 +1428,6 @@
     this->__format_int(__fmt+1, __len, true, __iob.flags());
     const unsigned __nbuf = (numeric_limits<long long>::digits / 3)
                           + ((numeric_limits<long long>::digits % 3) != 0)
-                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 2;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1448,7 +1454,6 @@
     this->__format_int(__fmt+1, __len, false, __iob.flags());
     const unsigned __nbuf = (numeric_limits<unsigned long>::digits / 3)
                           + ((numeric_limits<unsigned long>::digits % 3) != 0)
-                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 1;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1475,7 +1480,6 @@
     this->__format_int(__fmt+1, __len, false, __iob.flags());
     const unsigned __nbuf = (numeric_limits<unsigned long long>::digits / 3)
                           + ((numeric_limits<unsigned long long>::digits % 3) != 0)
-                          + ((__iob.flags() & ios_base::showbase) != 0)
                           + 1;
     char __nar[__nbuf];
     int __nc = __libcpp_snprintf_l(__nar, sizeof(__nar), _LIBCPP_GET_C_LOCALE, __fmt, __v);
@@ -1681,22 +1685,6 @@
     ~__time_get_c_storage() {}
 };
 
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__months() const;
-template <> _LIBCPP_FUNC_VIS const string* __time_get_c_storage<char>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__c() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__r() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__x() const;
-template <> _LIBCPP_FUNC_VIS const string& __time_get_c_storage<char>::__X() const;
-
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__weeks() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__months() const;
-template <> _LIBCPP_FUNC_VIS const wstring* __time_get_c_storage<wchar_t>::__am_pm() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__c() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__r() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__x() const;
-template <> _LIBCPP_FUNC_VIS const wstring& __time_get_c_storage<wchar_t>::__X() const;
-
 template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
 class _LIBCPP_TEMPLATE_VIS time_get
     : public locale::facet,
@@ -2643,10 +2631,10 @@
     void init(const char*);
 };
 
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<char, true>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, false>::init(const char*);
-template<> _LIBCPP_FUNC_VIS void moneypunct_byname<wchar_t, true>::init(const char*);
+template<> void moneypunct_byname<char, false>::init(const char*);
+template<> void moneypunct_byname<char, true>::init(const char*);
+template<> void moneypunct_byname<wchar_t, false>::init(const char*);
+template<> void moneypunct_byname<wchar_t, true>::init(const char*);
 
 _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, false>)
 _LIBCPP_EXTERN_TEMPLATE2(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname<char, true>)
@@ -2837,7 +2825,7 @@
                     return false;
                 }
             }
-            _LIBCPP_FALLTHROUGH();
+            // drop through
         case money_base::none:
             if (__p != 3)
             {
@@ -3582,7 +3570,7 @@
     wstring_convert(_Codecvt* __pcvt, state_type __state);
     _LIBCPP_EXPLICIT_AFTER_CXX11 wstring_convert(const byte_string& __byte_err,
                     const wide_string& __wide_err = wide_string());
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_ALWAYS_INLINE
     wstring_convert(wstring_convert&& __wc);
 #endif
@@ -3641,7 +3629,7 @@
     __cvtptr_ = new _Codecvt;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 inline
@@ -3655,7 +3643,7 @@
     __wc.__cvtptr_ = nullptr;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc>
 wstring_convert<_Codecvt, _Elem, _Wide_alloc, _Byte_alloc>::~wstring_convert()
@@ -4269,6 +4257,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_LOCALE
diff --git a/include/map b/include/map
index 71f1869..ecd9d92 100644
--- a/include/map
+++ b/include/map
@@ -480,8 +480,8 @@
     void swap(__map_value_compare&__y)
         _NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
     {
-      using _VSTD::swap;
-      swap(static_cast<_Compare&>(*this), static_cast<_Compare&>(__y));
+        using _VSTD::swap;
+        swap(static_cast<const _Compare&>(*this), static_cast<const _Compare&>(__y));
     }
 
 #if _LIBCPP_STD_VER > 11
@@ -582,7 +582,7 @@
           __second_constructed(false)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __map_node_destructor(__tree_node_destructor<allocator_type>&& __x) _NOEXCEPT
         : __na_(__x.__na_),
@@ -591,7 +591,7 @@
         {
             __x.__value_constructed = false;
         }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
@@ -667,7 +667,7 @@
    ~__value_type();
 };
 
-#endif // _LIBCPP_CXX03_LANG
+#endif
 
 template <class _Tp>
 struct __extract_key_value_types;
@@ -921,7 +921,7 @@
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     map(map&& __m)
@@ -940,6 +940,10 @@
             return *this;
         }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
     _LIBCPP_INLINE_VISIBILITY
     map(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
@@ -967,7 +971,7 @@
             return *this;
         }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     explicit map(const allocator_type& __a)
@@ -1078,10 +1082,6 @@
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p,  value_type&& __v)
     {return __tree_.__insert_unique(__p.__i_, _VSTD::move(__v));}
-
-    _LIBCPP_INLINE_VISIBILITY
-    void insert(initializer_list<value_type> __il)
-        {insert(__il.begin(), __il.end());}
 #endif
 
     template <class _InputIterator>
@@ -1092,6 +1092,14 @@
                 insert(__e.__i_, *__f);
         }
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+    _LIBCPP_INLINE_VISIBILITY
+    void insert(initializer_list<value_type> __il)
+        {insert(__il.begin(), __il.end());}
+
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 #if _LIBCPP_STD_VER > 14
 
     template <class... _Args>
@@ -1186,7 +1194,7 @@
         return emplace_hint(__h, _VSTD::move(__k), _VSTD::forward<_Vp>(__v));
      }
 
-#endif // _LIBCPP_STD_VER > 14
+#endif
 
     _LIBCPP_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
@@ -1299,6 +1307,7 @@
 
 
 #ifndef _LIBCPP_CXX03_LANG
+
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 map<_Key, _Tp, _Compare, _Allocator>::map(map&& __m, const allocator_type& __a)
     : __tree_(_VSTD::move(__m.__tree_), typename __base::allocator_type(__a))
@@ -1312,27 +1321,10 @@
     }
 }
 
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_Tp&
-map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
-{
-    return __tree_.__emplace_unique_key_args(__k,
-        _VSTD::piecewise_construct,
-        _VSTD::forward_as_tuple(__k),
-        _VSTD::forward_as_tuple()).first->__cc.second;
-}
+#endif  // !_LIBCPP_CXX03_LANG
 
-template <class _Key, class _Tp, class _Compare, class _Allocator>
-_Tp&
-map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
-{
-    return __tree_.__emplace_unique_key_args(__k,
-        _VSTD::piecewise_construct,
-        _VSTD::forward_as_tuple(_VSTD::move(__k)),
-        _VSTD::forward_as_tuple()).first->__cc.second;
-}
 
-#else // _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_CXX03_LANG
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 typename map<_Key, _Tp, _Compare, _Allocator>::__node_holder
@@ -1363,7 +1355,29 @@
     return __r->__value_.__cc.second;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#else
+
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_Tp&
+map<_Key, _Tp, _Compare, _Allocator>::operator[](const key_type& __k)
+{
+    return __tree_.__emplace_unique_key_args(__k,
+        _VSTD::piecewise_construct,
+        _VSTD::forward_as_tuple(__k),
+        _VSTD::forward_as_tuple()).first->__cc.second;
+}
+
+template <class _Key, class _Tp, class _Compare, class _Allocator>
+_Tp&
+map<_Key, _Tp, _Compare, _Allocator>::operator[](key_type&& __k)
+{
+    return __tree_.__emplace_unique_key_args(__k,
+        _VSTD::piecewise_construct,
+        _VSTD::forward_as_tuple(_VSTD::move(__k)),
+        _VSTD::forward_as_tuple()).first->__cc.second;
+}
+
+#endif  // !_LIBCPP_CXX03_LANG
 
 template <class _Key, class _Tp, class _Compare, class _Allocator>
 _Tp&
@@ -1579,7 +1593,7 @@
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     multimap(multimap&& __m)
@@ -1598,6 +1612,10 @@
             return *this;
         }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
     _LIBCPP_INLINE_VISIBILITY
     multimap(initializer_list<value_type> __il, const key_compare& __comp = key_compare())
         : __tree_(__vc(__comp))
@@ -1625,7 +1643,7 @@
             return *this;
         }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     explicit multimap(const allocator_type& __a)
@@ -1718,11 +1736,6 @@
     iterator insert(const_iterator __p, value_type&& __v)
         {return __tree_.__insert_multi(__p.__i_, _VSTD::move(__v));}
 
-
-    _LIBCPP_INLINE_VISIBILITY
-    void insert(initializer_list<value_type> __il)
-        {insert(__il.begin(), __il.end());}
-
 #endif  // _LIBCPP_CXX03_LANG
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1740,6 +1753,14 @@
                 __tree_.__insert_multi(__e.__i_, *__f);
         }
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+    _LIBCPP_INLINE_VISIBILITY
+    void insert(initializer_list<value_type> __il)
+        {insert(__il.begin(), __il.end());}
+
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
     _LIBCPP_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __tree_.erase(__p.__i_);}
     _LIBCPP_INLINE_VISIBILITY
diff --git a/include/math.h b/include/math.h
index 8c30ba8..b765926 100644
--- a/include/math.h
+++ b/include/math.h
@@ -293,6 +293,9 @@
 */
 
 #include <__config>
+#if defined(_LIBCPP_MSVCRT)
+#include <crtversion.h>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
@@ -307,7 +310,6 @@
 extern "C++" {
 
 #include <type_traits>
-#include <limits>
 
 // signbit
 
@@ -325,50 +327,22 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
-signbit(_A1 __lcpp_x) _NOEXCEPT
-{ return __lcpp_x < 0; }
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
-signbit(_A1) _NOEXCEPT
-{ return false; }
-
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) >= 14)
 
 template <typename _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 signbit(_A1 __lcpp_x) _NOEXCEPT
 {
   return ::signbit(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_integral<_A1>::value && std::is_signed<_A1>::value, bool>::type
-signbit(_A1 __lcpp_x) _NOEXCEPT
-{ return __lcpp_x < 0; }
-
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_integral<_A1>::value && !std::is_signed<_A1>::value, bool>::type
-signbit(_A1) _NOEXCEPT
-{ return false; }
-
 #endif  // signbit
 
 // fpclassify
@@ -387,34 +361,22 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_integral<_A1>::value, int>::type
-fpclassify(_A1 __lcpp_x) _NOEXCEPT
-{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
-
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) >= 14)
 
 template <typename _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
 fpclassify(_A1 __lcpp_x) _NOEXCEPT
 {
   return ::fpclassify(static_cast<typename std::__promote<_A1>::type>(__lcpp_x));
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_integral<_A1>::value, int>::type
-fpclassify(_A1 __lcpp_x) _NOEXCEPT
-{ return __lcpp_x == 0 ? FP_ZERO : FP_NORMAL; }
-
 #endif  // fpclassify
 
 // isfinite
@@ -433,22 +395,12 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
-    bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 isfinite(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
-    bool>::type
-isfinite(_A1) _NOEXCEPT
-{ return true; }
-
 #endif  // isfinite
 
 // isinf
@@ -467,22 +419,12 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_arithmetic<_A1>::value && std::numeric_limits<_A1>::has_infinity,
-    bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 isinf(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<
-    std::is_arithmetic<_A1>::value && !std::numeric_limits<_A1>::has_infinity,
-    bool>::type
-isinf(_A1) _NOEXCEPT
-{ return false; }
-
 #endif  // isinf
 
 // isnan
@@ -501,18 +443,12 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 isnan(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_integral<_A1>::value, bool>::type
-isnan(_A1) _NOEXCEPT
-{ return false; }
-
 #endif  // isnan
 
 // isnormal
@@ -531,18 +467,12 @@
 
 template <class _A1>
 inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
+typename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
 isnormal(_A1 __lcpp_x) _NOEXCEPT
 {
     return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
 }
 
-template <class _A1>
-inline _LIBCPP_INLINE_VISIBILITY
-typename std::enable_if<std::is_integral<_A1>::value, bool>::type
-isnormal(_A1 __lcpp_x) _NOEXCEPT
-{ return __lcpp_x != 0; }
-
 #endif  // isnormal
 
 // isgreater
@@ -743,7 +673,7 @@
 
 // acos
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return ::acosf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return ::acosl(__lcpp_x);}
 #endif
@@ -755,7 +685,7 @@
 
 // asin
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       asin(float __lcpp_x) _NOEXCEPT       {return ::asinf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return ::asinl(__lcpp_x);}
 #endif
@@ -767,7 +697,7 @@
 
 // atan
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       atan(float __lcpp_x) _NOEXCEPT       {return ::atanf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return ::atanl(__lcpp_x);}
 #endif
@@ -779,7 +709,7 @@
 
 // atan2
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT             {return ::atan2f(__lcpp_y, __lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return ::atan2l(__lcpp_y, __lcpp_x);}
 #endif
@@ -802,7 +732,7 @@
 
 // ceil
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       ceil(float __lcpp_x) _NOEXCEPT       {return ::ceilf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ::ceill(__lcpp_x);}
 #endif
@@ -814,7 +744,7 @@
 
 // cos
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       cos(float __lcpp_x) _NOEXCEPT       {return ::cosf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return ::cosl(__lcpp_x);}
 #endif
@@ -826,7 +756,7 @@
 
 // cosh
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return ::coshf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return ::coshl(__lcpp_x);}
 #endif
@@ -838,7 +768,7 @@
 
 // exp
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       exp(float __lcpp_x) _NOEXCEPT       {return ::expf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return ::expl(__lcpp_x);}
 #endif
@@ -850,7 +780,7 @@
 
 // fabs
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       fabs(float __lcpp_x) _NOEXCEPT       {return ::fabsf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return ::fabsl(__lcpp_x);}
 #endif
@@ -862,7 +792,7 @@
 
 // floor
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       floor(float __lcpp_x) _NOEXCEPT       {return ::floorf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return ::floorl(__lcpp_x);}
 #endif
@@ -874,7 +804,7 @@
 
 // fmod
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmodf(__lcpp_x, __lcpp_y);}
 inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::fmodl(__lcpp_x, __lcpp_y);}
 #endif
@@ -897,7 +827,7 @@
 
 // frexp
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT       {return ::frexpf(__lcpp_x, __lcpp_e);}
 inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return ::frexpl(__lcpp_x, __lcpp_e);}
 #endif
@@ -909,7 +839,7 @@
 
 // ldexp
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT       {return ::ldexpf(__lcpp_x, __lcpp_e);}
 inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ::ldexpl(__lcpp_x, __lcpp_e);}
 #endif
@@ -921,7 +851,7 @@
 
 // log
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       log(float __lcpp_x) _NOEXCEPT       {return ::logf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return ::logl(__lcpp_x);}
 #endif
@@ -933,7 +863,7 @@
 
 // log10
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       log10(float __lcpp_x) _NOEXCEPT       {return ::log10f(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return ::log10l(__lcpp_x);}
 #endif
@@ -945,14 +875,14 @@
 
 // modf
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT             {return ::modff(__lcpp_x, __lcpp_y);}
 inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return ::modfl(__lcpp_x, __lcpp_y);}
 #endif
 
 // pow
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::powf(__lcpp_x, __lcpp_y);}
 inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return ::powl(__lcpp_x, __lcpp_y);}
 #endif
@@ -975,7 +905,7 @@
 
 // sin
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       sin(float __lcpp_x) _NOEXCEPT       {return ::sinf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return ::sinl(__lcpp_x);}
 #endif
@@ -987,7 +917,7 @@
 
 // sinh
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       sinh(float __lcpp_x) _NOEXCEPT       {return ::sinhf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return ::sinhl(__lcpp_x);}
 #endif
@@ -999,7 +929,7 @@
 
 // sqrt
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __lcpp_x) _NOEXCEPT       {return ::sqrtf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return ::sqrtl(__lcpp_x);}
 #endif
@@ -1011,7 +941,7 @@
 
 // tan
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       tan(float __lcpp_x) _NOEXCEPT       {return ::tanf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return ::tanl(__lcpp_x);}
 #endif
@@ -1023,7 +953,7 @@
 
 // tanh
 
-#if !(defined(_AIX) || defined(__sun__))
+#if !((defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14) || defined(_AIX) || defined(__sun__))
 inline _LIBCPP_INLINE_VISIBILITY float       tanh(float __lcpp_x) _NOEXCEPT       {return ::tanhf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return ::tanhl(__lcpp_x);}
 #endif
@@ -1035,6 +965,7 @@
 
 // acosh
 
+#if !(defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14)
 inline _LIBCPP_INLINE_VISIBILITY float       acosh(float __lcpp_x) _NOEXCEPT       {return ::acoshf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return ::acoshl(__lcpp_x);}
 
@@ -1042,9 +973,11 @@
 inline _LIBCPP_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 acosh(_A1 __lcpp_x) _NOEXCEPT {return ::acosh((double)__lcpp_x);}
+#endif
 
 // asinh
 
+#if !(defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14)
 inline _LIBCPP_INLINE_VISIBILITY float       asinh(float __lcpp_x) _NOEXCEPT       {return ::asinhf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return ::asinhl(__lcpp_x);}
 
@@ -1052,9 +985,11 @@
 inline _LIBCPP_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 asinh(_A1 __lcpp_x) _NOEXCEPT {return ::asinh((double)__lcpp_x);}
+#endif
 
 // atanh
 
+#if !(defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14)
 inline _LIBCPP_INLINE_VISIBILITY float       atanh(float __lcpp_x) _NOEXCEPT       {return ::atanhf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return ::atanhl(__lcpp_x);}
 
@@ -1062,9 +997,11 @@
 inline _LIBCPP_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 atanh(_A1 __lcpp_x) _NOEXCEPT {return ::atanh((double)__lcpp_x);}
+#endif
 
 // cbrt
 
+#if !(defined(_LIBCPP_MSVCRT) && (_VC_CRT_MAJOR_VERSION-0) < 14)
 inline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __lcpp_x) _NOEXCEPT       {return ::cbrtf(__lcpp_x);}
 inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return ::cbrtl(__lcpp_x);}
 
@@ -1072,9 +1009,11 @@
 inline _LIBCPP_INLINE_VISIBILITY
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 cbrt(_A1 __lcpp_x) _NOEXCEPT {return ::cbrt((double)__lcpp_x);}
+#endif
 
 // copysign
 
+#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12)
 inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x,
                                                 float __lcpp_y) _NOEXCEPT {
   return ::copysignf(__lcpp_x, __lcpp_y);
@@ -1083,6 +1022,7 @@
 copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {
   return ::copysignl(__lcpp_x, __lcpp_y);
 }
+#endif
 
 template <class _A1, class _A2>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1100,6 +1040,8 @@
     return ::copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
 }
 
+#if !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
+
 // erf
 
 inline _LIBCPP_INLINE_VISIBILITY float       erf(float __lcpp_x) _NOEXCEPT       {return ::erff(__lcpp_x);}
@@ -1482,6 +1424,8 @@
 typename std::enable_if<std::is_integral<_A1>::value, double>::type
 trunc(_A1 __lcpp_x) _NOEXCEPT {return ::trunc((double)__lcpp_x);}
 
+#endif // !(defined(_LIBCPP_MSVCRT) && ((_VC_CRT_MAJOR_VERSION-0) < 14))
+
 } // extern "C++"
 
 #endif // __cplusplus
diff --git a/include/memory b/include/memory
index 711551d..c7f540b 100644
--- a/include/memory
+++ b/include/memory
@@ -433,8 +433,8 @@
     long use_count() const noexcept;
     bool unique() const noexcept;
     explicit operator bool() const noexcept;
-    template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept;
-    template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept;
+    template<class U> bool owner_before(shared_ptr<U> const& b) const;
+    template<class U> bool owner_before(weak_ptr<U> const& b) const;
 };
 
 // shared_ptr comparisons:
@@ -531,8 +531,8 @@
     long use_count() const noexcept;
     bool expired() const noexcept;
     shared_ptr<T> lock() const noexcept;
-    template<class U> bool owner_before(shared_ptr<U> const& b) const noexcept;
-    template<class U> bool owner_before(weak_ptr<U> const& b) const noexcept;
+    template<class U> bool owner_before(shared_ptr<U> const& b) const;
+    template<class U> bool owner_before(weak_ptr<U> const& b) const;
 };
 
 // weak_ptr specialized algorithms:
@@ -546,9 +546,9 @@
     : binary_function<shared_ptr<T>, shared_ptr<T>, bool>
 {
     typedef bool result_type;
-    bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const noexcept;
-    bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-    bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
+    bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const;
+    bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
+    bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
 };
 
 template<class T>
@@ -556,24 +556,9 @@
     : binary_function<weak_ptr<T>, weak_ptr<T>, bool>
 {
     typedef bool result_type;
-    bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-    bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-    bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
-};
-
-template <>  // Added in C++14
-struct owner_less<void>
-{
-    template <class _Tp, class _Up>
-    bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept;
-    template <class _Tp, class _Up>
-    bool operator()( shared_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const noexcept;
-    template <class _Tp, class _Up>
-    bool operator()(   weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const noexcept;
-    template <class _Tp, class _Up>
-    bool operator()(   weak_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const noexcept;
-
-    typedef void is_transparent;
+    bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const;
+    bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
+    bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
 };
 
 template<class T>
@@ -653,19 +638,17 @@
 #include <tuple>
 #include <stdexcept>
 #include <cstring>
-#include <cassert>
+
 #if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
 #  include <atomic>
 #endif
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _ValueType>
@@ -998,11 +981,11 @@
 
 // allocator_traits
 
-struct __has_pointer_type_imp
+namespace __has_pointer_type_imp
 {
     template <class _Up> static __two __test(...);
     template <class _Up> static char __test(typename _Up::pointer* = 0);
-};
+}
 
 template <class _Tp>
 struct __has_pointer_type
@@ -1543,7 +1526,7 @@
         {return __a.allocate(__n);}
     _LIBCPP_INLINE_VISIBILITY
     static pointer allocate(allocator_type& __a, size_type __n, const_void_pointer __hint)
-        {return __allocate(__a, __n, __hint,
+        {return allocate(__a, __n, __hint,
             __has_allocate_hint<allocator_type, size_type, const_void_pointer>());}
 
     _LIBCPP_INLINE_VISIBILITY
@@ -1597,7 +1580,7 @@
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
         select_on_container_copy_construction(const allocator_type& __a)
-            {return __select_on_container_copy_construction(
+            {return select_on_container_copy_construction(
                 __has_select_on_container_copy_construction<const allocator_type>(),
                 __a);}
 
@@ -1696,11 +1679,11 @@
 private:
 
     _LIBCPP_INLINE_VISIBILITY
-    static pointer __allocate(allocator_type& __a, size_type __n,
+    static pointer allocate(allocator_type& __a, size_type __n,
         const_void_pointer __hint, true_type)
         {return __a.allocate(__n, __hint);}
     _LIBCPP_INLINE_VISIBILITY
-    static pointer __allocate(allocator_type& __a, size_type __n,
+    static pointer allocate(allocator_type& __a, size_type __n,
         const_void_pointer, false_type)
         {return __a.allocate(__n);}
 
@@ -1737,11 +1720,11 @@
 
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
-        __select_on_container_copy_construction(true_type, const allocator_type& __a)
+        select_on_container_copy_construction(true_type, const allocator_type& __a)
             {return __a.select_on_container_copy_construction();}
     _LIBCPP_INLINE_VISIBILITY
     static allocator_type
-        __select_on_container_copy_construction(false_type, const allocator_type& __a)
+        select_on_container_copy_construction(false_type, const allocator_type& __a)
             {return __a;}
 };
 
@@ -2072,817 +2055,778 @@
 };
 #endif
 
-template <class _Tp, int _Idx,
-          bool _CanBeEmptyBase =
-              is_empty<_Tp>::value && !__libcpp_is_final<_Tp>::value>
-struct __compressed_pair_elem {
-  typedef _Tp _ParamT;
-  typedef _Tp& reference;
-  typedef const _Tp& const_reference;
+template <class _T1, class _T2, bool = is_same<typename remove_cv<_T1>::type,
+                                                     typename remove_cv<_T2>::type>::value,
+                                bool = is_empty<_T1>::value
+                                       && !__libcpp_is_final<_T1>::value,
+                                bool = is_empty<_T2>::value
+                                       && !__libcpp_is_final<_T2>::value
+         >
+struct __libcpp_compressed_pair_switch;
 
-#ifndef _LIBCPP_CXX03_LANG
-  constexpr __compressed_pair_elem() : __value_() {}
+template <class _T1, class _T2, bool IsSame>
+struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, false> {enum {value = 0};};
 
-  template <class _Up, class = typename enable_if<
-      !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
-  >::type>
-  constexpr explicit
-  __compressed_pair_elem(_Up&& __u)
-      : __value_(_VSTD::forward<_Up>(__u)){};
+template <class _T1, class _T2, bool IsSame>
+struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, true, false>  {enum {value = 1};};
 
-  template <class... _Args, size_t... _Indexes>
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-  __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
-                         __tuple_indices<_Indexes...>)
-      : __value_(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
-#else
-  __compressed_pair_elem() : __value_() {}
-  __compressed_pair_elem(_ParamT __p) : __value_(std::forward<_ParamT>(__p)) {}
-#endif
-
-  reference __get() _NOEXCEPT { return __value_; }
-  const_reference __get() const _NOEXCEPT { return __value_; }
-
-private:
-  _Tp __value_;
-};
-
-template <class _Tp, int _Idx>
-struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
-  typedef _Tp _ParamT;
-  typedef _Tp& reference;
-  typedef const _Tp& const_reference;
-  typedef _Tp __value_type;
-
-#ifndef _LIBCPP_CXX03_LANG
-  constexpr __compressed_pair_elem() = default;
-
-  template <class _Up, class = typename enable_if<
-        !is_same<__compressed_pair_elem, typename decay<_Up>::type>::value
-  >::type>
-  constexpr explicit
-  __compressed_pair_elem(_Up&& __u)
-      : __value_type(_VSTD::forward<_Up>(__u)){};
-
-  template <class... _Args, size_t... _Indexes>
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-  __compressed_pair_elem(piecewise_construct_t, tuple<_Args...> __args,
-                         __tuple_indices<_Indexes...>)
-      : __value_type(_VSTD::forward<_Args>(_VSTD::get<_Indexes>(__args))...) {}
-#else
-  __compressed_pair_elem() : __value_type() {}
-  __compressed_pair_elem(_ParamT __p)
-      : __value_type(std::forward<_ParamT>(__p)) {}
-#endif
-
-  reference __get() _NOEXCEPT { return *this; }
-  const_reference __get() const _NOEXCEPT { return *this; }
-};
-
-// Tag used to construct the second element of the compressed pair.
-struct __second_tag {};
+template <class _T1, class _T2, bool IsSame>
+struct __libcpp_compressed_pair_switch<_T1, _T2, IsSame, false, true>  {enum {value = 2};};
 
 template <class _T1, class _T2>
-class __compressed_pair : private __compressed_pair_elem<_T1, 0>,
-                          private __compressed_pair_elem<_T2, 1> {
-  typedef __compressed_pair_elem<_T1, 0> _Base1;
-  typedef __compressed_pair_elem<_T2, 1> _Base2;
+struct __libcpp_compressed_pair_switch<_T1, _T2, false, true, true>    {enum {value = 3};};
 
-  // NOTE: This static assert should never fire because __compressed_pair
-  // is *almost never* used in a scenario where it's possible for T1 == T2.
-  // (The exception is std::function where it is possible that the function
-  //  object and the allocator have the same type).
-  static_assert((!is_same<_T1, _T2>::value),
-    "__compressed_pair cannot be instantated when T1 and T2 are the same type; "
-    "The current implementation is NOT ABI-compatible with the previous "
-    "implementation for this configuration");
+template <class _T1, class _T2>
+struct __libcpp_compressed_pair_switch<_T1, _T2, true, true, true>     {enum {value = 1};};
 
+template <class _T1, class _T2, unsigned = __libcpp_compressed_pair_switch<_T1, _T2>::value>
+class __libcpp_compressed_pair_imp;
+
+template <class _T1, class _T2>
+class __libcpp_compressed_pair_imp<_T1, _T2, 0>
+{
+private:
+    _T1 __first_;
+    _T2 __second_;
 public:
-#ifndef _LIBCPP_CXX03_LANG
-  template <bool _Dummy = true,
-      class = typename enable_if<
-          __dependent_type<is_default_constructible<_T1>, _Dummy>::value &&
-          __dependent_type<is_default_constructible<_T2>, _Dummy>::value
-      >::type
-  >
-  _LIBCPP_INLINE_VISIBILITY
-  constexpr __compressed_pair() {}
+    typedef _T1 _T1_param;
+    typedef _T2 _T2_param;
 
-  template <class _Tp, typename enable_if<!is_same<typename decay<_Tp>::type,
-                                                   __compressed_pair>::value,
-                                          bool>::type = true>
-  _LIBCPP_INLINE_VISIBILITY constexpr explicit
-  __compressed_pair(_Tp&& __t)
-      : _Base1(std::forward<_Tp>(__t)), _Base2() {}
+    typedef typename remove_reference<_T1>::type& _T1_reference;
+    typedef typename remove_reference<_T2>::type& _T2_reference;
 
-  template <class _Tp>
-  _LIBCPP_INLINE_VISIBILITY constexpr
-  __compressed_pair(__second_tag, _Tp&& __t)
-      : _Base1(), _Base2(std::forward<_Tp>(__t)) {}
+    typedef const typename remove_reference<_T1>::type& _T1_const_reference;
+    typedef const typename remove_reference<_T2>::type& _T2_const_reference;
 
-  template <class _U1, class _U2>
-  _LIBCPP_INLINE_VISIBILITY constexpr
-  __compressed_pair(_U1&& __t1, _U2&& __t2)
-      : _Base1(std::forward<_U1>(__t1)), _Base2(std::forward<_U2>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_(), __second_() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
+        : __first_(_VSTD::forward<_T1_param>(__t1)), __second_() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
+        : __first_(), __second_(_VSTD::forward<_T2_param>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
+        : __first_(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
 
-  template <class... _Args1, class... _Args2>
-  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14
-  __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
-                    tuple<_Args2...> __second_args)
-      : _Base1(__pc, _VSTD::move(__first_args),
-               typename __make_tuple_indices<sizeof...(_Args1)>::type()),
-        _Base2(__pc, _VSTD::move(__second_args),
-               typename __make_tuple_indices<sizeof...(_Args2)>::type()) {}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
-#else
-  _LIBCPP_INLINE_VISIBILITY
-  __compressed_pair() {}
+    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
+        _LIBCPP_INLINE_VISIBILITY
+        __libcpp_compressed_pair_imp(piecewise_construct_t,
+                                     tuple<_Args1...> __first_args,
+                                     tuple<_Args2...> __second_args,
+                                     __tuple_indices<_I1...>,
+                                     __tuple_indices<_I2...>)
+            : __first_(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
+              __second_(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
+            {}
 
-  _LIBCPP_INLINE_VISIBILITY explicit
-  __compressed_pair(_T1 __t1) : _Base1(_VSTD::forward<_T1>(__t1)) {}
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
-  _LIBCPP_INLINE_VISIBILITY
-  __compressed_pair(__second_tag, _T2 __t2)
-      : _Base1(), _Base2(_VSTD::forward<_T2>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
+    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
 
-  _LIBCPP_INLINE_VISIBILITY
-  __compressed_pair(_T1 __t1, _T2 __t2)
-      : _Base1(_VSTD::forward<_T1>(__t1)), _Base2(_VSTD::forward<_T2>(__t2)) {}
-#endif
+    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return __second_;}
+    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}
 
-  _LIBCPP_INLINE_VISIBILITY
-  typename _Base1::reference first() _NOEXCEPT {
-    return static_cast<_Base1&>(*this).__get();
-  }
+    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+    {
+        using _VSTD::swap;
+        swap(__first_, __x.__first_);
+        swap(__second_, __x.__second_);
+    }
+};
 
-  _LIBCPP_INLINE_VISIBILITY
-  typename _Base1::const_reference first() const _NOEXCEPT {
-    return static_cast<_Base1 const&>(*this).__get();
-  }
+template <class _T1, class _T2>
+class __libcpp_compressed_pair_imp<_T1, _T2, 1>
+    : private _T1
+{
+private:
+    _T2 __second_;
+public:
+    typedef _T1 _T1_param;
+    typedef _T2 _T2_param;
 
-  _LIBCPP_INLINE_VISIBILITY
-  typename _Base2::reference second() _NOEXCEPT {
-    return static_cast<_Base2&>(*this).__get();
-  }
+    typedef _T1&                                        _T1_reference;
+    typedef typename remove_reference<_T2>::type& _T2_reference;
 
-  _LIBCPP_INLINE_VISIBILITY
-  typename _Base2::const_reference second() const _NOEXCEPT {
-    return static_cast<_Base2 const&>(*this).__get();
-  }
+    typedef const _T1&                                        _T1_const_reference;
+    typedef const typename remove_reference<_T2>::type& _T2_const_reference;
 
-  _LIBCPP_INLINE_VISIBILITY
-  void swap(__compressed_pair& __x)
-    _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
-               __is_nothrow_swappable<_T2>::value)
-  {
-    using std::swap;
-    swap(first(), __x.first());
-    swap(second(), __x.second());
-  }
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __second_() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
+        : _T1(_VSTD::forward<_T1_param>(__t1)), __second_() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
+        : __second_(_VSTD::forward<_T2_param>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
+        : _T1(_VSTD::forward<_T1_param>(__t1)), __second_(_VSTD::forward<_T2_param>(__t2)) {}
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
+        _LIBCPP_INLINE_VISIBILITY
+        __libcpp_compressed_pair_imp(piecewise_construct_t,
+                                     tuple<_Args1...> __first_args,
+                                     tuple<_Args2...> __second_args,
+                                     __tuple_indices<_I1...>,
+                                     __tuple_indices<_I2...>)
+            : _T1(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
+              __second_(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
+            {}
+
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
+    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
+
+    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return __second_;}
+    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return __second_;}
+
+    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+    {
+        using _VSTD::swap;
+        swap(__second_, __x.__second_);
+    }
+};
+
+template <class _T1, class _T2>
+class __libcpp_compressed_pair_imp<_T1, _T2, 2>
+    : private _T2
+{
+private:
+    _T1 __first_;
+public:
+    typedef _T1 _T1_param;
+    typedef _T2 _T2_param;
+
+    typedef typename remove_reference<_T1>::type& _T1_reference;
+    typedef _T2&                                        _T2_reference;
+
+    typedef const typename remove_reference<_T1>::type& _T1_const_reference;
+    typedef const _T2&                                        _T2_const_reference;
+
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() : __first_() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
+        : __first_(_VSTD::forward<_T1_param>(__t1)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
+        : _T2(_VSTD::forward<_T2_param>(__t2)), __first_() {}
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
+        _NOEXCEPT_(is_nothrow_move_constructible<_T1>::value &&
+                   is_nothrow_move_constructible<_T2>::value)
+        : _T2(_VSTD::forward<_T2_param>(__t2)), __first_(_VSTD::forward<_T1_param>(__t1)) {}
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
+        _LIBCPP_INLINE_VISIBILITY
+        __libcpp_compressed_pair_imp(piecewise_construct_t,
+                                     tuple<_Args1...> __first_args,
+                                     tuple<_Args2...> __second_args,
+                                     __tuple_indices<_I1...>,
+                                     __tuple_indices<_I2...>)
+            : _T2(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...),
+              __first_(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...)
+              
+            {}
+
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return __first_;}
+    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return __first_;}
+
+    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return *this;}
+    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}
+
+    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp& __x)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+    {
+        using _VSTD::swap;
+        swap(__first_, __x.__first_);
+    }
+};
+
+template <class _T1, class _T2>
+class __libcpp_compressed_pair_imp<_T1, _T2, 3>
+    : private _T1,
+      private _T2
+{
+public:
+    typedef _T1 _T1_param;
+    typedef _T2 _T2_param;
+
+    typedef _T1& _T1_reference;
+    typedef _T2& _T2_reference;
+
+    typedef const _T1& _T1_const_reference;
+    typedef const _T2& _T2_const_reference;
+
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T1_param __t1)
+        : _T1(_VSTD::forward<_T1_param>(__t1)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __libcpp_compressed_pair_imp(_T2_param __t2)
+        : _T2(_VSTD::forward<_T2_param>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY __libcpp_compressed_pair_imp(_T1_param __t1, _T2_param __t2)
+        : _T1(_VSTD::forward<_T1_param>(__t1)), _T2(_VSTD::forward<_T2_param>(__t2)) {}
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+    template <class... _Args1, class... _Args2, size_t... _I1, size_t... _I2>
+        _LIBCPP_INLINE_VISIBILITY
+        __libcpp_compressed_pair_imp(piecewise_construct_t,
+                                     tuple<_Args1...> __first_args,
+                                     tuple<_Args2...> __second_args,
+                                     __tuple_indices<_I1...>,
+                                     __tuple_indices<_I2...>)
+            : _T1(_VSTD::forward<_Args1>(_VSTD::get<_I1>(__first_args))...),
+              _T2(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
+            {}
+
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return *this;}
+    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return *this;}
+
+    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return *this;}
+    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return *this;}
+
+    _LIBCPP_INLINE_VISIBILITY void swap(__libcpp_compressed_pair_imp&)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+    {
+    }
+};
+
+template <class _T1, class _T2>
+class __compressed_pair
+    : private __libcpp_compressed_pair_imp<_T1, _T2>
+{
+    typedef __libcpp_compressed_pair_imp<_T1, _T2> base;
+public:
+    typedef typename base::_T1_param _T1_param;
+    typedef typename base::_T2_param _T2_param;
+
+    typedef typename base::_T1_reference _T1_reference;
+    typedef typename base::_T2_reference _T2_reference;
+
+    typedef typename base::_T1_const_reference _T1_const_reference;
+    typedef typename base::_T2_const_reference _T2_const_reference;
+
+    _LIBCPP_INLINE_VISIBILITY __compressed_pair() {}
+    _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T1_param __t1)
+        : base(_VSTD::forward<_T1_param>(__t1)) {}
+    _LIBCPP_INLINE_VISIBILITY explicit __compressed_pair(_T2_param __t2)
+        : base(_VSTD::forward<_T2_param>(__t2)) {}
+    _LIBCPP_INLINE_VISIBILITY __compressed_pair(_T1_param __t1, _T2_param __t2)
+        : base(_VSTD::forward<_T1_param>(__t1), _VSTD::forward<_T2_param>(__t2)) {}
+
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
+    template <class... _Args1, class... _Args2>
+        _LIBCPP_INLINE_VISIBILITY
+        __compressed_pair(piecewise_construct_t __pc, tuple<_Args1...> __first_args,
+                                                      tuple<_Args2...> __second_args)
+            : base(__pc, _VSTD::move(__first_args), _VSTD::move(__second_args),
+                   typename __make_tuple_indices<sizeof...(_Args1)>::type(),
+                   typename __make_tuple_indices<sizeof...(_Args2) >::type())
+            {}
+
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+    _LIBCPP_INLINE_VISIBILITY _T1_reference       first() _NOEXCEPT       {return base::first();}
+    _LIBCPP_INLINE_VISIBILITY _T1_const_reference first() const _NOEXCEPT {return base::first();}
+
+    _LIBCPP_INLINE_VISIBILITY _T2_reference       second() _NOEXCEPT       {return base::second();}
+    _LIBCPP_INLINE_VISIBILITY _T2_const_reference second() const _NOEXCEPT {return base::second();}
+
+    _LIBCPP_INLINE_VISIBILITY void swap(__compressed_pair& __x)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+        {base::swap(__x);}
 };
 
 template <class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY
-void swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
-    _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
-               __is_nothrow_swappable<_T2>::value) {
-  __x.swap(__y);
-}
+void
+swap(__compressed_pair<_T1, _T2>& __x, __compressed_pair<_T1, _T2>& __y)
+        _NOEXCEPT_(__is_nothrow_swappable<_T1>::value &&
+                   __is_nothrow_swappable<_T2>::value)
+    {__x.swap(__y);}
+
+// __same_or_less_cv_qualified
+
+template <class _Ptr1, class _Ptr2,
+          bool = is_same<typename remove_cv<typename pointer_traits<_Ptr1>::element_type>::type,
+                         typename remove_cv<typename pointer_traits<_Ptr2>::element_type>::type
+                        >::value
+         >
+struct __same_or_less_cv_qualified_imp
+    : is_convertible<_Ptr1, _Ptr2> {};
+
+template <class _Ptr1, class _Ptr2>
+struct __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2, false>
+    : false_type {};
+
+template <class _Ptr1, class _Ptr2, bool = is_pointer<_Ptr1>::value ||
+                                           is_same<_Ptr1, _Ptr2>::value ||
+                                           __has_element_type<_Ptr1>::value>
+struct __same_or_less_cv_qualified
+    : __same_or_less_cv_qualified_imp<_Ptr1, _Ptr2> {};
+
+template <class _Ptr1, class _Ptr2>
+struct __same_or_less_cv_qualified<_Ptr1, _Ptr2, false>
+    : false_type {};
 
 // default_delete
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete {
-    static_assert(!is_function<_Tp>::value,
-                  "default_delete cannot be instantiated for function types");
+struct _LIBCPP_TEMPLATE_VIS default_delete
+{
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default;
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
 #else
-  _LIBCPP_INLINE_VISIBILITY default_delete() {}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
 #endif
-  template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
-  default_delete(const default_delete<_Up>&,
-                 typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* =
-                     0) _NOEXCEPT {}
-
-  _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
-    static_assert(sizeof(_Tp) > 0,
-                  "default_delete can not delete incomplete type");
-    static_assert(!is_void<_Tp>::value,
-                  "default_delete can not delete incomplete type");
-    delete __ptr;
-  }
+    template <class _Up>
+        _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up>&,
+             typename enable_if<is_convertible<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
+    _LIBCPP_INLINE_VISIBILITY void operator() (_Tp* __ptr) const _NOEXCEPT
+        {
+            static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
+            static_assert(!is_void<_Tp>::value, "default_delete can not delete incomplete type");
+            delete __ptr;
+        }
 };
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]> {
-private:
-  template <class _Up>
-  struct _EnableIfConvertible
-      : enable_if<is_convertible<_Up(*)[], _Tp(*)[]>::value> {};
-
+struct _LIBCPP_TEMPLATE_VIS default_delete<_Tp[]>
+{
 public:
 #ifndef _LIBCPP_CXX03_LANG
-  _LIBCPP_INLINE_VISIBILITY constexpr default_delete() noexcept = default;
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT = default;
 #else
-  _LIBCPP_INLINE_VISIBILITY default_delete() {}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR default_delete() _NOEXCEPT {}
 #endif
-
-  template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
-  default_delete(const default_delete<_Up[]>&,
-                 typename _EnableIfConvertible<_Up>::type* = 0) _NOEXCEPT {}
-
-  template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
-  typename _EnableIfConvertible<_Up>::type
-  operator()(_Up* __ptr) const _NOEXCEPT {
-    static_assert(sizeof(_Tp) > 0,
-                  "default_delete can not delete incomplete type");
-    static_assert(!is_void<_Tp>::value,
-                  "default_delete can not delete void type");
-    delete[] __ptr;
-  }
+    template <class _Up>
+        _LIBCPP_INLINE_VISIBILITY default_delete(const default_delete<_Up[]>&,
+             typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) _NOEXCEPT {}
+    template <class _Up>
+        _LIBCPP_INLINE_VISIBILITY
+        void operator() (_Up* __ptr,
+                         typename enable_if<__same_or_less_cv_qualified<_Up*, _Tp*>::value>::type* = 0) const _NOEXCEPT
+        {
+            static_assert(sizeof(_Tp) > 0, "default_delete can not delete incomplete type");
+            static_assert(!is_void<_Tp>::value, "default_delete can not delete void type");
+            delete [] __ptr;
+        }
 };
 
-
-
-#ifndef _LIBCPP_CXX03_LANG
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae {
-  static_assert(!is_reference<_Deleter>::value, "incorrect specialization");
-  typedef const _Deleter& __lval_ref_type;
-  typedef _Deleter&& __good_rval_ref_type;
-  typedef true_type __enable_rval_overload;
-};
-
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae<_Deleter const&> {
-  typedef const _Deleter& __lval_ref_type;
-  typedef const _Deleter&& __bad_rval_ref_type;
-  typedef false_type __enable_rval_overload;
-};
-
-template <class _Deleter>
-struct __unique_ptr_deleter_sfinae<_Deleter&> {
-  typedef _Deleter& __lval_ref_type;
-  typedef _Deleter&& __bad_rval_ref_type;
-  typedef false_type __enable_rval_overload;
-};
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
 template <class _Tp, class _Dp = default_delete<_Tp> >
-class _LIBCPP_TEMPLATE_VIS unique_ptr {
+class _LIBCPP_TEMPLATE_VIS unique_ptr
+{
 public:
-  typedef _Tp element_type;
-  typedef _Dp deleter_type;
-  typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
-
-  static_assert(!is_rvalue_reference<deleter_type>::value,
-                "the specified deleter type cannot be an rvalue reference");
-
+    typedef _Tp element_type;
+    typedef _Dp deleter_type;
+    typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
 private:
-  __compressed_pair<pointer, deleter_type> __ptr_;
+    __compressed_pair<pointer, deleter_type> __ptr_;
 
-  struct __nat { int __for_bool_; };
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    unique_ptr(unique_ptr&);
+    template <class _Up, class _Ep>
+        unique_ptr(unique_ptr<_Up, _Ep>&);
+    unique_ptr& operator=(unique_ptr&);
+    template <class _Up, class _Ep>
+        unique_ptr& operator=(unique_ptr<_Up, _Ep>&);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-#ifndef _LIBCPP_CXX03_LANG
-  typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
+    struct __nat {int __for_bool_;};
 
-  template <bool _Dummy>
-  using _LValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
-
-  template <bool _Dummy>
-  using _GoodRValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
-
-  template <bool _Dummy>
-  using _BadRValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
-
-  template <bool _Dummy, class _Deleter = typename __dependent_type<
-                             __identity<deleter_type>, _Dummy>::type>
-  using _EnableIfDeleterDefaultConstructible =
-      typename enable_if<is_default_constructible<_Deleter>::value &&
-                         !is_pointer<_Deleter>::value>::type;
-
-  template <class _ArgType>
-  using _EnableIfDeleterConstructible =
-      typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
-
-  template <class _UPtr, class _Up>
-  using _EnableIfMoveConvertible = typename enable_if<
-      is_convertible<typename _UPtr::pointer, pointer>::value &&
-      !is_array<_Up>::value
-  >::type;
-
-  template <class _UDel>
-  using _EnableIfDeleterConvertible = typename enable_if<
-      (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
-      (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
-    >::type;
-
-  template <class _UDel>
-  using _EnableIfDeleterAssignable = typename enable_if<
-      is_assignable<_Dp&, _UDel&&>::value
-    >::type;
-
+    typedef       typename remove_reference<deleter_type>::type& _Dp_reference;
+    typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
 public:
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>>
-  _LIBCPP_INLINE_VISIBILITY
-  constexpr unique_ptr() noexcept : __ptr_(pointer()) {}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
+        : __ptr_(pointer())
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
+        : __ptr_(pointer())
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
+    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p) _NOEXCEPT
+        : __ptr_(_VSTD::move(__p))
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
 
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>>
-  _LIBCPP_INLINE_VISIBILITY
-  constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename conditional<
+                                        is_reference<deleter_type>::value,
+                                        deleter_type,
+                                        typename add_lvalue_reference<const deleter_type>::type>::type __d)
+             _NOEXCEPT
+        : __ptr_(__p, __d) {}
 
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>>
-  _LIBCPP_INLINE_VISIBILITY
-  explicit unique_ptr(pointer __p) noexcept : __ptr_(__p) {}
-
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(pointer __p, _LValRefType<_Dummy> __d) noexcept
-      : __ptr_(__p, __d) {}
-
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(pointer __p, _GoodRValRefType<_Dummy> __d) noexcept
-      : __ptr_(__p, _VSTD::move(__d)) {
-    static_assert(!is_reference<deleter_type>::value,
-                  "rvalue deleter bound to reference");
-  }
-
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(pointer __p, _BadRValRefType<_Dummy> __d) = delete;
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(unique_ptr&& __u) noexcept
-      : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
-  }
-
-  template <class _Up, class _Ep,
-      class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
-      class = _EnableIfDeleterConvertible<_Ep>
-  >
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
-      : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, typename remove_reference<deleter_type>::type&& __d)
+             _NOEXCEPT
+        : __ptr_(__p, _VSTD::move(__d))
+        {
+            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
+        }
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
+        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
+    template <class _Up, class _Ep>
+        _LIBCPP_INLINE_VISIBILITY
+        unique_ptr(unique_ptr<_Up, _Ep>&& __u,
+                   typename enable_if
+                      <
+                        !is_array<_Up>::value &&
+                         is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
+                         is_convertible<_Ep, deleter_type>::value &&
+                         (
+                            !is_reference<deleter_type>::value ||
+                            is_same<deleter_type, _Ep>::value
+                         ),
+                         __nat
+                      >::type = __nat()) _NOEXCEPT
+            : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {}
 
 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-  template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(auto_ptr<_Up>&& __p,
-             typename enable_if<is_convertible<_Up*, _Tp*>::value &&
-                                    is_same<_Dp, default_delete<_Tp>>::value,
-                                __nat>::type = __nat()) _NOEXCEPT
-      : __ptr_(__p.release()) {}
+    template <class _Up>
+        _LIBCPP_INLINE_VISIBILITY unique_ptr(auto_ptr<_Up>&& __p,
+                typename enable_if<
+                                      is_convertible<_Up*, _Tp*>::value &&
+                                      is_same<_Dp, default_delete<_Tp> >::value,
+                                      __nat
+                                  >::type = __nat()) _NOEXCEPT
+            : __ptr_(__p.release())
+            {
+            }
 #endif
 
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT {
-    reset(__u.release());
-    __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
-    return *this;
-  }
+        _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
+            {
+                reset(__u.release());
+                __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+                return *this;
+            }
 
-  template <class _Up, class _Ep,
-      class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
-      class = _EnableIfDeleterAssignable<_Ep>
-  >
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT {
-    reset(__u.release());
-    __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
-    return *this;
-  }
+        template <class _Up, class _Ep>
+            _LIBCPP_INLINE_VISIBILITY
+            typename enable_if
+            <
+                !is_array<_Up>::value &&
+                is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
+                is_assignable<deleter_type&, _Ep&&>::value,
+                unique_ptr&
+            >::type
+            operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
+            {
+                reset(__u.release());
+                __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+                return *this;
+            }
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-#else  // _LIBCPP_CXX03_LANG
-private:
-  unique_ptr(unique_ptr&);
-  template <class _Up, class _Ep> unique_ptr(unique_ptr<_Up, _Ep>&);
+    _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
+    {
+        return __rv<unique_ptr>(*this);
+    }
 
-  unique_ptr& operator=(unique_ptr&);
-  template <class _Up, class _Ep> unique_ptr& operator=(unique_ptr<_Up, _Ep>&);
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
+        : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
 
-public:
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr() : __ptr_(pointer())
-  {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-    static_assert(is_default_constructible<deleter_type>::value,
-                  "unique_ptr::deleter_type is not default constructible");
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(nullptr_t) : __ptr_(pointer())
-  {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  explicit unique_ptr(pointer __p)
-      : __ptr_(_VSTD::move(__p)) {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-  }
+    template <class _Up, class _Ep>
+    _LIBCPP_INLINE_VISIBILITY
+    typename enable_if<
+        !is_array<_Up>::value &&
+        is_convertible<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
+        is_assignable<deleter_type&, _Ep&>::value,
+        unique_ptr&
+    >::type
+    operator=(unique_ptr<_Up, _Ep> __u)
+    {
+        reset(__u.release());
+        __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+        return *this;
+    }
 
-  _LIBCPP_INLINE_VISIBILITY
-  operator __rv<unique_ptr>() {
-    return __rv<unique_ptr>(*this);
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(__rv<unique_ptr> __u)
-      : __ptr_(__u->release(),
-               _VSTD::forward<deleter_type>(__u->get_deleter())) {}
-
-  template <class _Up, class _Ep>
-  _LIBCPP_INLINE_VISIBILITY
-  typename enable_if<
-      !is_array<_Up>::value &&
-          is_convertible<typename unique_ptr<_Up, _Ep>::pointer,
-                         pointer>::value &&
-          is_assignable<deleter_type&, _Ep&>::value,
-      unique_ptr&>::type
-  operator=(unique_ptr<_Up, _Ep> __u) {
-    reset(__u.release());
-    __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
-    return *this;
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(pointer __p, deleter_type __d)
-      : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
-#endif // _LIBCPP_CXX03_LANG
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
+        : __ptr_(_VSTD::move(__p), _VSTD::move(__d)) {}
 
 #if _LIBCPP_STD_VER <= 14 || defined(_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR)
-  template <class _Up>
-  _LIBCPP_INLINE_VISIBILITY
-      typename enable_if<is_convertible<_Up*, _Tp*>::value &&
-                             is_same<_Dp, default_delete<_Tp> >::value,
-                         unique_ptr&>::type
-      operator=(auto_ptr<_Up> __p) {
-    reset(__p.release());
-    return *this;
-  }
+    template <class _Up>
+        _LIBCPP_INLINE_VISIBILITY
+                typename enable_if<
+                                      is_convertible<_Up*, _Tp*>::value &&
+                                      is_same<_Dp, default_delete<_Tp> >::value,
+                                      unique_ptr&
+                                  >::type
+        operator=(auto_ptr<_Up> __p)
+            {reset(__p.release()); return *this;}
 #endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
 
-  _LIBCPP_INLINE_VISIBILITY
-  ~unique_ptr() { reset(); }
+    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t) _NOEXCEPT
+    {
+        reset();
+        return *this;
+    }
 
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(nullptr_t) _NOEXCEPT {
-    reset();
-    return *this;
-  }
+    _LIBCPP_INLINE_VISIBILITY typename add_lvalue_reference<_Tp>::type operator*() const
+        {return *__ptr_.first();}
+    _LIBCPP_INLINE_VISIBILITY pointer operator->() const _NOEXCEPT {return __ptr_.first();}
+    _LIBCPP_INLINE_VISIBILITY pointer get() const _NOEXCEPT {return __ptr_.first();}
+    _LIBCPP_INLINE_VISIBILITY       _Dp_reference get_deleter() _NOEXCEPT
+        {return __ptr_.second();}
+    _LIBCPP_INLINE_VISIBILITY _Dp_const_reference get_deleter() const _NOEXCEPT
+        {return __ptr_.second();}
+    _LIBCPP_INLINE_VISIBILITY
+        _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
+        {return __ptr_.first() != nullptr;}
 
-  _LIBCPP_INLINE_VISIBILITY
-  typename add_lvalue_reference<_Tp>::type
-  operator*() const {
-    return *__ptr_.first();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  pointer operator->() const _NOEXCEPT {
-    return __ptr_.first();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  pointer get() const _NOEXCEPT {
-    return __ptr_.first();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  deleter_type& get_deleter() _NOEXCEPT {
-    return __ptr_.second();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  const deleter_type& get_deleter() const _NOEXCEPT {
-    return __ptr_.second();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
-    return __ptr_.first() != nullptr;
-  }
+    _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
+    {
+        pointer __t = __ptr_.first();
+        __ptr_.first() = pointer();
+        return __t;
+    }
 
-  _LIBCPP_INLINE_VISIBILITY
-  pointer release() _NOEXCEPT {
-    pointer __t = __ptr_.first();
-    __ptr_.first() = pointer();
-    return __t;
-  }
+    _LIBCPP_INLINE_VISIBILITY void reset(pointer __p = pointer()) _NOEXCEPT
+    {
+        pointer __tmp = __ptr_.first();
+        __ptr_.first() = __p;
+        if (__tmp)
+            __ptr_.second()(__tmp);
+    }
 
-  _LIBCPP_INLINE_VISIBILITY
-  void reset(pointer __p = pointer()) _NOEXCEPT {
-    pointer __tmp = __ptr_.first();
-    __ptr_.first() = __p;
-    if (__tmp)
-      __ptr_.second()(__tmp);
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  void swap(unique_ptr& __u) _NOEXCEPT {
-    __ptr_.swap(__u.__ptr_);
-  }
+    _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) _NOEXCEPT
+        {__ptr_.swap(__u.__ptr_);}
 };
 
-
 template <class _Tp, class _Dp>
-class _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp> {
+class _LIBCPP_TEMPLATE_VIS unique_ptr<_Tp[], _Dp>
+{
 public:
-  typedef _Tp element_type;
-  typedef _Dp deleter_type;
-  typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
-
+    typedef _Tp element_type;
+    typedef _Dp deleter_type;
+    typedef typename __pointer_type<_Tp, deleter_type>::type pointer;
 private:
-  __compressed_pair<pointer, deleter_type> __ptr_;
+    __compressed_pair<pointer, deleter_type> __ptr_;
 
-  template <class _From>
-  struct _CheckArrayPointerConversion : is_same<_From, pointer> {};
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    unique_ptr(unique_ptr&);
+    template <class _Up>
+        unique_ptr(unique_ptr<_Up>&);
+    unique_ptr& operator=(unique_ptr&);
+    template <class _Up>
+        unique_ptr& operator=(unique_ptr<_Up>&);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-  template <class _FromElem>
-  struct _CheckArrayPointerConversion<_FromElem*>
-      : integral_constant<bool,
-          is_same<_FromElem*, pointer>::value ||
-            (is_same<pointer, element_type*>::value &&
-             is_convertible<_FromElem(*)[], element_type(*)[]>::value)
-      >
-  {};
+    struct __nat {int __for_bool_;};
 
-#ifndef _LIBCPP_CXX03_LANG
-  typedef __unique_ptr_deleter_sfinae<_Dp> _DeleterSFINAE;
-
-  template <bool _Dummy>
-  using _LValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__lval_ref_type;
-
-  template <bool _Dummy>
-  using _GoodRValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__good_rval_ref_type;
-
-  template <bool _Dummy>
-  using _BadRValRefType =
-      typename __dependent_type<_DeleterSFINAE, _Dummy>::__bad_rval_ref_type;
-
-  template <bool _Dummy, class _Deleter = typename __dependent_type<
-                             __identity<deleter_type>, _Dummy>::type>
-  using _EnableIfDeleterDefaultConstructible =
-      typename enable_if<is_default_constructible<_Deleter>::value &&
-                         !is_pointer<_Deleter>::value>::type;
-
-  template <class _ArgType>
-  using _EnableIfDeleterConstructible =
-      typename enable_if<is_constructible<deleter_type, _ArgType>::value>::type;
-
-  template <class _Pp>
-  using _EnableIfPointerConvertible = typename enable_if<
-      _CheckArrayPointerConversion<_Pp>::value
-  >::type;
-
-  template <class _UPtr, class _Up,
-        class _ElemT = typename _UPtr::element_type>
-  using _EnableIfMoveConvertible = typename enable_if<
-      is_array<_Up>::value &&
-      is_same<pointer, element_type*>::value &&
-      is_same<typename _UPtr::pointer, _ElemT*>::value &&
-      is_convertible<_ElemT(*)[], element_type(*)[]>::value
-    >::type;
-
-  template <class _UDel>
-  using _EnableIfDeleterConvertible = typename enable_if<
-      (is_reference<_Dp>::value && is_same<_Dp, _UDel>::value) ||
-      (!is_reference<_Dp>::value && is_convertible<_UDel, _Dp>::value)
-    >::type;
-
-  template <class _UDel>
-  using _EnableIfDeleterAssignable = typename enable_if<
-      is_assignable<_Dp&, _UDel&&>::value
-    >::type;
-
+    typedef       typename remove_reference<deleter_type>::type& _Dp_reference;
+    typedef const typename remove_reference<deleter_type>::type& _Dp_const_reference;
 public:
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>>
-  _LIBCPP_INLINE_VISIBILITY
-  constexpr unique_ptr() noexcept : __ptr_(pointer()) {}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr() _NOEXCEPT
+        : __ptr_(pointer())
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR unique_ptr(nullptr_t) _NOEXCEPT
+        : __ptr_(pointer())
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    template <class _Pp>
+    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(_Pp __p,
+            typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat()) _NOEXCEPT
+        : __ptr_(__p)
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
 
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>>
-  _LIBCPP_INLINE_VISIBILITY
-  constexpr unique_ptr(nullptr_t) noexcept : __ptr_(pointer()) {}
+    template <class _Pp>
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p, typename conditional<
+                                       is_reference<deleter_type>::value,
+                                       deleter_type,
+                                       typename add_lvalue_reference<const deleter_type>::type>::type __d,
+                                       typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat())
+             _NOEXCEPT
+        : __ptr_(__p, __d) {}
 
-  template <class _Pp, bool _Dummy = true,
-            class = _EnableIfDeleterDefaultConstructible<_Dummy>,
-            class = _EnableIfPointerConvertible<_Pp>>
-  _LIBCPP_INLINE_VISIBILITY
-  explicit unique_ptr(_Pp __p) noexcept
-      : __ptr_(__p) {}
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename conditional<
+                                       is_reference<deleter_type>::value,
+                                       deleter_type,
+                                       typename add_lvalue_reference<const deleter_type>::type>::type __d)
+             _NOEXCEPT
+        : __ptr_(pointer(), __d) {}
 
-  template <class _Pp, bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>,
-            class = _EnableIfPointerConvertible<_Pp>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(_Pp __p, _LValRefType<_Dummy> __d) noexcept
-      : __ptr_(__p, __d) {}
+    template <class _Pp>
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(_Pp __p,
+                                         typename remove_reference<deleter_type>::type&& __d,
+                                         typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, __nat>::type = __nat())
+             _NOEXCEPT
+        : __ptr_(__p, _VSTD::move(__d))
+        {
+            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
+        }
 
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_LValRefType<_Dummy>>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(nullptr_t, _LValRefType<_Dummy> __d) noexcept
-      : __ptr_(nullptr, __d) {}
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, typename remove_reference<deleter_type>::type&& __d)
+             _NOEXCEPT
+        : __ptr_(pointer(), _VSTD::move(__d))
+        {
+            static_assert(!is_reference<deleter_type>::value, "rvalue deleter bound to reference");
+        }
 
-  template <class _Pp, bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>,
-            class = _EnableIfPointerConvertible<_Pp>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(_Pp __p, _GoodRValRefType<_Dummy> __d) noexcept
-      : __ptr_(__p, _VSTD::move(__d)) {
-    static_assert(!is_reference<deleter_type>::value,
-                  "rvalue deleter bound to reference");
-  }
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(unique_ptr&& __u) _NOEXCEPT
+        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
 
-  template <bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_GoodRValRefType<_Dummy>>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(nullptr_t, _GoodRValRefType<_Dummy> __d) noexcept
-      : __ptr_(nullptr, _VSTD::move(__d)) {
-    static_assert(!is_reference<deleter_type>::value,
-                  "rvalue deleter bound to reference");
-  }
+    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(unique_ptr&& __u) _NOEXCEPT
+        {
+            reset(__u.release());
+            __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
+            return *this;
+        }
 
-  template <class _Pp, bool _Dummy = true,
-            class = _EnableIfDeleterConstructible<_BadRValRefType<_Dummy>>,
-            class = _EnableIfPointerConvertible<_Pp>>
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(_Pp __p, _BadRValRefType<_Dummy> __d) = delete;
+    template <class _Up, class _Ep>
+        _LIBCPP_INLINE_VISIBILITY
+        unique_ptr(unique_ptr<_Up, _Ep>&& __u,
+                   typename enable_if
+                            <
+                                is_array<_Up>::value &&
+                                __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value
+                                && is_convertible<_Ep, deleter_type>::value &&
+                                (
+                                    !is_reference<deleter_type>::value ||
+                                    is_same<deleter_type, _Ep>::value
+                                ),
+                                __nat
+                            >::type = __nat()
+                  ) _NOEXCEPT
+        : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {}
 
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(unique_ptr&& __u) noexcept
-      : __ptr_(__u.release(), _VSTD::forward<deleter_type>(__u.get_deleter())) {
-  }
 
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(unique_ptr&& __u) noexcept {
-    reset(__u.release());
-    __ptr_.second() = _VSTD::forward<deleter_type>(__u.get_deleter());
-    return *this;
-  }
+        template <class _Up, class _Ep>
+            _LIBCPP_INLINE_VISIBILITY
+            typename enable_if
+            <
+                is_array<_Up>::value &&
+                __same_or_less_cv_qualified<typename unique_ptr<_Up, _Ep>::pointer, pointer>::value &&
+                is_assignable<deleter_type&, _Ep&&>::value,
+                unique_ptr&
+            >::type
+            operator=(unique_ptr<_Up, _Ep>&& __u) _NOEXCEPT
+            {
+                reset(__u.release());
+                __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
+                return *this;
+            }
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-  template <class _Up, class _Ep,
-      class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
-      class = _EnableIfDeleterConvertible<_Ep>
-  >
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
-      : __ptr_(__u.release(), _VSTD::forward<_Ep>(__u.get_deleter())) {
-  }
+    _LIBCPP_INLINE_VISIBILITY explicit unique_ptr(pointer __p)
+        : __ptr_(__p)
+        {
+            static_assert(!is_pointer<deleter_type>::value,
+                "unique_ptr constructed with null function pointer deleter");
+        }
 
-  template <class _Up, class _Ep,
-      class = _EnableIfMoveConvertible<unique_ptr<_Up, _Ep>, _Up>,
-      class = _EnableIfDeleterAssignable<_Ep>
-  >
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr&
-  operator=(unique_ptr<_Up, _Ep>&& __u) noexcept {
-    reset(__u.release());
-    __ptr_.second() = _VSTD::forward<_Ep>(__u.get_deleter());
-    return *this;
-  }
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(pointer __p, deleter_type __d)
+        : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
 
-#else // _LIBCPP_CXX03_LANG
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(nullptr_t, deleter_type __d)
+        : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
+
+    _LIBCPP_INLINE_VISIBILITY operator __rv<unique_ptr>()
+    {
+        return __rv<unique_ptr>(*this);
+    }
+
+    _LIBCPP_INLINE_VISIBILITY unique_ptr(__rv<unique_ptr> __u)
+        : __ptr_(__u->release(), _VSTD::forward<deleter_type>(__u->get_deleter())) {}
+
+    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(__rv<unique_ptr> __u)
+    {
+        reset(__u->release());
+        __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
+        return *this;
+    }
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY ~unique_ptr() {reset();}
+
+    _LIBCPP_INLINE_VISIBILITY unique_ptr& operator=(nullptr_t) _NOEXCEPT
+    {
+        reset();
+        return *this;
+    }
+
+    _LIBCPP_INLINE_VISIBILITY typename add_lvalue_reference<_Tp>::type operator[](size_t __i) const
+        {return __ptr_.first()[__i];}
+    _LIBCPP_INLINE_VISIBILITY pointer get() const _NOEXCEPT {return __ptr_.first();}
+    _LIBCPP_INLINE_VISIBILITY       _Dp_reference get_deleter() _NOEXCEPT
+        {return __ptr_.second();}
+    _LIBCPP_INLINE_VISIBILITY _Dp_const_reference get_deleter() const _NOEXCEPT
+        {return __ptr_.second();}
+    _LIBCPP_INLINE_VISIBILITY
+        _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT
+        {return __ptr_.first() != nullptr;}
+
+    _LIBCPP_INLINE_VISIBILITY pointer release() _NOEXCEPT
+    {
+        pointer __t = __ptr_.first();
+        __ptr_.first() = pointer();
+        return __t;
+    }
+
+    template <class _Pp>
+    _LIBCPP_INLINE_VISIBILITY
+    typename enable_if<__same_or_less_cv_qualified<_Pp, pointer>::value, void>::type
+    reset(_Pp __p) _NOEXCEPT
+    {
+        pointer __tmp = __ptr_.first();
+        __ptr_.first() = __p;
+        if (__tmp)
+            __ptr_.second()(__tmp);
+    }
+    _LIBCPP_INLINE_VISIBILITY void reset(nullptr_t = nullptr) _NOEXCEPT
+    {
+        pointer __tmp = __ptr_.first();
+        __ptr_.first() = nullptr;
+        if (__tmp)
+            __ptr_.second()(__tmp);
+    }
+
+    _LIBCPP_INLINE_VISIBILITY void swap(unique_ptr& __u) {__ptr_.swap(__u.__ptr_);}
 private:
-  template <class _Up> explicit unique_ptr(_Up);
 
-  unique_ptr(unique_ptr&);
-  template <class _Up> unique_ptr(unique_ptr<_Up>&);
-
-  unique_ptr& operator=(unique_ptr&);
-  template <class _Up> unique_ptr& operator=(unique_ptr<_Up>&);
-
-  template <class _Up>
-  unique_ptr(_Up __u,
-             typename conditional<
-                 is_reference<deleter_type>::value, deleter_type,
-                 typename add_lvalue_reference<const deleter_type>::type>::type,
-             typename enable_if<is_convertible<_Up, pointer>::value,
-                                __nat>::type = __nat());
-public:
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr() : __ptr_(pointer()) {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(nullptr_t) : __ptr_(pointer()) {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  explicit unique_ptr(pointer __p) : __ptr_(__p) {
-    static_assert(!is_pointer<deleter_type>::value,
-                  "unique_ptr constructed with null function pointer deleter");
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(pointer __p, deleter_type __d)
-      : __ptr_(__p, _VSTD::forward<deleter_type>(__d)) {}
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(nullptr_t, deleter_type __d)
-      : __ptr_(pointer(), _VSTD::forward<deleter_type>(__d)) {}
-
-  _LIBCPP_INLINE_VISIBILITY
-  operator __rv<unique_ptr>() {
-    return __rv<unique_ptr>(*this);
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr(__rv<unique_ptr> __u)
-      : __ptr_(__u->release(),
-               _VSTD::forward<deleter_type>(__u->get_deleter())) {}
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(__rv<unique_ptr> __u) {
-    reset(__u->release());
-    __ptr_.second() = _VSTD::forward<deleter_type>(__u->get_deleter());
-    return *this;
-  }
-
-#endif // _LIBCPP_CXX03_LANG
-
-public:
-  _LIBCPP_INLINE_VISIBILITY
-  ~unique_ptr() { reset(); }
-
-  _LIBCPP_INLINE_VISIBILITY
-  unique_ptr& operator=(nullptr_t) _NOEXCEPT {
-    reset();
-    return *this;
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  typename add_lvalue_reference<_Tp>::type
-  operator[](size_t __i) const {
-    return __ptr_.first()[__i];
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  pointer get() const _NOEXCEPT {
-    return __ptr_.first();
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  deleter_type& get_deleter() _NOEXCEPT {
-    return __ptr_.second();
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  const deleter_type& get_deleter() const _NOEXCEPT {
-    return __ptr_.second();
-  }
-  _LIBCPP_INLINE_VISIBILITY
-  _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {
-    return __ptr_.first() != nullptr;
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  pointer release() _NOEXCEPT {
-    pointer __t = __ptr_.first();
-    __ptr_.first() = pointer();
-    return __t;
-  }
-
-  template <class _Pp>
-  _LIBCPP_INLINE_VISIBILITY
-  typename enable_if<
-      _CheckArrayPointerConversion<_Pp>::value
-  >::type
-  reset(_Pp __p) _NOEXCEPT {
-    pointer __tmp = __ptr_.first();
-    __ptr_.first() = __p;
-    if (__tmp)
-      __ptr_.second()(__tmp);
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  void reset(nullptr_t = nullptr) _NOEXCEPT {
-    pointer __tmp = __ptr_.first();
-    __ptr_.first() = nullptr;
-    if (__tmp)
-      __ptr_.second()(__tmp);
-  }
-
-  _LIBCPP_INLINE_VISIBILITY
-  void swap(unique_ptr& __u) _NOEXCEPT {
-    __ptr_.swap(__u.__ptr_);
-  }
-
+#ifdef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    template <class _Up>
+        explicit unique_ptr(_Up);
+    template <class _Up>
+        unique_ptr(_Up __u,
+                   typename conditional<
+                                       is_reference<deleter_type>::value,
+                                       deleter_type,
+                                       typename add_lvalue_reference<const deleter_type>::type>::type,
+                   typename enable_if
+                      <
+                         is_convertible<_Up, pointer>::value,
+                         __nat
+                      >::type = __nat());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 };
 
 template <class _Tp, class _Dp>
@@ -3093,7 +3037,7 @@
     typedef unique_ptr<_Tp, _Dp> argument_type;
     typedef size_t               result_type;
     _LIBCPP_INLINE_VISIBILITY
-    result_type operator()(const argument_type& __ptr) const
+    result_type operator()(const argument_type& __ptr) const _NOEXCEPT
     {
         typedef typename argument_type::pointer pointer;
         return hash<pointer>()(__ptr.get());
@@ -3103,28 +3047,28 @@
 struct __destruct_n
 {
 private:
-    size_t __size_;
+    size_t size;
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __process(_Tp* __p, false_type) _NOEXCEPT
-        {for (size_t __i = 0; __i < __size_; ++__i, ++__p) __p->~_Tp();}
+        {for (size_t __i = 0; __i < size; ++__i, ++__p) __p->~_Tp();}
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __process(_Tp*, true_type) _NOEXCEPT
         {}
 
     _LIBCPP_INLINE_VISIBILITY void __incr(false_type) _NOEXCEPT
-        {++__size_;}
+        {++size;}
     _LIBCPP_INLINE_VISIBILITY void __incr(true_type) _NOEXCEPT
         {}
 
     _LIBCPP_INLINE_VISIBILITY void __set(size_t __s, false_type) _NOEXCEPT
-        {__size_ = __s;}
+        {size = __s;}
     _LIBCPP_INLINE_VISIBILITY void __set(size_t, true_type) _NOEXCEPT
         {}
 public:
     _LIBCPP_INLINE_VISIBILITY explicit __destruct_n(size_t __s) _NOEXCEPT
-        : __size_(__s) {}
+        : size(__s) {}
 
     template <class _Tp>
     _LIBCPP_INLINE_VISIBILITY void __incr(_Tp*) _NOEXCEPT
@@ -3563,7 +3507,7 @@
 const void*
 __shared_ptr_pointer<_Tp, _Dp, _Alloc>::__get_deleter(const type_info& __t) const _NOEXCEPT
 {
-    return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : nullptr;
+    return __t == typeid(_Dp) ? _VSTD::addressof(__data_.first().second()) : 0;
 }
 
 #endif  // _LIBCPP_NO_RTTI
@@ -3657,18 +3601,6 @@
     __a.deallocate(_PTraits::pointer_to(*this), 1);
 }
 
-struct __shared_ptr_dummy_rebind_allocator_type;
-template <>
-class _LIBCPP_TEMPLATE_VIS allocator<__shared_ptr_dummy_rebind_allocator_type>
-{
-public:
-    template <class _Other>
-    struct rebind
-    {
-        typedef allocator<_Other> other;
-    };
-};
-
 template<class _Tp> class _LIBCPP_TEMPLATE_VIS enable_shared_from_this;
 
 template<class _Tp>
@@ -3875,11 +3807,11 @@
     _LIBCPP_EXPLICIT operator bool() const _NOEXCEPT {return get() != 0;}
     template <class _Up>
         _LIBCPP_INLINE_VISIBILITY
-        bool owner_before(shared_ptr<_Up> const& __p) const _NOEXCEPT
+        bool owner_before(shared_ptr<_Up> const& __p) const
         {return __cntrl_ < __p.__cntrl_;}
     template <class _Up>
         _LIBCPP_INLINE_VISIBILITY
-        bool owner_before(weak_ptr<_Up> const& __p) const _NOEXCEPT
+        bool owner_before(weak_ptr<_Up> const& __p) const
         {return __cntrl_ < __p.__cntrl_;}
     _LIBCPP_INLINE_VISIBILITY
     bool
@@ -3937,24 +3869,10 @@
 #endif  // _LIBCPP_HAS_NO_VARIADICS
 
 private:
-    template <class _Yp, bool = is_function<_Yp>::value>
-        struct __shared_ptr_default_allocator
-        {
-            typedef allocator<_Yp> type;
-        };
-
-    template <class _Yp>
-        struct __shared_ptr_default_allocator<_Yp, true>
-        {
-            typedef allocator<__shared_ptr_dummy_rebind_allocator_type> type;
-        };
 
     template <class _Yp, class _OrigPtr>
         _LIBCPP_INLINE_VISIBILITY
-        typename enable_if<is_convertible<_OrigPtr*,
-                                          const enable_shared_from_this<_Yp>*
-        >::value,
-            void>::type
+        void
         __enable_weak_this(const enable_shared_from_this<_Yp>* __e,
                            _OrigPtr* __ptr) _NOEXCEPT
         {
@@ -3966,13 +3884,13 @@
             }
         }
 
-    _LIBCPP_INLINE_VISIBILITY void __enable_weak_this(...) _NOEXCEPT {}
+    _LIBCPP_INLINE_VISIBILITY
+    void __enable_weak_this(const volatile void*, const volatile void*) _NOEXCEPT {}
 
     template <class _Up> friend class _LIBCPP_TEMPLATE_VIS shared_ptr;
     template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
 };
 
-
 template<class _Tp>
 inline
 _LIBCPP_CONSTEXPR
@@ -3998,9 +3916,8 @@
     : __ptr_(__p)
 {
     unique_ptr<_Yp> __hold(__p);
-    typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
-    typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, _AllocT > _CntrlBlk;
-    __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), _AllocT());
+    typedef __shared_ptr_pointer<_Yp*, default_delete<_Yp>, allocator<_Yp> > _CntrlBlk;
+    __cntrl_ = new _CntrlBlk(__p, default_delete<_Yp>(), allocator<_Yp>());
     __hold.release();
     __enable_weak_this(__p, __p);
 }
@@ -4015,9 +3932,8 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
-        typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
-        __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
+        typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
+        __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Yp>());
         __enable_weak_this(__p, __p);
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
@@ -4038,9 +3954,8 @@
     try
     {
 #endif  // _LIBCPP_NO_EXCEPTIONS
-        typedef typename __shared_ptr_default_allocator<_Tp>::type _AllocT;
-        typedef __shared_ptr_pointer<nullptr_t, _Dp, _AllocT > _CntrlBlk;
-        __cntrl_ = new _CntrlBlk(__p, __d, _AllocT());
+        typedef __shared_ptr_pointer<nullptr_t, _Dp, allocator<_Tp> > _CntrlBlk;
+        __cntrl_ = new _CntrlBlk(__p, __d, allocator<_Tp>());
 #ifndef _LIBCPP_NO_EXCEPTIONS
     }
     catch (...)
@@ -4208,9 +4123,8 @@
     else
 #endif
     {
-        typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
-        typedef __shared_ptr_pointer<_Yp*, _Dp, _AllocT > _CntrlBlk;
-        __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), _AllocT());
+        typedef __shared_ptr_pointer<_Yp*, _Dp, allocator<_Yp> > _CntrlBlk;
+        __cntrl_ = new _CntrlBlk(__r.get(), __r.get_deleter(), allocator<_Yp>());
         __enable_weak_this(__r.get(), __r.get());
     }
     __r.release();
@@ -4238,11 +4152,10 @@
     else
 #endif
     {
-        typedef typename __shared_ptr_default_allocator<_Yp>::type _AllocT;
         typedef __shared_ptr_pointer<_Yp*,
                                      reference_wrapper<typename remove_reference<_Dp>::type>,
-                                     _AllocT > _CntrlBlk;
-        __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), _AllocT());
+                                     allocator<_Yp> > _CntrlBlk;
+        __cntrl_ = new _CntrlBlk(__r.get(), ref(__r.get_deleter()), allocator<_Yp>());
         __enable_weak_this(__r.get(), __r.get());
     }
     __r.release();
@@ -4994,11 +4907,11 @@
     shared_ptr<_Tp> lock() const _NOEXCEPT;
     template<class _Up>
         _LIBCPP_INLINE_VISIBILITY
-        bool owner_before(const shared_ptr<_Up>& __r) const _NOEXCEPT
+        bool owner_before(const shared_ptr<_Up>& __r) const
         {return __cntrl_ < __r.__cntrl_;}
     template<class _Up>
         _LIBCPP_INLINE_VISIBILITY
-        bool owner_before(const weak_ptr<_Up>& __r) const _NOEXCEPT
+        bool owner_before(const weak_ptr<_Up>& __r) const
         {return __cntrl_ < __r.__cntrl_;}
 
     template <class _Up> friend class _LIBCPP_TEMPLATE_VIS weak_ptr;
@@ -5207,13 +5120,13 @@
 {
     typedef bool result_type;
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(shared_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
 };
 
@@ -5223,13 +5136,13 @@
 {
     typedef bool result_type;
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(  weak_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(  weak_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(shared_ptr<_Tp> const& __x,   weak_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const _NOEXCEPT
+    bool operator()(  weak_ptr<_Tp> const& __x, shared_ptr<_Tp> const& __y) const
         {return __x.owner_before(__y);}
 };
 
@@ -5239,19 +5152,19 @@
 {
     template <class _Tp, class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
+    bool operator()( shared_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()( shared_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const _NOEXCEPT
+    bool operator()( shared_ptr<_Tp> const& __x,  weak_ptr<_Up> const& __y) const
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(   weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const _NOEXCEPT
+    bool operator()(   weak_ptr<_Tp> const& __x, shared_ptr<_Up> const& __y) const
         {return __x.owner_before(__y);}
     template <class _Tp, class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    bool operator()(   weak_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const _NOEXCEPT
+    bool operator()(   weak_ptr<_Tp> const& __x,   weak_ptr<_Up> const& __y) const
         {return __x.owner_before(__y);}
     typedef void is_transparent;
 };
@@ -5328,8 +5241,7 @@
     friend _LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
 };
 
-_LIBCPP_FUNC_VIS _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
-__sp_mut& __get_sp_mut(const void*);
+_LIBCPP_FUNC_VIS __sp_mut& __get_sp_mut(const void*);
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -5340,7 +5252,6 @@
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load(const shared_ptr<_Tp>* __p)
 {
@@ -5353,7 +5264,6 @@
   
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
 {
@@ -5361,7 +5271,6 @@
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -5373,7 +5282,6 @@
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 void
 atomic_store_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -5381,7 +5289,6 @@
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r)
 {
@@ -5394,7 +5301,6 @@
   
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 shared_ptr<_Tp>
 atomic_exchange_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r, memory_order)
 {
@@ -5402,7 +5308,6 @@
 }
 
 template <class _Tp>
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -5424,7 +5329,6 @@
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w)
 {
@@ -5433,7 +5337,6 @@
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_strong_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                         shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5443,7 +5346,6 @@
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
-_LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR
 bool
 atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v,
                                       shared_ptr<_Tp> __w, memory_order, memory_order)
@@ -5576,6 +5478,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_MEMORY
diff --git a/include/module.modulemap b/include/module.modulemap
index 3194b5c..c354cae 100644
--- a/include/module.modulemap
+++ b/include/module.modulemap
@@ -484,7 +484,7 @@
   module __string { header "__string" export * }
   module __tree { header "__tree" export * }
   module __tuple { header "__tuple" export * }
-  module __undef_macros { header "__undef_macros" export * }
+  module __undef_min_max { header "__undef_min_max" export * }
 
   module experimental {
     requires cplusplus11
@@ -501,11 +501,6 @@
       header "experimental/chrono"
       export *
     }
-     module coroutine {
-      requires coroutines
-      header "experimental/coroutine"
-      export *
-    }
     module deque {
       header "experimental/deque"
       export *
diff --git a/include/mutex b/include/mutex
index 5538088..11b0f7e 100644
--- a/include/mutex
+++ b/include/mutex
@@ -109,17 +109,15 @@
     lock_guard& operator=(lock_guard const&) = delete;
 };
 
-template <class... MutexTypes>
-class scoped_lock // C++17
+template <class... MutexTypes> // Variadic lock_guard only provided in ABI V2.
+class lock_guard
 {
 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();
-    scoped_lock(scoped_lock const&) = delete;
-    scoped_lock& operator=(scoped_lock const&) = delete;
+    explicit lock_guard(MutexTypes&... m);
+    lock_guard(MutexTypes&... m, adopt_lock_t);
+    ~lock_guard();
+    lock_guard(lock_guard const&) = delete;
+    lock_guard& operator=(lock_guard const&) = delete;
 private:
     tuple<MutexTypes&...> pm; // exposition only
 };
@@ -191,19 +189,17 @@
 #include <__mutex_base>
 #include <functional>
 #include <memory>
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 #include <tuple>
 #endif
 #include <__threading_support>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 #ifndef _LIBCPP_HAS_NO_THREADS
@@ -345,7 +341,7 @@
     return 0;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _L0, class _L1, class _L2, class... _L3>
 int
@@ -364,7 +360,7 @@
     return __r;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 template <class _L0, class _L1>
 void
@@ -393,7 +389,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _L0, class _L1, class _L2, class ..._L3>
 void
@@ -468,97 +464,19 @@
     _VSTD::__unlock(__l2, __l3...);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
-#if _LIBCPP_STD_VER > 14
-template <class ..._Mutexes>
-class _LIBCPP_TEMPLATE_VIS scoped_lock;
-
-template <>
-class _LIBCPP_TEMPLATE_VIS scoped_lock<> {
-public:
-    explicit scoped_lock() {}
-    ~scoped_lock() = default;
-
-    _LIBCPP_INLINE_VISIBILITY
-    explicit scoped_lock(adopt_lock_t) {}
-
-    scoped_lock(scoped_lock const&) = delete;
-    scoped_lock& operator=(scoped_lock const&) = delete;
-};
-
-template <class _Mutex>
-class _LIBCPP_TEMPLATE_VIS scoped_lock<_Mutex> {
-public:
-    typedef _Mutex  mutex_type;
-private:
-    mutex_type& __m_;
-public:
-    explicit scoped_lock(mutex_type & __m) _LIBCPP_THREAD_SAFETY_ANNOTATION(acquire_capability(__m))
-        : __m_(__m) {__m_.lock();}
-
-    ~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))
-        : __m_(__m) {}
-    
-
-    scoped_lock(scoped_lock const&) = delete;
-    scoped_lock& operator=(scoped_lock const&) = delete;
-};
-
-template <class ..._MArgs>
-class _LIBCPP_TEMPLATE_VIS scoped_lock
-{
-    static_assert(sizeof...(_MArgs) > 1, "At least 2 lock types required");
-    typedef tuple<_MArgs&...> _MutexTuple;
-
-public:
-    _LIBCPP_INLINE_VISIBILITY
-    explicit scoped_lock(_MArgs&... __margs)
-      : __t_(__margs...)
-    {
-        _VSTD::lock(__margs...);
-    }
-
-    _LIBCPP_INLINE_VISIBILITY
-    scoped_lock(_MArgs&... __margs, adopt_lock_t)
-        : __t_(__margs...)
-    {
-    }
-
-    _LIBCPP_INLINE_VISIBILITY
-    ~scoped_lock() {
-        typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
-        __unlock_unpack(_Indices{}, __t_);
-    }
-
-    scoped_lock(scoped_lock const&) = delete;
-    scoped_lock& operator=(scoped_lock const&) = delete;
-
-private:
-    template <size_t ..._Indx>
-    _LIBCPP_INLINE_VISIBILITY
-    static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
-        _VSTD::__unlock(_VSTD::get<_Indx>(__mt)...);
-    }
-
-    _MutexTuple __t_;
-};
-
-#endif // _LIBCPP_STD_VER > 14
 #endif // !_LIBCPP_HAS_NO_THREADS
 
 struct _LIBCPP_TEMPLATE_VIS once_flag;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template<class _Callable, class... _Args>
 _LIBCPP_INLINE_VISIBILITY
 void call_once(once_flag&, _Callable&&, _Args&&...);
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_VARIADICS
 
 template<class _Callable>
 _LIBCPP_INLINE_VISIBILITY
@@ -568,7 +486,7 @@
 _LIBCPP_INLINE_VISIBILITY
 void call_once(once_flag&, const _Callable&);
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 struct _LIBCPP_TEMPLATE_VIS once_flag
 {
@@ -582,11 +500,11 @@
 
     unsigned long __state_;
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template<class _Callable, class... _Args>
     friend
     void call_once(once_flag&, _Callable&&, _Args&&...);
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_VARIADICS
     template<class _Callable>
     friend
     void call_once(once_flag&, _Callable&);
@@ -594,10 +512,10 @@
     template<class _Callable>
     friend
     void call_once(once_flag&, const _Callable&);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Fp>
 class __call_once_param
@@ -652,7 +570,7 @@
 
 _LIBCPP_FUNC_VIS void __call_once(volatile unsigned long&, void*, void(*)(void*));
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template<class _Callable, class... _Args>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -668,7 +586,7 @@
     }
 }
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_VARIADICS
 
 template<class _Callable>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -687,17 +605,72 @@
 void
 call_once(once_flag& __flag, const _Callable& __func)
 {
-    if (__libcpp_acquire_load(&__flag.__state_) != ~0ul)
+    if (__flag.__state_ != ~0ul)
     {
         __call_once_param<const _Callable> __p(__func);
         __call_once(__flag.__state_, &__p, &__call_once_proxy<const _Callable>);
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+
+#if defined(_LIBCPP_ABI_VARIADIC_LOCK_GUARD) \
+    && !defined(_LIBCPP_CXX03_LANG)
+template <>
+class _LIBCPP_TEMPLATE_VIS lock_guard<> {
+public:
+    explicit lock_guard() {}
+    ~lock_guard() = default;
+
+    _LIBCPP_INLINE_VISIBILITY
+    explicit lock_guard(adopt_lock_t) {}
+
+    lock_guard(lock_guard const&) = delete;
+    lock_guard& operator=(lock_guard const&) = delete;
+};
+
+template <class ..._MArgs>
+class _LIBCPP_TEMPLATE_VIS lock_guard
+{
+    static_assert(sizeof...(_MArgs) >= 2, "At least 2 lock types required");
+    typedef tuple<_MArgs&...> _MutexTuple;
+
+public:
+    _LIBCPP_INLINE_VISIBILITY
+    explicit lock_guard(_MArgs&... __margs)
+      : __t_(__margs...)
+    {
+        _VSTD::lock(__margs...);
+    }
+
+    _LIBCPP_INLINE_VISIBILITY
+    lock_guard(_MArgs&... __margs, adopt_lock_t)
+        : __t_(__margs...)
+    {
+    }
+
+    _LIBCPP_INLINE_VISIBILITY
+    ~lock_guard() {
+        typedef typename __make_tuple_indices<sizeof...(_MArgs)>::type _Indices;
+        __unlock_unpack(_Indices{}, __t_);
+    }
+
+    lock_guard(lock_guard const&) = delete;
+    lock_guard& operator=(lock_guard const&) = delete;
+
+private:
+    template <size_t ..._Indx>
+    _LIBCPP_INLINE_VISIBILITY
+    static void __unlock_unpack(__tuple_indices<_Indx...>, _MutexTuple& __mt) {
+        _VSTD::__unlock(_VSTD::get<_Indx>(__mt)...);
+    }
+
+    _MutexTuple __t_;
+};
+
+#endif // _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_MUTEX
diff --git a/include/new b/include/new
index 34df2ef..c0e7b2d 100644
--- a/include/new
+++ b/include/new
@@ -146,8 +146,9 @@
 
 #if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11)
 
-class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-    bad_array_length : public bad_alloc {
+class _LIBCPP_EXCEPTION_ABI bad_array_length
+    : public bad_alloc
+{
 public:
     bad_array_length() _NOEXCEPT;
     virtual ~bad_array_length() _NOEXCEPT;
@@ -181,7 +182,7 @@
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz) _THROW_BAD_ALLOC;
@@ -189,7 +190,7 @@
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::size_t __sz) _NOEXCEPT;
 #endif
 
 #ifndef _LIBCPP_HAS_NO_ALIGNED_ALLOCATION
@@ -198,7 +199,7 @@
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete(void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 
 _LIBCPP_OVERRIDABLE_FUNC_VIS void* operator new[](std::size_t __sz, std::align_val_t) _THROW_BAD_ALLOC;
@@ -206,7 +207,7 @@
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t) _NOEXCEPT;
 _LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::align_val_t, const std::nothrow_t&) _NOEXCEPT;
 #ifndef _LIBCPP_HAS_NO_SIZED_DEALLOCATION
-_LIBCPP_OVERRIDABLE_FUNC_VIS _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
+_LIBCPP_OVERRIDABLE_FUNC_VIS void  operator delete[](void* __p, std::size_t __sz, std::align_val_t) _NOEXCEPT;
 #endif
 #endif
 
@@ -237,9 +238,6 @@
 
 #ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED
 _LIBCPP_NORETURN inline _LIBCPP_ALWAYS_INLINE
-#ifndef _LIBCPP_NO_EXCEPTIONS
-_LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH
-#endif
 void __throw_bad_array_length()
 {
 #ifndef _LIBCPP_NO_EXCEPTIONS
diff --git a/include/numeric b/include/numeric
index 0e53ba3..8f25146 100644
--- a/include/numeric
+++ b/include/numeric
@@ -71,9 +71,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _InputIterator, class _Tp>
@@ -225,11 +222,11 @@
 
 
 template<class _Tp>
-_LIBCPP_CONSTEXPR _LIBCPP_HIDDEN
+_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
 _Tp __gcd(_Tp __m, _Tp __n)
 {
     static_assert((!is_signed<_Tp>::value), "");
-    return __n == 0 ? __m : _VSTD::__gcd<_Tp>(__n, __m % __n);
+    return __n == 0 ? __m : __gcd<_Tp>(__n, __m % __n);
 }
 
 
@@ -243,9 +240,8 @@
     static_assert((!is_same<typename remove_cv<_Up>::type, bool>::value), "Second argument to gcd cannot be bool" );
     using _Rp = common_type_t<_Tp,_Up>;
     using _Wp = make_unsigned_t<_Rp>;
-    return static_cast<_Rp>(_VSTD::__gcd(
-        static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
-        static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
+    return static_cast<_Rp>(__gcd(static_cast<_Wp>(__abs<_Rp, _Tp>()(__m)),
+                                  static_cast<_Wp>(__abs<_Rp, _Up>()(__n))));
 }
 
 template<class _Tp, class _Up>
@@ -260,7 +256,7 @@
         return 0;
 
     using _Rp = common_type_t<_Tp,_Up>;
-    _Rp __val1 = __abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
+    _Rp __val1 = __abs<_Rp, _Tp>()(__m) / gcd(__m, __n);
     _Rp __val2 = __abs<_Rp, _Up>()(__n);
     _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
     return __val1 * __val2;
@@ -270,6 +266,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_NUMERIC
diff --git a/include/optional b/include/optional
index c0fd0e7..180f63f 100644
--- a/include/optional
+++ b/include/optional
@@ -17,31 +17,29 @@
 // C++1z
 
 namespace std {
-  // 23.6.3, optional for object types
+  // 20.6.3, optional for object types
   template <class T> class optional;
 
-  // 23.6.4, no-value state indicator
+  // 20.6.4, no-value state indicator
   struct nullopt_t{see below };
   constexpr nullopt_t nullopt(unspecified );
 
-  // 23.6.5, class bad_optional_access
+  // 20.6.5, class bad_optional_access
   class bad_optional_access;
 
-  // 23.6.6, relational operators
-  template <class T, class U>
-  constexpr bool operator==(const optional<T>&, const optional<U>&);
-  template <class T, class U>
-  constexpr bool operator!=(const optional<T>&, const optional<U>&);
-  template <class T, class U>
-  constexpr bool operator<(const optional<T>&, const optional<U>&);
-  template <class T, class U>
-  constexpr bool operator>(const optional<T>&, const optional<U>&);
-  template <class T, class U>
-  constexpr bool operator<=(const optional<T>&, const optional<U>&);
-  template <class T, class U>
-  constexpr bool operator>=(const optional<T>&, const optional<U>&);
-
-  // 23.6.7 comparison with nullopt
+  // 20.6.6, relational operators
+  template <class T>
+  constexpr bool operator==(const optional<T>&, const optional<T>&);
+  template <class T>
+  constexpr bool operator!=(const optional<T>&, const optional<T>&);
+  template <class T>
+  constexpr bool operator<(const optional<T>&, const optional<T>&);
+  template <class T>
+  constexpr bool operator>(const optional<T>&, const optional<T>&);
+  template <class T>
+  constexpr bool operator<=(const optional<T>&, const optional<T>&);
+  template <class T>
+  constexpr bool operator>=(const optional<T>&, const optional<T>&);
   template <class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept;
   template <class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept;
   template <class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept;
@@ -55,21 +53,21 @@
   template <class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept;
   template <class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept;
 
-  // 23.6.8, comparison with T
-  template <class T, class U> constexpr bool operator==(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator==(const U&, const optional<T>&);
-  template <class T, class U> constexpr bool operator!=(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator!=(const U&, const optional<T>&);
-  template <class T, class U> constexpr bool operator<(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator<(const U&, const optional<T>&);
-  template <class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator<=(const U&, const optional<T>&);
-  template <class T, class U> constexpr bool operator>(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator>(const U&, const optional<T>&);
-  template <class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
-  template <class T, class U> constexpr bool operator>=(const U&, const optional<T>&);
+  // 20.6.8, comparison with T
+  template <class T> constexpr bool operator==(const optional<T>&, const T&);
+  template <class T> constexpr bool operator==(const T&, const optional<T>&);
+  template <class T> constexpr bool operator!=(const optional<T>&, const T&);
+  template <class T> constexpr bool operator!=(const T&, const optional<T>&);
+  template <class T> constexpr bool operator<(const optional<T>&, const T&);
+  template <class T> constexpr bool operator<(const T&, const optional<T>&);
+  template <class T> constexpr bool operator<=(const optional<T>&, const T&);
+  template <class T> constexpr bool operator<=(const T&, const optional<T>&);
+  template <class T> constexpr bool operator>(const optional<T>&, const T&);
+  template <class T> constexpr bool operator>(const T&, const optional<T>&);
+  template <class T> constexpr bool operator>=(const optional<T>&, const T&);
+  template <class T> constexpr bool operator>=(const T&, const optional<T>&);
 
-  // 23.6.9, specialized algorithms
+  // 20.6.9, specialized algorithms
   template <class T> void swap(optional<T>&, optional<T>&) noexcept(see below );
   template <class T> constexpr optional<see below > make_optional(T&&);
   template <class T, class... Args>
@@ -77,7 +75,7 @@
   template <class T, class U, class... Args>
     constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args);
 
-  // 23.6.10, hash support
+  // 20.6.10, hash support
   template <class T> struct hash;
   template <class T> struct hash<optional<T>>;
 
@@ -85,11 +83,11 @@
   public:
     using value_type = T;
 
-    // 23.6.3.1, constructors
+    // 20.6.3.1, constructors
     constexpr optional() noexcept;
     constexpr optional(nullopt_t) noexcept;
     optional(const optional &);
-    optional(optional &&) noexcept(see below);
+    optional(optional &&) noexcept(see below );
     template <class... Args> constexpr explicit optional(in_place_t, Args &&...);
     template <class U, class... Args>
       constexpr explicit optional(in_place_t, initializer_list<U>, Args &&...);
@@ -100,24 +98,24 @@
     template <class U>
       constexpr EXPLICIT optional(optional<U> &&);
 
-    // 23.6.3.2, destructor
+    // 20.6.3.2, destructor
     ~optional();
 
-    // 23.6.3.3, assignment
+    // 20.6.3.3, assignment
     optional &operator=(nullopt_t) noexcept;
     optional &operator=(const optional &);
     optional &operator=(optional &&) noexcept(see below );
     template <class U = T> optional &operator=(U &&);
     template <class U> optional &operator=(const optional<U> &);
     template <class U> optional &operator=(optional<U> &&);
-    template <class... Args> T& emplace(Args &&...);
+    template <class... Args> void emplace(Args &&...);
     template <class U, class... Args>
-      T& emplace(initializer_list<U>, Args &&...);
+      void emplace(initializer_list<U>, Args &&...);
 
-    // 23.6.3.4, swap
+    // 20.6.3.4, swap
     void swap(optional &) noexcept(see below );
 
-    // 23.6.3.5, observers
+    // 20.6.3.5, observers
     constexpr T const *operator->() const;
     constexpr T *operator->();
     constexpr T const &operator*() const &;
@@ -133,7 +131,7 @@
     template <class U> constexpr T value_or(U &&) const &;
     template <class U> constexpr T value_or(U &&) &&;
 
-    // 23.6.3.6, modifiers
+    // 20.6.3.6, modifiers
     void reset() noexcept;
 
   private:
@@ -146,6 +144,7 @@
 #include <__config>
 #include <__debug>
 #include <__functional_base>
+#include <__undef_min_max>
 #include <functional>
 #include <initializer_list>
 #include <new>
@@ -157,10 +156,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 namespace std  // purposefully not using versioning namespace
 {
 
@@ -536,7 +531,7 @@
     };
     template <class _Up>
     using _CheckOptionalArgsCtor = conditional_t<
-        !is_same_v<decay_t<_Up>, in_place_t> &&
+        !is_same_v<in_place_t, _Up> &&
         !is_same_v<decay_t<_Up>, optional>,
         _CheckOptionalArgsConstructor,
         __check_tuple_constructor_fail
@@ -602,8 +597,8 @@
 public:
 
     _LIBCPP_INLINE_VISIBILITY constexpr optional() noexcept {}
-    _LIBCPP_INLINE_VISIBILITY constexpr optional(const optional&) = default;
-    _LIBCPP_INLINE_VISIBILITY constexpr optional(optional&&) = default;
+    _LIBCPP_INLINE_VISIBILITY optional(const optional&) = default;
+    _LIBCPP_INLINE_VISIBILITY optional(optional&&) = default;
     _LIBCPP_INLINE_VISIBILITY constexpr optional(nullopt_t) noexcept {}
 
     template <class... _Args, class = enable_if_t<
@@ -734,12 +729,11 @@
                       >
              >
     _LIBCPP_INLINE_VISIBILITY
-    _Tp &
+    void
     emplace(_Args&&... __args)
     {
         reset();
         this->__construct(_VSTD::forward<_Args>(__args)...);
-        return this->__get();
     }
 
     template <class _Up, class... _Args,
@@ -749,12 +743,11 @@
                       >
              >
     _LIBCPP_INLINE_VISIBILITY
-    _Tp &
+    void
     emplace(initializer_list<_Up> __il, _Args&&... __args)
     {
         reset();
         this->__construct(__il, _VSTD::forward<_Args>(__args)...);
-        return this->__get();
     }
 
     _LIBCPP_INLINE_VISIBILITY
@@ -897,7 +890,7 @@
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    constexpr value_type value_or(_Up&& __v) &&
+    value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible_v<value_type>,
                       "optional<T>::value_or: T must be move constructible");
@@ -928,14 +921,14 @@
 };
 
 // Comparisons between optionals
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator==(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator==(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (static_cast<bool>(__x) != static_cast<bool>(__y))
         return false;
@@ -944,14 +937,14 @@
     return *__x == *__y;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator!=(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator!=(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (static_cast<bool>(__x) != static_cast<bool>(__y))
         return true;
@@ -960,14 +953,14 @@
     return *__x != *__y;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator<(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (!static_cast<bool>(__y))
         return false;
@@ -976,14 +969,14 @@
     return *__x < *__y;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator>(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (!static_cast<bool>(__x))
         return false;
@@ -992,14 +985,14 @@
     return *__x > *__y;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<=(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator<=(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (!static_cast<bool>(__x))
         return true;
@@ -1008,14 +1001,14 @@
     return *__x <= *__y;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>=(const optional<_Tp>& __x, const optional<_Up>& __y)
+operator>=(const optional<_Tp>& __x, const optional<_Tp>& __y)
 {
     if (!static_cast<bool>(__y))
         return true;
@@ -1122,146 +1115,146 @@
 }
 
 // Comparisons with T
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator==(const optional<_Tp>& __x, const _Up& __v)
+operator==(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x == __v : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() ==
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator==(const _Tp& __v, const optional<_Up>& __x)
+operator==(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v == *__x : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator!=(const optional<_Tp>& __x, const _Up& __v)
+operator!=(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x != __v : true;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() !=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator!=(const _Tp& __v, const optional<_Up>& __x)
+operator!=(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v != *__x : true;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<(const optional<_Tp>& __x, const _Up& __v)
+operator<(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x < __v : true;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<(const _Tp& __v, const optional<_Up>& __x)
+operator<(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v < *__x : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<=(const optional<_Tp>& __x, const _Up& __v)
+operator<=(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x <= __v : true;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() <=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator<=(const _Tp& __v, const optional<_Up>& __x)
+operator<=(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v <= *__x : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>(const optional<_Tp>& __x, const _Up& __v)
+operator>(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x > __v : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>(const _Tp& __v, const optional<_Up>& __x)
+operator>(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v > *__x : true;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>=(const optional<_Tp>& __x, const _Up& __v)
+operator>=(const optional<_Tp>& __x, const _Tp& __v)
 {
     return static_cast<bool>(__x) ? *__x >= __v : false;
 }
 
-template <class _Tp, class _Up>
+template <class _Tp>
 _LIBCPP_INLINE_VISIBILITY constexpr
 enable_if_t<
     is_convertible_v<decltype(_VSTD::declval<const _Tp&>() >=
-        _VSTD::declval<const _Up&>()), bool>,
+        _VSTD::declval<const _Tp&>()), bool>,
     bool
 >
-operator>=(const _Tp& __v, const optional<_Up>& __x)
+operator>=(const _Tp& __v, const optional<_Tp>& __x)
 {
     return static_cast<bool>(__x) ? __v >= *__x : true;
 }
@@ -1308,7 +1301,7 @@
     typedef size_t        result_type;
 
     _LIBCPP_INLINE_VISIBILITY
-    result_type operator()(const argument_type& __opt) const
+    result_type operator()(const argument_type& __opt) const _NOEXCEPT
     {
         return static_cast<bool>(__opt) ? hash<remove_const_t<_Tp>>()(*__opt) : 0;
     }
@@ -1318,6 +1311,4 @@
 
 #endif  // _LIBCPP_STD_VER > 14
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_OPTIONAL
diff --git a/include/ostream b/include/ostream
index 9bf8d3c..3d9be8b 100644
--- a/include/ostream
+++ b/include/ostream
@@ -165,11 +165,13 @@
     { this->init(__sb); }
     virtual ~basic_ostream();
 protected:
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_ostream(basic_ostream&& __rhs);
+#endif
 
     // 27.7.2.3 Assign/swap
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_ostream& operator=(basic_ostream&& __rhs);
 #endif
@@ -288,7 +290,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>::basic_ostream(basic_ostream&& __rhs)
@@ -304,7 +306,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits>
 basic_ostream<_CharT, _Traits>::~basic_ostream()
@@ -1021,7 +1023,7 @@
     return __os;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Stream, class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1037,7 +1039,7 @@
     return _VSTD::move(__os);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _CharT, class _Traits, class _Allocator>
 basic_ostream<_CharT, _Traits>&
@@ -1080,10 +1082,8 @@
                          use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
 }
 
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>)
-#endif
 
 _LIBCPP_END_NAMESPACE_STD
 
diff --git a/include/queue b/include/queue
index feaae89..57d420c 100644
--- a/include/queue
+++ b/include/queue
@@ -213,27 +213,29 @@
     _LIBCPP_INLINE_VISIBILITY
     queue(const queue& __q) : c(__q.c) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    queue& operator=(const queue& __q) {c = __q.c; return *this;}
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     queue(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
         : c(_VSTD::move(__q.c)) {}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
+    queue& operator=(const queue& __q) {c = __q.c; return *this;}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     queue& operator=(queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
         {c = _VSTD::move(__q.c); return *this;}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit queue(const container_type& __c)  : c(__c) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit queue(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit queue(const _Alloc& __a,
@@ -252,7 +254,7 @@
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type* = 0)
             : c(__c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         queue(container_type&& __c, const _Alloc& __a,
@@ -266,7 +268,7 @@
                                                          _Alloc>::value>::type* = 0)
             : c(_VSTD::move(__q.c), __a) {}
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     bool      empty() const {return c.empty();}
@@ -284,9 +286,10 @@
 
     _LIBCPP_INLINE_VISIBILITY
     void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void push(value_type&& __v)      {c.push_back(_VSTD::move(__v));}
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
 #if _LIBCPP_STD_VER > 14
@@ -296,7 +299,8 @@
         void     emplace(_Args&&... __args)
             {        c.emplace_back(_VSTD::forward<_Args>(__args)...);}
 #endif
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void pop() {c.pop_front();}
 
@@ -414,30 +418,32 @@
     _LIBCPP_INLINE_VISIBILITY
     priority_queue(const priority_queue& __q) : c(__q.c), comp(__q.comp) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    priority_queue& operator=(const priority_queue& __q)
-        {c = __q.c; comp = __q.comp; return *this;}
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     priority_queue(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value &&
                    is_nothrow_move_constructible<value_compare>::value)
         : c(_VSTD::move(__q.c)), comp(_VSTD::move(__q.comp)) {}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
+    priority_queue& operator=(const priority_queue& __q)
+        {c = __q.c; comp = __q.comp; return *this;}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     priority_queue& operator=(priority_queue&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value &&
                    is_nothrow_move_assignable<value_compare>::value)
         {c = _VSTD::move(__q.c); comp = _VSTD::move(__q.comp); return *this;}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit priority_queue(const value_compare& __comp)
         : c(), comp(__comp) {}
     _LIBCPP_INLINE_VISIBILITY
     priority_queue(const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit priority_queue(const value_compare& __comp, container_type&& __c);
 #endif
@@ -449,12 +455,12 @@
         _LIBCPP_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, const container_type& __c);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIter>
         _LIBCPP_INLINE_VISIBILITY
         priority_queue(_InputIter __f, _InputIter __l,
                        const value_compare& __comp, container_type&& __c);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit priority_queue(const _Alloc& __a,
@@ -476,7 +482,7 @@
         priority_queue(const priority_queue& __q, const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type* = 0);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         priority_queue(const value_compare& __comp, container_type&& __c,
@@ -488,7 +494,7 @@
         priority_queue(priority_queue&& __q, const _Alloc& __a,
                        typename enable_if<uses_allocator<container_type,
                                                          _Alloc>::value>::type* = 0);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     bool            empty() const {return c.empty();}
@@ -499,13 +505,13 @@
 
     _LIBCPP_INLINE_VISIBILITY
     void push(const value_type& __v);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void push(value_type&& __v);
-    template <class... _Args>
-    _LIBCPP_INLINE_VISIBILITY
-    void emplace(_Args&&... __args);
-#endif  // _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+    template <class... _Args> _LIBCPP_INLINE_VISIBILITY void emplace(_Args&&... __args);
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void pop();
 
@@ -525,7 +531,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 inline
@@ -537,7 +543,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter>
@@ -563,7 +569,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 template <class _InputIter>
@@ -578,7 +584,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 template <class _Alloc>
@@ -629,7 +635,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 template <class _Alloc>
@@ -658,7 +664,7 @@
     _VSTD::make_heap(c.begin(), c.end(), comp);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 inline
@@ -669,7 +675,7 @@
     _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 inline
@@ -680,6 +686,8 @@
     _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Container, class _Compare>
 template <class... _Args>
 inline
@@ -690,7 +698,8 @@
     _VSTD::push_heap(c.begin(), c.end(), comp);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Container, class _Compare>
 inline
diff --git a/include/random b/include/random
index ba8a088..835ebdb 100644
--- a/include/random
+++ b/include/random
@@ -1646,14 +1646,12 @@
 #include <istream>
 #include <ostream>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // __is_seed_sequence
@@ -2015,41 +2013,41 @@
           _UIntType __b, size_t __t, _UIntType __c, size_t __l, _UIntType __f>
 class _LIBCPP_TEMPLATE_VIS mersenne_twister_engine;
 
-template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 bool
-operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
 
-template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 _LIBCPP_INLINE_VISIBILITY
 bool
-operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+          class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x);
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+          class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
-           mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                    _Bp, _Tp, _Cp, _Lp, _Fp>& __x);
 
 template <class _UIntType, size_t __w, size_t __n, size_t __m, size_t __r,
@@ -2131,44 +2129,44 @@
     _LIBCPP_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
-    template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-              _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-              _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+    template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+              _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+              _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
     friend
     bool
-    operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+    operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                              _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-               const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+               const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                              _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
 
-    template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-              _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-              _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+    template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+              _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+              _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
     friend
     bool
-    operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+    operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                              _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-               const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+               const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                              _Bp, _Tp, _Cp, _Lp, _Fp>& __y);
 
     template <class _CharT, class _Traits,
-              class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-              _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-              _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+              class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+              _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+              _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
     friend
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os,
-               const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+               const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                              _Bp, _Tp, _Cp, _Lp, _Fp>& __x);
 
     template <class _CharT, class _Traits,
-              class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-              _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-              _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+              class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+              _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+              _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
     friend
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is,
-               mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+               mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                        _Bp, _Tp, _Cp, _Lp, _Fp>& __x);
 private:
 
@@ -2386,13 +2384,13 @@
     return __z ^ __rshift<__l>(__z);
 }
 
-template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 bool
-operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+operator==(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __y)
 {
     if (__x.__i_ == __y.__i_)
@@ -2430,26 +2428,26 @@
                        __x.__x_ + (_Np - (__y.__i_ + __j)));
 }
 
-template <class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+template <class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
-operator!=(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+operator!=(const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __y)
 {
     return !(__x == __y);
 }
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+          class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
-           const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           const mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                          _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
 {
     __save_flags<_CharT, _Traits> __lx(__os);
@@ -2465,17 +2463,17 @@
 }
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
-          _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp,
-          _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp>
+          class _UI, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp,
+          _UI _Ap, size_t _Up, _UI _Dp, size_t _Sp,
+          _UI _Bp, size_t _Tp, _UI _Cp, size_t _Lp, _UI _Fp>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
-           mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
+           mersenne_twister_engine<_UI, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp,
                                    _Bp, _Tp, _Cp, _Lp, _Fp>& __x)
 {
     __save_flags<_CharT, _Traits> __lx(__is);
     __is.flags(ios_base::dec | ios_base::skipws);
-    _UInt __t[_Np];
+    _UI __t[_Np];
     for (size_t __i = 0; __i < _Np; ++__i)
         __is >> __t[__i];
     if (!__is.fail())
@@ -2503,30 +2501,30 @@
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
 class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine;
 
-template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 bool
 operator==(
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y);
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
 
-template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 _LIBCPP_INLINE_VISIBILITY
 bool
 operator!=(
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y);
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+          class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
-           const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
+           const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+          class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
-           subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
+           subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
 
 template<class _UIntType, size_t __w, size_t __s, size_t __r>
 class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine
@@ -2588,33 +2586,33 @@
     _LIBCPP_INLINE_VISIBILITY
     void discard(unsigned long long __z) {for (; __z; --__z) operator()();}
 
-    template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+    template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
     friend
     bool
     operator==(
-        const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-        const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y);
+        const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+        const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
 
-    template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+    template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
     friend
     bool
     operator!=(
-        const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-        const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y);
+        const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+        const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y);
 
     template <class _CharT, class _Traits,
-              class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+              class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
     friend
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os,
-               const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
+               const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
 
     template <class _CharT, class _Traits,
-              class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+              class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
     friend
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is,
-               subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x);
+               subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x);
 
 private:
 
@@ -2713,11 +2711,11 @@
     return __xr;
 }
 
-template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 bool
 operator==(
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y)
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y)
 {
     if (__x.__c_ != __y.__c_)
         return false;
@@ -2756,21 +2754,21 @@
                        __x.__x_ + (_Rp - (__y.__i_ + __j)));
 }
 
-template<class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+template<class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
 operator!=(
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x,
-    const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y)
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x,
+    const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __y)
 {
     return !(__x == __y);
 }
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+          class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
-           const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
+           const subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x)
 {
     __save_flags<_CharT, _Traits> __lx(__os);
     __os.flags(ios_base::dec | ios_base::left);
@@ -2786,14 +2784,14 @@
 }
 
 template <class _CharT, class _Traits,
-          class _UInt, size_t _Wp, size_t _Sp, size_t _Rp>
+          class _UI, size_t _Wp, size_t _Sp, size_t _Rp>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
-           subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x)
+           subtract_with_carry_engine<_UI, _Wp, _Sp, _Rp>& __x)
 {
     __save_flags<_CharT, _Traits> __lx(__is);
     __is.flags(ios_base::dec | ios_base::skipws);
-    _UInt __t[_Rp+1];
+    _UI __t[_Rp+1];
     for (size_t __i = 0; __i < _Rp+1; ++__i)
         __is >> __t[__i];
     if (!__is.fail())
@@ -2828,7 +2826,7 @@
     static _LIBCPP_CONSTEXPR const size_t block_size = __p;
     static _LIBCPP_CONSTEXPR const size_t used_block = __r;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     static const result_type _Min = _Engine::_Min;
     static const result_type _Max = _Engine::_Max;
 #else
@@ -2847,11 +2845,11 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit discard_block_engine(const _Engine& __e)
         : __e_(__e), __n_(0) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit discard_block_engine(_Engine&& __e)
         : __e_(_VSTD::move(__e)), __n_(0) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit discard_block_engine(result_type __sd) : __e_(__sd), __n_(0) {}
     template<class _Sseq>
@@ -2988,13 +2986,13 @@
 template<class _Engine, size_t __w, class _UIntType>
 class _LIBCPP_TEMPLATE_VIS independent_bits_engine
 {
-    template <class _UInt, _UInt _R0, size_t _Wp, size_t _Mp>
+    template <class _UI, _UI _R0, size_t _Wp, size_t _Mp>
     class __get_n
     {
-        static _LIBCPP_CONSTEXPR const size_t _Dt = numeric_limits<_UInt>::digits;
+        static _LIBCPP_CONSTEXPR const size_t _Dt = numeric_limits<_UI>::digits;
         static _LIBCPP_CONSTEXPR const size_t _Np = _Wp / _Mp + (_Wp % _Mp != 0);
         static _LIBCPP_CONSTEXPR const size_t _W0 = _Wp / _Np;
-        static _LIBCPP_CONSTEXPR const _UInt _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
+        static _LIBCPP_CONSTEXPR const _UI _Y0 = _W0 >= _Dt ? 0 : (_R0 >> _W0) << _W0;
     public:
         static _LIBCPP_CONSTEXPR const size_t value = _R0 - _Y0 > _Y0 / _Np ? _Np + 1 : _Np;
     };
@@ -3016,7 +3014,7 @@
                 result_type,
                 _Engine_result_type
         >::type _Working_result_type;
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     static const _Working_result_type _Rp = _Engine::_Max - _Engine::_Min
                                           + _Working_result_type(1);
 #else
@@ -3057,11 +3055,11 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit independent_bits_engine(const _Engine& __e)
         : __e_(__e) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit independent_bits_engine(_Engine&& __e)
         : __e_(_VSTD::move(__e)) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit independent_bits_engine(result_type __sd) : __e_(__sd) {}
     template<class _Sseq>
@@ -3093,33 +3091,33 @@
     _LIBCPP_INLINE_VISIBILITY
     const _Engine& base() const _NOEXCEPT {return __e_;}
 
-    template<class _Eng, size_t _Wp, class _UInt>
+    template<class _Eng, size_t _Wp, class _UI>
     friend
     bool
     operator==(
-        const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
-        const independent_bits_engine<_Eng, _Wp, _UInt>& __y);
+        const independent_bits_engine<_Eng, _Wp, _UI>& __x,
+        const independent_bits_engine<_Eng, _Wp, _UI>& __y);
 
-    template<class _Eng, size_t _Wp, class _UInt>
+    template<class _Eng, size_t _Wp, class _UI>
     friend
     bool
     operator!=(
-        const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
-        const independent_bits_engine<_Eng, _Wp, _UInt>& __y);
+        const independent_bits_engine<_Eng, _Wp, _UI>& __x,
+        const independent_bits_engine<_Eng, _Wp, _UI>& __y);
 
     template <class _CharT, class _Traits,
-              class _Eng, size_t _Wp, class _UInt>
+              class _Eng, size_t _Wp, class _UI>
     friend
     basic_ostream<_CharT, _Traits>&
     operator<<(basic_ostream<_CharT, _Traits>& __os,
-               const independent_bits_engine<_Eng, _Wp, _UInt>& __x);
+               const independent_bits_engine<_Eng, _Wp, _UI>& __x);
 
     template <class _CharT, class _Traits,
-              class _Eng, size_t _Wp, class _UInt>
+              class _Eng, size_t _Wp, class _UI>
     friend
     basic_istream<_CharT, _Traits>&
     operator>>(basic_istream<_CharT, _Traits>& __is,
-               independent_bits_engine<_Eng, _Wp, _UInt>& __x);
+               independent_bits_engine<_Eng, _Wp, _UI>& __x);
 
 private:
     _LIBCPP_INLINE_VISIBILITY
@@ -3181,40 +3179,40 @@
     return _Sp;
 }
 
-template<class _Eng, size_t _Wp, class _UInt>
+template<class _Eng, size_t _Wp, class _UI>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
 operator==(
-    const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
-    const independent_bits_engine<_Eng, _Wp, _UInt>& __y)
+    const independent_bits_engine<_Eng, _Wp, _UI>& __x,
+    const independent_bits_engine<_Eng, _Wp, _UI>& __y)
 {
     return __x.base() == __y.base();
 }
 
-template<class _Eng, size_t _Wp, class _UInt>
+template<class _Eng, size_t _Wp, class _UI>
 inline _LIBCPP_INLINE_VISIBILITY
 bool
 operator!=(
-    const independent_bits_engine<_Eng, _Wp, _UInt>& __x,
-    const independent_bits_engine<_Eng, _Wp, _UInt>& __y)
+    const independent_bits_engine<_Eng, _Wp, _UI>& __x,
+    const independent_bits_engine<_Eng, _Wp, _UI>& __y)
 {
     return !(__x == __y);
 }
 
 template <class _CharT, class _Traits,
-          class _Eng, size_t _Wp, class _UInt>
+          class _Eng, size_t _Wp, class _UI>
 basic_ostream<_CharT, _Traits>&
 operator<<(basic_ostream<_CharT, _Traits>& __os,
-           const independent_bits_engine<_Eng, _Wp, _UInt>& __x)
+           const independent_bits_engine<_Eng, _Wp, _UI>& __x)
 {
     return __os << __x.base();
 }
 
 template <class _CharT, class _Traits,
-          class _Eng, size_t _Wp, class _UInt>
+          class _Eng, size_t _Wp, class _UI>
 basic_istream<_CharT, _Traits>&
 operator>>(basic_istream<_CharT, _Traits>& __is,
-           independent_bits_engine<_Eng, _Wp, _UInt>& __x)
+           independent_bits_engine<_Eng, _Wp, _UI>& __x)
 {
     _Eng __e;
     __is >> __e;
@@ -3266,7 +3264,7 @@
     // engine characteristics
     static _LIBCPP_CONSTEXPR const size_t table_size = __k;
 
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     static const result_type _Min = _Engine::_Min;
     static const result_type _Max = _Engine::_Max;
 #else
@@ -3287,11 +3285,11 @@
     _LIBCPP_INLINE_VISIBILITY
     explicit shuffle_order_engine(const _Engine& __e)
         : __e_(__e) {__init();}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit shuffle_order_engine(_Engine&& __e)
         : __e_(_VSTD::move(__e)) {__init();}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit shuffle_order_engine(result_type __sd) : __e_(__sd) {__init();}
     template<class _Sseq>
@@ -3528,11 +3526,11 @@
     // constructors
     _LIBCPP_INLINE_VISIBILITY
     seed_seq() _NOEXCEPT {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template<class _Tp>
         _LIBCPP_INLINE_VISIBILITY
         seed_seq(initializer_list<_Tp> __il) {init(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template<class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
@@ -3639,7 +3637,7 @@
 {
     const size_t _Dt = numeric_limits<_RealType>::digits;
     const size_t __b = _Dt < __bits ? _Dt : __bits;
-#ifdef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_HAS_NO_CONSTEXPR
     const size_t __logR = __log2<uint64_t, _URNG::_Max - _URNG::_Min + uint64_t(1)>::value;
 #else
     const size_t __logR = __log2<uint64_t, _URNG::max() - _URNG::min() + uint64_t(1)>::value;
@@ -3999,30 +3997,16 @@
         {return !(__x == __y);}
 };
 
-#ifndef _LIBCPP_MSVCRT
-extern "C" double lgamma_r(double, int *);
-#endif
-
-inline _LIBCPP_INLINE_VISIBILITY double __libcpp_lgamma(double __d) {
-#if defined(_LIBCPP_MSVCRT)
-  return lgamma(__d);
-#else
-  int __sign;
-  return lgamma_r(__d, &__sign);
-#endif
-}
-
 template<class _IntType>
-binomial_distribution<_IntType>::param_type::param_type(const result_type __t, const double __p)
+binomial_distribution<_IntType>::param_type::param_type(result_type __t, double __p)
     : __t_(__t), __p_(__p)
 {
     if (0 < __p_ && __p_ < 1)
     {
         __r0_ = static_cast<result_type>((__t_ + 1) * __p_);
-        __pr_ = _VSTD::exp(__libcpp_lgamma(__t_ + 1.) -
-                           __libcpp_lgamma(__r0_ + 1.) -
-                           __libcpp_lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
-                           (__t_ - __r0_) * _VSTD::log(1 - __p_));
+        __pr_ = _VSTD::exp(_VSTD::lgamma(__t_ + 1.) - _VSTD::lgamma(__r0_ + 1.) -
+                          _VSTD::lgamma(__t_ - __r0_ + 1.) + __r0_ * _VSTD::log(__p_) +
+                          (__t_ - __r0_) * _VSTD::log(1 - __p_));
         __odds_ratio_ = __p_ / (1 - __p_);
     }
 }
@@ -5867,11 +5851,11 @@
             _LIBCPP_INLINE_VISIBILITY
             param_type(_InputIterator __f, _InputIterator __l)
             : __p_(__f, __l) {__init();}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         _LIBCPP_INLINE_VISIBILITY
         param_type(initializer_list<double> __wl)
             : __p_(__wl.begin(), __wl.end()) {__init();}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         template<class _UnaryOperation>
             param_type(size_t __nw, double __xmin, double __xmax,
                        _UnaryOperation __fw);
@@ -5914,11 +5898,11 @@
         _LIBCPP_INLINE_VISIBILITY
         discrete_distribution(_InputIterator __f, _InputIterator __l)
             : __p_(__f, __l) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     discrete_distribution(initializer_list<double> __wl)
         : __p_(__wl) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template<class _UnaryOperation>
         _LIBCPP_INLINE_VISIBILITY
         discrete_distribution(size_t __nw, double __xmin, double __xmax,
@@ -6095,10 +6079,10 @@
         template<class _InputIteratorB, class _InputIteratorW>
             param_type(_InputIteratorB __fB, _InputIteratorB __lB,
                        _InputIteratorW __fW);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         template<class _UnaryOperation>
             param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         template<class _UnaryOperation>
             param_type(size_t __nw, result_type __xmin, result_type __xmax,
                        _UnaryOperation __fw);
@@ -6148,13 +6132,13 @@
                                         _InputIteratorW __fW)
         : __p_(__fB, __lB, __fW) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template<class _UnaryOperation>
         _LIBCPP_INLINE_VISIBILITY
         piecewise_constant_distribution(initializer_list<result_type> __bl,
                                         _UnaryOperation __fw)
         : __p_(__bl, __fw) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template<class _UnaryOperation>
         _LIBCPP_INLINE_VISIBILITY
@@ -6284,7 +6268,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -6309,7 +6293,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -6418,10 +6402,10 @@
         template<class _InputIteratorB, class _InputIteratorW>
             param_type(_InputIteratorB __fB, _InputIteratorB __lB,
                        _InputIteratorW __fW);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         template<class _UnaryOperation>
             param_type(initializer_list<result_type> __bl, _UnaryOperation __fw);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
         template<class _UnaryOperation>
             param_type(size_t __nw, result_type __xmin, result_type __xmax,
                        _UnaryOperation __fw);
@@ -6471,13 +6455,13 @@
                                       _InputIteratorW __fW)
         : __p_(__fB, __lB, __fW) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template<class _UnaryOperation>
         _LIBCPP_INLINE_VISIBILITY
         piecewise_linear_distribution(initializer_list<result_type> __bl,
                                       _UnaryOperation __fw)
         : __p_(__bl, __fw) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template<class _UnaryOperation>
         _LIBCPP_INLINE_VISIBILITY
@@ -6611,7 +6595,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -6636,7 +6620,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template<class _RealType>
 template<class _UnaryOperation>
@@ -6738,6 +6722,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_RANDOM
diff --git a/include/ratio b/include/ratio
index 27aa0de..fa89363 100644
--- a/include/ratio
+++ b/include/ratio
@@ -83,14 +83,12 @@
 #include <climits>
 #include <type_traits>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // __static_gcd
@@ -522,6 +520,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_RATIO
diff --git a/include/regex b/include/regex
index b70e313..2b4c5aa 100644
--- a/include/regex
+++ b/include/regex
@@ -765,14 +765,12 @@
 #include <vector>
 #include <deque>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 namespace regex_constants
@@ -2547,14 +2545,14 @@
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
           __end_(0)
         {__parse(__first, __last);}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_regex(initializer_list<value_type> __il,
                 flag_type __f = regex_constants::ECMAScript)
         : __flags_(__f), __marked_count_(0), __loop_count_(0), __open_count_(0),
           __end_(0)
         {__parse(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 //    ~basic_regex() = default;
 
@@ -2563,11 +2561,11 @@
     _LIBCPP_INLINE_VISIBILITY
     basic_regex& operator=(const value_type* __p)
         {return assign(__p);}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_regex& operator=(initializer_list<value_type> __il)
         {return assign(__il);}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template <class _ST, class _SA>
         _LIBCPP_INLINE_VISIBILITY
         basic_regex& operator=(const basic_string<value_type, _ST, _SA>& __p)
@@ -2577,7 +2575,7 @@
     _LIBCPP_INLINE_VISIBILITY
     basic_regex& assign(const basic_regex& __that)
         {return *this = __that;}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_regex& assign(basic_regex&& __that) _NOEXCEPT
         {return *this = _VSTD::move(__that);}
@@ -2634,14 +2632,14 @@
             return assign(basic_regex(__first, __last, __f));
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     basic_regex& assign(initializer_list<value_type> __il,
                         flag_type __f = regex_constants::ECMAScript)
         {return assign(__il.begin(), __il.end(), __f);}
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     // const operations:
     _LIBCPP_INLINE_VISIBILITY
@@ -3965,6 +3963,7 @@
     if (__temp == __last)
         __throw_regex_error<regex_constants::error_brack>();
     // [__first, __temp) contains all text in [= ... =]
+    typedef typename _Traits::string_type string_type;
     string_type __collate_name =
         __traits_.lookup_collatename(__first, __temp);
     if (__collate_name.empty())
@@ -6221,7 +6220,7 @@
                                      regex_constants::match_default) = delete;
 #endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     regex_token_iterator(_BidirectionalIterator __a, _BidirectionalIterator __b,
                          const regex_type& __re,
                          initializer_list<int> __submatches,
@@ -6235,7 +6234,7 @@
                          regex_constants::match_flag_type __m =
                                        regex_constants::match_default) = delete;
 #endif
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     template <size_t _Np>
         regex_token_iterator(_BidirectionalIterator __a,
                              _BidirectionalIterator __b,
@@ -6335,7 +6334,7 @@
     __init(__a, __b);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 regex_token_iterator<_BidirectionalIterator, _CharT, _Traits>::
@@ -6350,7 +6349,7 @@
     __init(__a, __b);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _BidirectionalIterator, class _CharT, class _Traits>
 template <size_t _Np>
@@ -6570,6 +6569,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_REGEX
diff --git a/include/set b/include/set
index 30f2fa8..be5c952 100644
--- a/include/set
+++ b/include/set
@@ -486,12 +486,12 @@
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     set(set&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
         : __tree_(_VSTD::move(__s.__tree_)) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit set(const allocator_type& __a)
@@ -504,9 +504,11 @@
             insert(__s.begin(), __s.end());
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     set(set&& __s, const allocator_type& __a);
+#endif
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     set(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
         : __tree_(__comp)
@@ -534,7 +536,9 @@
             __tree_.__assign_unique(__il.begin(), __il.end());
             return *this;
         }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     set& operator=(set&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
@@ -542,7 +546,7 @@
             __tree_ = _VSTD::move(__s.__tree_);
             return *this;
         }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT       {return __tree_.begin();}
@@ -583,7 +587,7 @@
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_Args&&... __args)
@@ -592,15 +596,23 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
             {return __tree_.__emplace_hint_unique(__p, _VSTD::forward<_Args>(__args)...);}
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator,bool> insert(const value_type& __v)
         {return __tree_.__insert_unique(__v);}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    pair<iterator,bool> insert(value_type&& __v)
+        {return __tree_.__insert_unique(_VSTD::move(__v));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
         {return __tree_.__insert_unique(__p, __v);}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, value_type&& __v)
+        {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
@@ -609,19 +621,11 @@
                 __tree_.__insert_unique(__e, *__f);
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    pair<iterator,bool> insert(value_type&& __v)
-        {return __tree_.__insert_unique(_VSTD::move(__v));}
-
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_unique(__p, _VSTD::move(__v));}
-
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     iterator  erase(const_iterator __p) {return __tree_.erase(__p);}
@@ -723,7 +727,7 @@
 #endif
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Compare, class _Allocator>
 set<_Key, _Compare, _Allocator>::set(set&& __s, const allocator_type& __a)
@@ -737,7 +741,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Compare, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -897,14 +901,12 @@
             return *this;
         }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     multiset(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_constructible<__base>::value)
         : __tree_(_VSTD::move(__s.__tree_)) {}
-
-    multiset(multiset&& __s, const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     explicit multiset(const allocator_type& __a)
         : __tree_(__a) {}
@@ -914,8 +916,11 @@
         {
             insert(__s.begin(), __s.end());
         }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    multiset(multiset&& __s, const allocator_type& __a);
+#endif
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     multiset(initializer_list<value_type> __il, const value_compare& __comp = value_compare())
         : __tree_(__comp)
@@ -943,7 +948,9 @@
             __tree_.__assign_multi(__il.begin(), __il.end());
             return *this;
         }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     multiset& operator=(multiset&& __s)
         _NOEXCEPT_(is_nothrow_move_assignable<__base>::value)
@@ -951,7 +958,7 @@
             __tree_ = _VSTD::move(__s.__tree_);
             return *this;
         }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
           iterator begin() _NOEXCEPT       {return __tree_.begin();}
@@ -992,7 +999,7 @@
     size_type max_size() const _NOEXCEPT {return __tree_.max_size();}
 
     // modifiers:
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace(_Args&&... __args)
@@ -1001,15 +1008,23 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
             {return __tree_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const value_type& __v)
         {return __tree_.__insert_multi(__v);}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(value_type&& __v)
+        {return __tree_.__insert_multi(_VSTD::move(__v));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __v)
         {return __tree_.__insert_multi(__p, __v);}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, value_type&& __v)
+        {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
         void insert(_InputIterator __f, _InputIterator __l)
@@ -1018,19 +1033,11 @@
                 __tree_.__insert_multi(__e, *__f);
         }
 
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(value_type&& __v)
-        {return __tree_.__insert_multi(_VSTD::move(__v));}
-
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, value_type&& __v)
-        {return __tree_.__insert_multi(__p, _VSTD::move(__v));}
-
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     iterator  erase(const_iterator __p) {return __tree_.erase(__p);}
@@ -1133,7 +1140,7 @@
 #endif
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Compare, class _Allocator>
 multiset<_Key, _Compare, _Allocator>::multiset(multiset&& __s, const allocator_type& __a)
@@ -1147,7 +1154,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Compare, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
diff --git a/include/shared_mutex b/include/shared_mutex
index 9cb8152..29e8cef 100644
--- a/include/shared_mutex
+++ b/include/shared_mutex
@@ -125,14 +125,12 @@
 
 #include <__config>
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 #if _LIBCPP_STD_VER > 11 || defined(_LIBCPP_BUILDING_SHARED_MUTEX)
 
 #include <__mutex_base>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
@@ -143,7 +141,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-struct _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX __shared_mutex_base
+struct _LIBCPP_TYPE_VIS __shared_mutex_base
 {
     mutex               __mut_;
     condition_variable  __gate1_;
@@ -175,11 +173,11 @@
 
 
 #if _LIBCPP_STD_VER > 14
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
+class _LIBCPP_TYPE_VIS shared_mutex
 {
-    __shared_mutex_base __base;
+	__shared_mutex_base __base;
 public:
-    _LIBCPP_INLINE_VISIBILITY shared_mutex() : __base() {}
+    shared_mutex() : __base() {}
     _LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
 
     shared_mutex(const shared_mutex&) = delete;
@@ -201,9 +199,9 @@
 #endif
 
 
-class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
+class _LIBCPP_TYPE_VIS shared_timed_mutex
 {
-    __shared_mutex_base __base;
+	__shared_mutex_base __base;
 public:
     shared_timed_mutex();
     _LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
@@ -502,6 +500,4 @@
 
 #endif  // _LIBCPP_STD_VER > 11
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_SHARED_MUTEX
diff --git a/include/sstream b/include/sstream
index b9903f9..40b9785 100644
--- a/include/sstream
+++ b/include/sstream
@@ -175,14 +175,12 @@
 #include <istream>
 #include <string>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // basic_stringbuf
@@ -214,10 +212,12 @@
     inline _LIBCPP_INLINE_VISIBILITY
     explicit basic_stringbuf(const string_type& __s,
                              ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     basic_stringbuf(basic_stringbuf&& __rhs);
+#endif
 
     // 27.8.1.2 Assign and swap:
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     basic_stringbuf& operator=(basic_stringbuf&& __rhs);
 #endif
     void swap(basic_stringbuf& __rhs);
@@ -255,7 +255,7 @@
     str(__s);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_stringbuf<_CharT, _Traits, _Allocator>::basic_stringbuf(basic_stringbuf&& __rhs)
@@ -346,7 +346,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 void
@@ -641,13 +641,13 @@
     inline _LIBCPP_INLINE_VISIBILITY
     explicit basic_istringstream(const string_type& __s,
                                  ios_base::openmode __wch = ios_base::in);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_istringstream(basic_istringstream&& __rhs);
 
     // 27.8.2.2 Assign and swap:
     basic_istringstream& operator=(basic_istringstream&& __rhs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     void swap(basic_istringstream& __rhs);
 
@@ -675,7 +675,7 @@
 {
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_istringstream<_CharT, _Traits, _Allocator>::basic_istringstream(basic_istringstream&& __rhs)
@@ -694,7 +694,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 void basic_istringstream<_CharT, _Traits, _Allocator>::swap(basic_istringstream& __rhs)
@@ -758,13 +758,13 @@
     inline _LIBCPP_INLINE_VISIBILITY
     explicit basic_ostringstream(const string_type& __s,
                                  ios_base::openmode __wch = ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_ostringstream(basic_ostringstream&& __rhs);
 
     // 27.8.2.2 Assign and swap:
     basic_ostringstream& operator=(basic_ostringstream&& __rhs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     void swap(basic_ostringstream& __rhs);
 
@@ -792,7 +792,7 @@
 {
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_ostringstream<_CharT, _Traits, _Allocator>::basic_ostringstream(basic_ostringstream&& __rhs)
@@ -811,7 +811,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 void
@@ -877,13 +877,13 @@
     inline _LIBCPP_INLINE_VISIBILITY
     explicit basic_stringstream(const string_type& __s,
                                 ios_base::openmode __wch = ios_base::in | ios_base::out);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     basic_stringstream(basic_stringstream&& __rhs);
 
     // 27.8.2.2 Assign and swap:
     basic_stringstream& operator=(basic_stringstream&& __rhs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     inline _LIBCPP_INLINE_VISIBILITY
     void swap(basic_stringstream& __rhs);
 
@@ -911,7 +911,7 @@
 {
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_stringstream<_CharT, _Traits, _Allocator>::basic_stringstream(basic_stringstream&& __rhs)
@@ -930,7 +930,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 void
@@ -972,6 +972,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_SSTREAM
diff --git a/include/stack b/include/stack
index b2d4e23..c797ea5 100644
--- a/include/stack
+++ b/include/stack
@@ -126,28 +126,29 @@
     _LIBCPP_INLINE_VISIBILITY
     stack(const stack& __q) : c(__q.c) {}
 
-    _LIBCPP_INLINE_VISIBILITY
-    stack& operator=(const stack& __q) {c = __q.c; return *this;}
-
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     stack(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_constructible<container_type>::value)
         : c(_VSTD::move(__q.c)) {}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
+    stack& operator=(const stack& __q) {c = __q.c; return *this;}
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
     stack& operator=(stack&& __q)
         _NOEXCEPT_(is_nothrow_move_assignable<container_type>::value)
         {c = _VSTD::move(__q.c); return *this;}
-
-    _LIBCPP_INLINE_VISIBILITY
-    explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     explicit stack(const container_type& __c) : c(__c) {}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    explicit stack(container_type&& __c) : c(_VSTD::move(__c)) {}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit stack(const _Alloc& __a,
@@ -166,7 +167,7 @@
               typename enable_if<uses_allocator<container_type,
                                                 _Alloc>::value>::type* = 0)
             : c(__s.c, __a) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         stack(container_type&& __c, const _Alloc& __a,
@@ -179,7 +180,7 @@
               typename enable_if<uses_allocator<container_type,
                                                 _Alloc>::value>::type* = 0)
             : c(_VSTD::move(__s.c), __a) {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     bool empty()     const      {return c.empty();}
@@ -192,10 +193,10 @@
 
     _LIBCPP_INLINE_VISIBILITY
     void push(const value_type& __v) {c.push_back(__v);}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void push(value_type&& __v) {c.push_back(_VSTD::move(__v));}
-
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
 #if _LIBCPP_STD_VER > 14
@@ -205,8 +206,8 @@
         void      emplace(_Args&&... __args)
         {        c.emplace_back(_VSTD::forward<_Args>(__args)...);}
 #endif
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void pop() {c.pop_back();}
 
diff --git a/include/stdexcept b/include/stdexcept
index 95a96cc..d501d09 100644
--- a/include/stdexcept
+++ b/include/stdexcept
@@ -61,9 +61,9 @@
 
     bool __uses_refcount() const;
 public:
-    explicit __libcpp_refstring(const char* __msg);
-    __libcpp_refstring(const __libcpp_refstring& __s) _NOEXCEPT;
-    __libcpp_refstring& operator=(const __libcpp_refstring& __s) _NOEXCEPT;
+    explicit __libcpp_refstring(const char* msg);
+    __libcpp_refstring(const __libcpp_refstring& s) _NOEXCEPT;
+    __libcpp_refstring& operator=(const __libcpp_refstring& s) _NOEXCEPT;
     ~__libcpp_refstring();
 
     const char* c_str() const _NOEXCEPT {return __imp_;}
diff --git a/include/stdio.h b/include/stdio.h
index f124176..56fb2d8 100644
--- a/include/stdio.h
+++ b/include/stdio.h
@@ -110,9 +110,9 @@
 #ifdef __cplusplus
 
 // snprintf
-#if defined(_LIBCPP_MSVCRT_LIKE)
-extern "C" {
-int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
+#if defined(_LIBCPP_MSVCRT)
+extern "C++" {
+#include "support/win32/support.h"
 }
 #endif
 
diff --git a/include/stdlib.h b/include/stdlib.h
index f11c5e7..12fd676 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -97,6 +97,10 @@
 
 extern "C++" {
 
+#ifdef _LIBCPP_MSVCRT
+#include "support/win32/locale_win32.h"
+#endif // _LIBCPP_MSVCRT
+
 #undef abs
 #undef div
 #undef labs
diff --git a/include/streambuf b/include/streambuf
index a10ce1b..8607065 100644
--- a/include/streambuf
+++ b/include/streambuf
@@ -116,9 +116,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <class _CharT, class _Traits>
@@ -479,16 +476,12 @@
     return traits_type::eof();
 }
 
-#ifndef _LIBCPP_AVAILABILITY_NO_STREAMS_EXTERN_TEMPLATE
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf<wchar_t>)
 
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<char>)
 _LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios<wchar_t>)
-#endif
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_STEAMBUF
diff --git a/include/string b/include/string
index accf1ce..e1c64fa 100644
--- a/include/string
+++ b/include/string
@@ -484,16 +484,14 @@
 #include <cstdint>
 #endif
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 // fpos
@@ -639,7 +637,7 @@
     typedef basic_string                                 __self;
     typedef basic_string_view<_CharT, _Traits>           __self_view;
     typedef _Traits                                      traits_type;
-    typedef _CharT                                       value_type;
+    typedef typename traits_type::char_type              value_type;
     typedef _Allocator                                   allocator_type;
     typedef allocator_traits<allocator_type>             __alloc_traits;
     typedef typename __alloc_traits::size_type           size_type;
@@ -650,7 +648,7 @@
     typedef typename __alloc_traits::const_pointer       const_pointer;
 
     static_assert(is_pod<value_type>::value, "Character type of basic_string must be a POD");
-    static_assert((is_same<_CharT, typename traits_type::char_type>::value),
+    static_assert((is_same<_CharT, value_type>::value),
                   "traits_type::char_type must be the same type as CharT");
     static_assert((is_same<typename allocator_type::value_type, value_type>::value),
                   "Allocator::value_type must be same type as value_type");
@@ -765,7 +763,7 @@
     basic_string(const basic_string& __str);
     basic_string(const basic_string& __str, const allocator_type& __a);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_string(basic_string&& __str)
 #if _LIBCPP_STD_VER <= 14
@@ -776,7 +774,7 @@
 
     _LIBCPP_INLINE_VISIBILITY
     basic_string(basic_string&& __str, const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY basic_string(const _CharT* __s);
     _LIBCPP_INLINE_VISIBILITY
     basic_string(const _CharT* __s, const _Allocator& __a);
@@ -808,12 +806,12 @@
     template<class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
         basic_string(_InputIterator __first, _InputIterator __last, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_string(initializer_list<_CharT> __il);
     _LIBCPP_INLINE_VISIBILITY
     basic_string(initializer_list<_CharT> __il, const _Allocator& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     inline ~basic_string();
 
@@ -827,15 +825,17 @@
 #endif
     _LIBCPP_INLINE_VISIBILITY
     basic_string& operator=(__self_view __sv)  {return assign(__sv);}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     basic_string& operator=(basic_string&& __str)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-     _LIBCPP_INLINE_VISIBILITY
-    basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
 #endif
     _LIBCPP_INLINE_VISIBILITY basic_string& operator=(const value_type* __s) {return assign(__s);}
     basic_string& operator=(value_type __c);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    basic_string& operator=(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 #if _LIBCPP_DEBUG_LEVEL >= 2
     _LIBCPP_INLINE_VISIBILITY
@@ -901,7 +901,7 @@
     void resize(size_type __n, value_type __c);
     _LIBCPP_INLINE_VISIBILITY void resize(size_type __n) {resize(__n, value_type());}
 
-    void reserve(size_type __res_arg = 0);
+    void reserve(size_type res_arg = 0);
     _LIBCPP_INLINE_VISIBILITY
     void shrink_to_fit() _NOEXCEPT {reserve();}
     _LIBCPP_INLINE_VISIBILITY
@@ -918,9 +918,9 @@
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(__self_view __sv)          {return append(__sv);}
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(const value_type* __s)     {return append(__s);}
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(value_type __c)            {push_back(__c); return *this;}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY basic_string& operator+=(initializer_list<value_type> __il) {return append(__il);}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     basic_string& append(const basic_string& __str);
@@ -968,10 +968,10 @@
       return __append_forward_unsafe(__first, __last);
     }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_string& append(initializer_list<value_type> __il) {return append(__il.begin(), __il.size());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     void push_back(value_type __c);
     _LIBCPP_INLINE_VISIBILITY
@@ -985,11 +985,11 @@
     basic_string& assign(__self_view __sv) { return assign(__sv.data(), __sv.size()); }
     _LIBCPP_INLINE_VISIBILITY
     basic_string& assign(const basic_string& __str) { return *this = __str; }
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
-    basic_string& assign(basic_string&& __str)
+    basic_string& assign(basic_string&& str)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value))
-        {*this = _VSTD::move(__str); return *this;}
+        {*this = _VSTD::move(str); return *this;}
 #endif
     basic_string& assign(const basic_string& __str, size_type __pos, size_type __n=npos);
     template <class _Tp>
@@ -999,7 +999,7 @@
             __can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value,
             basic_string&
         >::type
-                  assign(const _Tp & __t, size_type __pos, size_type __n=npos);
+                  assign(const _Tp & __t, size_type pos, size_type n=npos);
     basic_string& assign(const value_type* __s, size_type __n);
     basic_string& assign(const value_type* __s);
     basic_string& assign(size_type __n, value_type __c);
@@ -1021,10 +1021,10 @@
             basic_string&
         >::type
         assign(_ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_string& assign(initializer_list<value_type> __il) {return assign(__il.begin(), __il.size());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     basic_string& insert(size_type __pos1, const basic_string& __str);
@@ -1063,11 +1063,11 @@
             iterator
         >::type
         insert(const_iterator __pos, _ForwardIterator __first, _ForwardIterator __last);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __pos, initializer_list<value_type> __il)
                     {return insert(__pos, __il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     basic_string& erase(size_type __pos = 0, size_type __n = npos);
     _LIBCPP_INLINE_VISIBILITY
@@ -1109,11 +1109,11 @@
             basic_string&
         >::type
         replace(const_iterator __i1, const_iterator __i2, _InputIterator __j1, _InputIterator __j2);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     basic_string& replace(const_iterator __i1, const_iterator __i2, initializer_list<value_type> __il)
         {return replace(__i1, __i2, __il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     size_type copy(value_type* __s, size_type __n, size_type __pos = 0) const;
     _LIBCPP_INLINE_VISIBILITY
@@ -1338,15 +1338,15 @@
                  __align_it<sizeof(value_type) < __alignment ?
                             __alignment/sizeof(value_type) : 1 > (__s+1)) - 1;}
 
-    inline
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     void __init(const value_type* __s, size_type __sz, size_type __reserve);
-    inline
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     void __init(const value_type* __s, size_type __sz);
-    inline
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     void __init(size_type __n, value_type __c);
 
     template <class _InputIterator>
-    inline
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     typename enable_if
     <
         __is_exactly_input_iterator<_InputIterator>::value,
@@ -1355,7 +1355,7 @@
     __init(_InputIterator __first, _InputIterator __last);
 
     template <class _ForwardIterator>
-    inline
+    inline _LIBCPP_EXTERN_TEMPLATE_INLINE_VISIBILITY
     typename enable_if
     <
         __is_forward_iterator<_ForwardIterator>::value,
@@ -1408,7 +1408,7 @@
     void __copy_assign_alloc(const basic_string&, false_type) _NOEXCEPT
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void __move_assign(basic_string& __str, false_type)
         _NOEXCEPT_(__alloc_traits::is_always_equal::value);
@@ -1511,7 +1511,7 @@
 #else
         _NOEXCEPT
 #endif
-: __r_(__second_tag(), __a)
+: __r_(__a)
 {
 #if _LIBCPP_DEBUG_LEVEL >= 2
     __get_db()->__insert_c(this);
@@ -1582,7 +1582,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
     __init(__s, traits_type::length(__s));
@@ -1605,7 +1605,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
     __init(__s, __n);
@@ -1616,7 +1616,7 @@
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str)
-    : __r_(__second_tag(), __alloc_traits::select_on_container_copy_construction(__str.__alloc()))
+    : __r_(__alloc_traits::select_on_container_copy_construction(__str.__alloc()))
 {
     if (!__str.__is_long())
         __r_.first().__r = __str.__r_.first().__r;
@@ -1630,7 +1630,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
     const basic_string& __str, const allocator_type& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     if (!__str.__is_long())
         __r_.first().__r = __str.__r_.first().__r;
@@ -1641,7 +1641,7 @@
 #endif
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1664,7 +1664,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(basic_string&& __str, const allocator_type& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     if (__str.__is_long() && __a != __str.__alloc()) // copy, not move
         __init(_VSTD::__to_raw_pointer(__str.__get_long_pointer()), __str.__get_long_size());
@@ -1680,7 +1680,7 @@
 #endif
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 void
@@ -1719,7 +1719,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(size_type __n, _CharT __c, const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     __init(__n, __c);
 #if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1731,7 +1731,7 @@
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str,
                                                         size_type __pos, size_type __n,
                                                         const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     size_type __str_sz = __str.size();
     if (__pos > __str_sz)
@@ -1746,7 +1746,7 @@
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(const basic_string& __str, size_type __pos,
                                                         const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     size_type __str_sz = __str.size();
     if (__pos > __str_sz)
@@ -1762,7 +1762,7 @@
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
              const _Tp& __t, size_type __pos, size_type __n, const allocator_type& __a,
 			 typename enable_if<__can_be_converted_to_string_view<_CharT, _Traits, _Tp>::value, void>::type *)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
 	__self_view __sv = __self_view(__t).substr(__pos, __n);
     __init(__sv.data(), __sv.size());
@@ -1784,7 +1784,7 @@
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(__self_view __sv, const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     __init(__sv.data(), __sv.size());
 #if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1866,7 +1866,7 @@
 inline _LIBCPP_INLINE_VISIBILITY
 basic_string<_CharT, _Traits, _Allocator>::basic_string(_InputIterator __first, _InputIterator __last,
                                                         const allocator_type& __a)
-    : __r_(__second_tag(), __a)
+    : __r_(__a)
 {
     __init(__first, __last);
 #if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1874,7 +1874,7 @@
 #endif
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1889,10 +1889,10 @@
 
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
-
 basic_string<_CharT, _Traits, _Allocator>::basic_string(
     initializer_list<_CharT> __il, const _Allocator& __a)
-    : __r_(__second_tag(), __a)
+
+    : __r_(__a)
 {
     __init(__il.begin(), __il.end());
 #if _LIBCPP_DEBUG_LEVEL >= 2
@@ -1900,7 +1900,7 @@
 #endif
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _CharT, class _Traits, class _Allocator>
 basic_string<_CharT, _Traits, _Allocator>::~basic_string()
@@ -2049,7 +2049,7 @@
     return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -2276,9 +2276,7 @@
     size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n)
     {
-        typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
-        _CharRef __tmp_ref = *__first;
-        if (__ptr_in_range(_VSTD::addressof(__tmp_ref), data(), data() + size()))
+        if ( __ptr_in_range(&*__first, data(), data() + size()))
         {
             const basic_string __temp (__first, __last, __alloc());
             append(__temp.data(), __temp.size());
@@ -2442,9 +2440,7 @@
     size_type __n = static_cast<size_type>(_VSTD::distance(__first, __last));
     if (__n)
     {
-        typedef typename iterator_traits<_ForwardIterator>::reference _CharRef;
-        _CharRef __tmp_char = *__first;
-        if (__ptr_in_range(_VSTD::addressof(__tmp_char), data(), data() + size()))
+        if ( __ptr_in_range(&*__first, data(), data() + size()))
         {
             const basic_string __temp(__first, __last, __alloc());
             return insert(__pos, __temp.data(), __temp.data() + __temp.size());
@@ -3790,7 +3786,7 @@
     return __r;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -3850,7 +3846,7 @@
     return _VSTD::move(__lhs);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 // swap
 
@@ -3952,7 +3948,7 @@
 getline(basic_istream<_CharT, _Traits>& __is,
         basic_string<_CharT, _Traits, _Allocator>& __str);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template<class _CharT, class _Traits, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -3966,7 +3962,7 @@
 getline(basic_istream<_CharT, _Traits>&& __is,
         basic_string<_CharT, _Traits, _Allocator>& __str);
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 #if _LIBCPP_DEBUG_LEVEL >= 2
 
@@ -4043,6 +4039,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_STRING
diff --git a/include/string_view b/include/string_view
index 4c759ab..8be6132 100644
--- a/include/string_view
+++ b/include/string_view
@@ -103,6 +103,7 @@
       constexpr const_pointer data() const noexcept;
 
       // 7.7, basic_string_view modifiers
+      constexpr void clear() noexcept;
       constexpr void remove_prefix(size_type n);
       constexpr void remove_suffix(size_type n);
       constexpr void swap(basic_string_view& s) noexcept;
@@ -166,6 +167,7 @@
 */
 
 #include <__config>
+
 #include <__string>
 #include <algorithm>
 #include <iterator>
@@ -177,10 +179,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template<class _CharT, class _Traits = char_traits<_CharT> >
@@ -201,10 +199,6 @@
 	typedef ptrdiff_t                                  difference_type;
 	static _LIBCPP_CONSTEXPR const size_type npos = -1; // size_type(-1);
 
-    static_assert(is_pod<value_type>::value, "Character type of basic_string_view must be a POD");
-    static_assert((is_same<_CharT, typename traits_type::char_type>::value),
-                  "traits_type::char_type must be the same type as CharT");
-
 	// [string.view.cons], construct/copy
 	_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
 	basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
@@ -295,6 +289,13 @@
 
 	// [string.view.modifiers], modifiers:
 	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
+	void clear() _NOEXCEPT
+	{
+		__data = nullptr;
+		__size = 0;
+	}
+
+	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
 	void remove_prefix(size_type __n) _NOEXCEPT
 	{
 		_LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
@@ -356,9 +357,9 @@
 
 	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
 	int compare(                       size_type __pos1, size_type __n1, 
-				basic_string_view __sv, size_type __pos2, size_type __n2) const
+				basic_string_view _sv, size_type __pos2, size_type __n2) const
 	{
-		return substr(__pos1, __n1).compare(__sv.substr(__pos2, __n2));
+		return substr(__pos1, __n1).compare(_sv.substr(__pos2, __n2));
 	}
 
 	_LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY
@@ -787,6 +788,4 @@
 #endif
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif // _LIBCPP_STRING_VIEW
diff --git a/include/strstream b/include/strstream
index b00b9d8..81eef2a 100644
--- a/include/strstream
+++ b/include/strstream
@@ -151,12 +151,12 @@
     strstreambuf(unsigned char* __gnext, streamsize __n, unsigned char* __pbeg = 0);
     strstreambuf(const unsigned char* __gnext, streamsize __n);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     strstreambuf(strstreambuf&& __rhs);
     _LIBCPP_INLINE_VISIBILITY
     strstreambuf& operator=(strstreambuf&& __rhs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     virtual ~strstreambuf();
 
@@ -191,7 +191,7 @@
     void __init(char* __gnext, streamsize __n, char* __pbeg);
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 inline _LIBCPP_INLINE_VISIBILITY
 strstreambuf::strstreambuf(strstreambuf&& __rhs)
@@ -226,7 +226,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 class _LIBCPP_TYPE_VIS istrstream
     : public istream
@@ -245,7 +245,7 @@
     istrstream(char* __s, streamsize __n)
         : istream(&__sb_), __sb_(__s, __n) {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     istrstream(istrstream&& __rhs)
         : istream(_VSTD::move(__rhs)),
@@ -261,7 +261,7 @@
         __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     virtual ~istrstream();
 
@@ -294,7 +294,7 @@
           __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     ostrstream(ostrstream&& __rhs)
         : ostream(_VSTD::move(__rhs)),
@@ -310,7 +310,7 @@
         __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     virtual ~ostrstream();
 
@@ -354,7 +354,7 @@
           __sb_(__s, __n, __s + (__mode & ios::app ? strlen(__s) : 0))
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     strstream(strstream&& __rhs)
         : iostream(_VSTD::move(__rhs)),
@@ -370,7 +370,7 @@
         __sb_ = _VSTD::move(__rhs.__sb_);
         return *this;
     }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     virtual ~strstream();
 
diff --git a/include/support/fuchsia/xlocale.h b/include/support/fuchsia/xlocale.h
deleted file mode 100644
index 1de2fca..0000000
--- a/include/support/fuchsia/xlocale.h
+++ /dev/null
@@ -1,23 +0,0 @@
-// -*- C++ -*-
-//===------------------- support/fuchsia/xlocale.h ------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
-#define _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
-
-#if defined(__Fuchsia__)
-
-#include <cstdlib>
-#include <cwchar>
-#include <support/xlocale/__posix_l_fallback.h>
-#include <support/xlocale/__strtonum_fallback.h>
-
-#endif // defined(__Fuchsia__)
-
-#endif // _LIBCPP_SUPPORT_FUCHSIA_XLOCALE_H
diff --git a/include/support/win32/limits_msvc_win32.h b/include/support/win32/limits_win32.h
similarity index 80%
rename from include/support/win32/limits_msvc_win32.h
rename to include/support/win32/limits_win32.h
index 1ab2e0b..406cd30 100644
--- a/include/support/win32/limits_msvc_win32.h
+++ b/include/support/win32/limits_win32.h
@@ -1,5 +1,5 @@
 // -*- C++ -*-
-//===------------------ support/win32/limits_msvc_win32.h -----------------===//
+//===--------------------- support/win32/limits_win32.h -------------------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,21 +8,17 @@
 //
 //===----------------------------------------------------------------------===//
 
-#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
-#define _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
+#define _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
 
 #if !defined(_LIBCPP_MSVCRT)
 #error "This header complements the Microsoft C Runtime library, and should not be included otherwise."
-#endif
-#if defined(__clang__)
-#error "This header should only be included when using Microsofts C1XX frontend"
-#endif
+#else
 
 #include <limits.h> // CHAR_BIT
 #include <float.h> // limit constants
-#include <math.h> // HUGE_VAL
-#include <ymath.h> // internal MSVC header providing the needed functionality
 
+#if ! defined(__clang__)
 #define __CHAR_BIT__       CHAR_BIT
 
 #define __FLT_MANT_DIG__   FLT_MANT_DIG
@@ -65,8 +61,19 @@
 #define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
 
 // __builtin replacements/workarounds
+#include <math.h> // HUGE_VAL
+#include <ymath.h> // internal MSVC header providing the needed functionality
+#define __builtin_huge_val()     HUGE_VAL
+#define __builtin_huge_valf()    _FInf._Float
 #define __builtin_huge_vall()    _LInf._Long_double
+#define __builtin_nan(__dummy)   _Nan._Double
+#define __builtin_nanf(__dummy)  _FNan._Float
 #define __builtin_nanl(__dummmy) _LNan._Long_double
+#define __builtin_nans(__dummy)  _Snan._Double
+#define __builtin_nansf(__dummy) _FSnan._Float
 #define __builtin_nansl(__dummy) _LSnan._Long_double
+#endif // ! defined(__clang__)
 
-#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_MSVC_WIN32_H
+#endif // _LIBCPP_MSVCRT
+
+#endif // _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H
diff --git a/include/support/win32/locale_mgmt_win32.h b/include/support/win32/locale_mgmt_win32.h
new file mode 100644
index 0000000..b3316d6
--- /dev/null
+++ b/include/support/win32/locale_mgmt_win32.h
@@ -0,0 +1,33 @@
+// -*- C++ -*-
+//===----------------- support/win32/locale_mgmt_win32.h ------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_MGMT_WIN32_H
+#define _LIBCPP_SUPPORT_WIN32_LOCALE_MGMT_WIN32_H
+
+#include <xlocinfo.h> // _locale_t
+#define locale_t _locale_t
+#define LC_COLLATE_MASK _M_COLLATE
+#define LC_CTYPE_MASK _M_CTYPE
+#define LC_MONETARY_MASK _M_MONETARY
+#define LC_NUMERIC_MASK _M_NUMERIC
+#define LC_TIME_MASK _M_TIME
+#define LC_MESSAGES_MASK _M_MESSAGES
+#define LC_ALL_MASK (  LC_COLLATE_MASK \
+                     | LC_CTYPE_MASK \
+                     | LC_MESSAGES_MASK \
+                     | LC_MONETARY_MASK \
+                     | LC_NUMERIC_MASK \
+                     | LC_TIME_MASK )
+#define freelocale _free_locale
+// FIXME: base currently unused. Needs manual work to construct the new locale
+locale_t newlocale( int mask, const char * locale, locale_t base );
+locale_t uselocale( locale_t newloc );
+
+#endif // _LIBCPP_SUPPORT_WIN32_LOCALE_MGMT_WIN32_H
diff --git a/include/support/win32/locale_win32.h b/include/support/win32/locale_win32.h
index b2b3ac4..ebf5bda 100644
--- a/include/support/win32/locale_win32.h
+++ b/include/support/win32/locale_win32.h
@@ -11,31 +11,16 @@
 #ifndef _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
 #define _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
 
-#include <__config>
+#include <crtversion.h>
+
+#if _VC_CRT_MAJOR_VERSION < 14
+// ctype mask table defined in msvcrt.dll
+extern "C" unsigned short __declspec(dllimport) _ctype[];
+#endif
+
+#include "support/win32/support.h"
+#include "support/win32/locale_mgmt_win32.h"
 #include <stdio.h>
-#include <xlocinfo.h> // _locale_t
-
-#define LC_COLLATE_MASK _M_COLLATE
-#define LC_CTYPE_MASK _M_CTYPE
-#define LC_MONETARY_MASK _M_MONETARY
-#define LC_NUMERIC_MASK _M_NUMERIC
-#define LC_TIME_MASK _M_TIME
-#define LC_MESSAGES_MASK _M_MESSAGES
-#define LC_ALL_MASK (  LC_COLLATE_MASK \
-                     | LC_CTYPE_MASK \
-                     | LC_MESSAGES_MASK \
-                     | LC_MONETARY_MASK \
-                     | LC_NUMERIC_MASK \
-                     | LC_TIME_MASK )
-
-#define locale_t _locale_t
-
-// Locale management functions
-#define freelocale _free_locale
-// FIXME: base currently unused. Needs manual work to construct the new locale
-locale_t newlocale( int mask, const char * locale, locale_t base );
-locale_t uselocale( locale_t newloc );
-
 
 lconv *localeconv_l( locale_t loc );
 size_t mbrlen_l( const char *__restrict s, size_t n,
@@ -52,21 +37,20 @@
                      size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
 wint_t btowc_l( int c, locale_t loc );
 int wctob_l( wint_t c, locale_t loc );
-
-decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
+inline _LIBCPP_ALWAYS_INLINE
+decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
+{
+  return ___mb_cur_max_l_func(__l);
+}
 
 // the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
 #define mbtowc_l _mbtowc_l
 #define strtoll_l _strtoi64_l
 #define strtoull_l _strtoui64_l
-#define strtod_l _strtod_l
-#if defined(_LIBCPP_MSVCRT)
 #define strtof_l _strtof_l
+#define strtod_l _strtod_l
 #define strtold_l _strtold_l
-#else
-float strtof_l(const char*, char**, locale_t);
-long double strtold_l(const char*, char**, locale_t);
-#endif
+
 inline _LIBCPP_INLINE_VISIBILITY
 int
 islower_l(int c, _locale_t loc)
@@ -106,9 +90,10 @@
 #define sprintf_l( __s, __l, __f, ... ) _sprintf_l( __s, __f, __l, __VA_ARGS__ )
 #define vsprintf_l( __s, __l, __f, ... ) _vsprintf_l( __s, __f, __l, __VA_ARGS__ )
 #define vsnprintf_l( __s, __n, __l, __f, ... ) _vsnprintf_l( __s, __n, __f, __l, __VA_ARGS__ )
-_LIBCPP_FUNC_VIS int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
-_LIBCPP_FUNC_VIS int asprintf_l( char **ret, locale_t loc, const char *format, ... );
-_LIBCPP_FUNC_VIS int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
+int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...);
+int asprintf_l( char **ret, locale_t loc, const char *format, ... );
+int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap );
+
 
 // not-so-pressing FIXME: use locale to determine blank characters
 inline int isblank_l( int c, locale_t /*loc*/ )
@@ -120,4 +105,10 @@
     return ( c == L' ' || c == L'\t' );
 }
 
+#if defined(_LIBCPP_MSVCRT)
+inline int isblank( int c, locale_t /*loc*/ )
+{ return ( c == ' ' || c == '\t' ); }
+inline int iswblank( wint_t c, locale_t /*loc*/ )
+{ return ( c == L' ' || c == L'\t' ); }
+#endif // _LIBCPP_MSVCRT
 #endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H
diff --git a/include/support/win32/support.h b/include/support/win32/support.h
new file mode 100644
index 0000000..f961344
--- /dev/null
+++ b/include/support/win32/support.h
@@ -0,0 +1,185 @@
+// -*- C++ -*-
+//===----------------------- support/win32/support.h ----------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_SUPPORT_WIN32_SUPPORT_H
+#define _LIBCPP_SUPPORT_WIN32_SUPPORT_H
+
+// Functions and constants used in libc++ that
+// are missing from the Windows C library.
+
+#include <wchar.h> // mbstate_t
+#include <cstdarg> // va_ macros
+// "builtins" not implemented here for Clang or GCC as they provide
+// implementations. Assuming required for elsewhere else, certainly MSVC.
+#if defined(_LIBCPP_COMPILER_MSVC)
+#include <intrin.h>
+#endif
+#if defined(_LIBCPP_MSVCRT)
+#include <crtversion.h>
+#endif
+#define swprintf _snwprintf
+#define vswprintf _vsnwprintf
+
+#ifndef NOMINMAX
+#define NOMINMAX
+#endif
+
+// The mingw headers already define these as static.
+#ifndef __MINGW32__
+extern "C" {
+
+int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
+int asprintf(char **sptr, const char *__restrict fmt, ...);
+size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
+                  size_t nmc, size_t len, mbstate_t *__restrict ps);
+size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
+                  size_t nwc, size_t len, mbstate_t *__restrict ps);
+}
+#endif // __MINGW32__
+
+#if defined(_VC_CRT_MAJOR_VERSION) && _VC_CRT_MAJOR_VERSION < 14
+#define snprintf _snprintf
+#define _Exit _exit
+#endif
+
+#if defined(_LIBCPP_COMPILER_MSVC)
+
+// Bit builtin's make these assumptions when calling _BitScanForward/Reverse
+// etc. These assumptions are expected to be true for Win32/Win64 which this
+// file supports.
+static_assert(sizeof(unsigned long long) == 8, "");
+static_assert(sizeof(unsigned long) == 4, "");
+static_assert(sizeof(unsigned int) == 4, "");
+
+_LIBCPP_ALWAYS_INLINE int __builtin_popcount(unsigned int x)
+{
+  // Binary: 0101...
+  static const unsigned int m1 = 0x55555555;
+  // Binary: 00110011..
+  static const unsigned int m2 = 0x33333333;
+  // Binary:  4 zeros,  4 ones ...
+  static const unsigned int m4 = 0x0f0f0f0f;
+  // The sum of 256 to the power of 0,1,2,3...
+  static const unsigned int h01 = 0x01010101;
+  // Put count of each 2 bits into those 2 bits.
+  x -= (x >> 1) & m1;
+  // Put count of each 4 bits into those 4 bits.
+  x = (x & m2) + ((x >> 2) & m2);
+  // Put count of each 8 bits into those 8 bits.
+  x = (x + (x >> 4)) & m4;
+  // Returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24).
+  return (x * h01) >> 24;
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_popcountl(unsigned long x)
+{
+  return __builtin_popcount(static_cast<int>(x));
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_popcountll(unsigned long long x)
+{
+  // Binary: 0101...
+  static const unsigned long long m1 = 0x5555555555555555;
+  // Binary: 00110011..
+  static const unsigned long long m2 = 0x3333333333333333;
+  // Binary:  4 zeros,  4 ones ...
+  static const unsigned long long m4 = 0x0f0f0f0f0f0f0f0f;
+  // The sum of 256 to the power of 0,1,2,3...
+  static const unsigned long long h01 = 0x0101010101010101;
+  // Put count of each 2 bits into those 2 bits.
+  x -= (x >> 1) & m1;
+  // Put count of each 4 bits into those 4 bits.
+  x = (x & m2) + ((x >> 2) & m2);
+  // Put count of each 8 bits into those 8 bits.
+  x = (x + (x >> 4)) & m4;
+  // Returns left 8 bits of x + (x<<8) + (x<<16) + (x<<24) + ...
+  return static_cast<int>((x * h01) >> 56);
+}
+
+// Returns the number of trailing 0-bits in x, starting at the least significant
+// bit position. If x is 0, the result is undefined.
+_LIBCPP_ALWAYS_INLINE int __builtin_ctzll(unsigned long long mask)
+{
+  unsigned long where;
+// Search from LSB to MSB for first set bit.
+// Returns zero if no set bit is found.
+#if defined(_LIBCPP_HAS_BITSCAN64)
+    (defined(_M_AMD64) || defined(__x86_64__))
+  if (_BitScanForward64(&where, mask))
+    return static_cast<int>(where);
+#else
+  // Win32 doesn't have _BitScanForward64 so emulate it with two 32 bit calls.
+  // Scan the Low Word.
+  if (_BitScanForward(&where, static_cast<unsigned long>(mask)))
+    return static_cast<int>(where);
+  // Scan the High Word.
+  if (_BitScanForward(&where, static_cast<unsigned long>(mask >> 32)))
+    return static_cast<int>(where + 32); // Create a bit offset from the LSB.
+#endif
+  return 64;
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_ctzl(unsigned long mask)
+{
+  unsigned long where;
+  // Search from LSB to MSB for first set bit.
+  // Returns zero if no set bit is found.
+  if (_BitScanForward(&where, mask))
+    return static_cast<int>(where);
+  return 32;
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_ctz(unsigned int mask)
+{
+  // Win32 and Win64 expectations.
+  static_assert(sizeof(mask) == 4, "");
+  static_assert(sizeof(unsigned long) == 4, "");
+  return __builtin_ctzl(static_cast<unsigned long>(mask));
+}
+
+// Returns the number of leading 0-bits in x, starting at the most significant
+// bit position. If x is 0, the result is undefined.
+_LIBCPP_ALWAYS_INLINE int __builtin_clzll(unsigned long long mask)
+{
+  unsigned long where;
+// BitScanReverse scans from MSB to LSB for first set bit.
+// Returns 0 if no set bit is found.
+#if defined(_LIBCPP_HAS_BITSCAN64)
+  if (_BitScanReverse64(&where, mask))
+    return static_cast<int>(63 - where);
+#else
+  // Scan the high 32 bits.
+  if (_BitScanReverse(&where, static_cast<unsigned long>(mask >> 32)))
+    return static_cast<int>(63 -
+                            (where + 32)); // Create a bit offset from the MSB.
+  // Scan the low 32 bits.
+  if (_BitScanReverse(&where, static_cast<unsigned long>(mask)))
+    return static_cast<int>(63 - where);
+#endif
+  return 64; // Undefined Behavior.
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_clzl(unsigned long mask)
+{
+  unsigned long where;
+  // Search from LSB to MSB for first set bit.
+  // Returns zero if no set bit is found.
+  if (_BitScanReverse(&where, mask))
+    return static_cast<int>(31 - where);
+  return 32; // Undefined Behavior.
+}
+
+_LIBCPP_ALWAYS_INLINE int __builtin_clz(unsigned int x)
+{
+  return __builtin_clzl(x);
+}
+#endif // _LIBCPP_MSVC
+
+#endif // _LIBCPP_SUPPORT_WIN32_SUPPORT_H
diff --git a/include/thread b/include/thread
index 1b8dca3..94c77e0 100644
--- a/include/thread
+++ b/include/thread
@@ -95,7 +95,7 @@
 #include <system_error>
 #include <chrono>
 #include <__mutex_base>
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 #include <tuple>
 #endif
 #include <__threading_support>
@@ -105,9 +105,6 @@
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
 #define __STDCPP_THREADS__ __cplusplus
 
 #ifdef _LIBCPP_HAS_NO_THREADS
@@ -264,7 +261,7 @@
     : public unary_function<__thread_id, size_t>
 {
     _LIBCPP_INLINE_VISIBILITY
-    size_t operator()(__thread_id __v) const _NOEXCEPT
+    size_t operator()(__thread_id __v) const
     {
         return hash<__libcpp_thread_id>()(__v.__id_);
     }
@@ -294,7 +291,7 @@
 
     _LIBCPP_INLINE_VISIBILITY
     thread() _NOEXCEPT : __t_(_LIBCPP_NULL_THREAD) {}
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class _Fp, class ..._Args,
               class = typename enable_if
               <
@@ -303,19 +300,19 @@
              >
         _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
         explicit thread(_Fp&& __f, _Args&&... __args);
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_VARIADICS
     template <class _Fp>
     _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS
     explicit thread(_Fp __f);
 #endif
     ~thread();
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     thread(thread&& __t) _NOEXCEPT : __t_(__t.__t_) {__t.__t_ = _LIBCPP_NULL_THREAD;}
     _LIBCPP_INLINE_VISIBILITY
     thread& operator=(thread&& __t) _NOEXCEPT;
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     void swap(thread& __t) _NOEXCEPT {_VSTD::swap(__t_, __t.__t_);}
@@ -332,7 +329,7 @@
     static unsigned hardware_concurrency() _NOEXCEPT;
 };
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -372,18 +369,7 @@
         __throw_system_error(__ec, "thread constructor failed");
 }
 
-inline
-thread&
-thread::operator=(thread&& __t) _NOEXCEPT
-{
-    if (!__libcpp_thread_isnull(&__t_))
-        terminate();
-    __t_ = __t.__t_;
-    __t.__t_ = _LIBCPP_NULL_THREAD;
-    return *this;
-}
-
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_VARIADICS
 
 template <class _Fp>
 struct __thread_invoke_pair {
@@ -418,7 +404,22 @@
         __throw_system_error(__ec, "thread constructor failed");
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+inline
+thread&
+thread::operator=(thread&& __t) _NOEXCEPT
+{
+    if (!__libcpp_thread_isnull(&__t_))
+        terminate();
+    __t_ = __t.__t_;
+    __t.__t_ = _LIBCPP_NULL_THREAD;
+    return *this;
+}
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 inline _LIBCPP_INLINE_VISIBILITY
 void swap(thread& __x, thread& __y) _NOEXCEPT {__x.swap(__y);}
@@ -479,6 +480,4 @@
 
 #endif // !_LIBCPP_HAS_NO_THREADS
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_THREAD
diff --git a/include/tuple b/include/tuple
index aa4713f..f2a7472 100644
--- a/include/tuple
+++ b/include/tuple
@@ -148,7 +148,7 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 
 // __tuple_leaf
@@ -169,7 +169,7 @@
 template <size_t _Ip, class _Hp, bool>
 class __tuple_leaf
 {
-    _Hp __value_;
+    _Hp value;
 
     template <class _Tp>
     static constexpr bool __can_bind_reference() {
@@ -188,28 +188,28 @@
     __tuple_leaf& operator=(const __tuple_leaf&);
 public:
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR __tuple_leaf()
-             _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : __value_()
+             _NOEXCEPT_(is_nothrow_default_constructible<_Hp>::value) : value()
        {static_assert(!is_reference<_Hp>::value,
               "Attempted to default construct a reference element in a tuple");}
 
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         __tuple_leaf(integral_constant<int, 0>, const _Alloc&)
-            : __value_()
+            : value()
         {static_assert(!is_reference<_Hp>::value,
               "Attempted to default construct a reference element in a tuple");}
 
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a)
-            : __value_(allocator_arg_t(), __a)
+            : value(allocator_arg_t(), __a)
         {static_assert(!is_reference<_Hp>::value,
               "Attempted to default construct a reference element in a tuple");}
 
     template <class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a)
-            : __value_(__a)
+            : value(__a)
         {static_assert(!is_reference<_Hp>::value,
               "Attempted to default construct a reference element in a tuple");}
 
@@ -223,28 +223,28 @@
             >
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
         explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
-            : __value_(_VSTD::forward<_Tp>(__t))
+            : value(_VSTD::forward<_Tp>(__t))
         {static_assert(__can_bind_reference<_Tp>(),
        "Attempted to construct a reference element in a tuple with an rvalue");}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 0>, const _Alloc&, _Tp&& __t)
-            : __value_(_VSTD::forward<_Tp>(__t))
+            : value(_VSTD::forward<_Tp>(__t))
         {static_assert(__can_bind_reference<_Tp>(),
        "Attempted to construct a reference element in a tuple with an rvalue");}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 1>, const _Alloc& __a, _Tp&& __t)
-            : __value_(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
+            : value(allocator_arg_t(), __a, _VSTD::forward<_Tp>(__t))
         {static_assert(!is_reference<_Hp>::value,
             "Attempted to uses-allocator construct a reference element in a tuple");}
 
     template <class _Tp, class _Alloc>
         _LIBCPP_INLINE_VISIBILITY
         explicit __tuple_leaf(integral_constant<int, 2>, const _Alloc& __a, _Tp&& __t)
-            : __value_(_VSTD::forward<_Tp>(__t), __a)
+            : value(_VSTD::forward<_Tp>(__t), __a)
         {static_assert(!is_reference<_Hp>::value,
            "Attempted to uses-allocator construct a reference element in a tuple");}
 
@@ -256,7 +256,7 @@
         __tuple_leaf&
         operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
         {
-            __value_ = _VSTD::forward<_Tp>(__t);
+            value = _VSTD::forward<_Tp>(__t);
             return *this;
         }
 
@@ -267,8 +267,8 @@
         return 0;
     }
 
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp& get()       _NOEXCEPT {return __value_;}
-    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return __value_;}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11       _Hp& get()       _NOEXCEPT {return value;}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return value;}
 };
 
 template <size_t _Ip, class _Hp>
@@ -473,9 +473,9 @@
 template <class ..._Tp>
 class _LIBCPP_TEMPLATE_VIS tuple
 {
-    typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> _BaseT;
+    typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
 
-    _BaseT __base_;
+    base base_;
 
 #if defined(_LIBCPP_ENABLE_TUPLE_IMPLICIT_REDUCED_ARITY_EXTENSION)
     static constexpr bool _EnableImplicitReducedArityExtension = true;
@@ -628,7 +628,7 @@
     >::type>
     _LIBCPP_INLINE_VISIBILITY
     tuple(_AllocArgT, _Alloc const& __a)
-      : __base_(allocator_arg_t(), __a,
+      : base_(allocator_arg_t(), __a,
                     __tuple_indices<>(), __tuple_types<>(),
                     typename __make_tuple_indices<sizeof...(_Tp), 0>::type(),
                     __tuple_types<_Tp...>()) {}
@@ -644,7 +644,7 @@
         >
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
     tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
-        : __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
+        : base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                 typename __make_tuple_indices<0>::type(),
                 typename __make_tuple_types<tuple, 0>::type(),
@@ -662,7 +662,7 @@
         >
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
     explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
-        : __base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
+        : base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                 typename __make_tuple_indices<0>::type(),
                 typename __make_tuple_types<tuple, 0>::type(),
@@ -680,7 +680,7 @@
         >
       _LIBCPP_INLINE_VISIBILITY
       tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
-        : __base_(allocator_arg_t(), __a,
+        : base_(allocator_arg_t(), __a,
                 typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                 typename __make_tuple_indices<0>::type(),
@@ -700,7 +700,7 @@
       _LIBCPP_INLINE_VISIBILITY
       explicit
       tuple(allocator_arg_t, const _Alloc& __a, const _Tp& ... __t)
-        : __base_(allocator_arg_t(), __a,
+        : base_(allocator_arg_t(), __a,
                 typename __make_tuple_indices<sizeof...(_Tp)>::type(),
                 typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
                 typename __make_tuple_indices<0>::type(),
@@ -727,7 +727,7 @@
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
         tuple(_Up&&... __u)
             _NOEXCEPT_((
-                is_nothrow_constructible<_BaseT,
+                is_nothrow_constructible<base,
                     typename __make_tuple_indices<sizeof...(_Up)>::type,
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
@@ -735,7 +735,7 @@
                     _Up...
                 >::value
             ))
-            : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
+            : base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
@@ -760,7 +760,7 @@
         explicit
         tuple(_Up&&... __u)
             _NOEXCEPT_((
-                is_nothrow_constructible<_BaseT,
+                is_nothrow_constructible<base,
                     typename __make_tuple_indices<sizeof...(_Up)>::type,
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type,
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type,
@@ -768,7 +768,7 @@
                     _Up...
                 >::value
             ))
-            : __base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
+            : base_(typename __make_tuple_indices<sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Tp), sizeof...(_Up)>::type(),
@@ -786,7 +786,7 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
-            : __base_(allocator_arg_t(), __a,
+            : base_(allocator_arg_t(), __a,
                     typename __make_tuple_indices<sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
@@ -806,7 +806,7 @@
         _LIBCPP_INLINE_VISIBILITY
         explicit
         tuple(allocator_arg_t, const _Alloc& __a, _Up&&... __u)
-            : __base_(allocator_arg_t(), __a,
+            : base_(allocator_arg_t(), __a,
                     typename __make_tuple_indices<sizeof...(_Up)>::type(),
                     typename __make_tuple_types<tuple, sizeof...(_Up)>::type(),
                     typename __make_tuple_indices<sizeof...(_Tp), sizeof...(_Up)>::type(),
@@ -824,8 +824,8 @@
                       >::type = false
              >
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value))
-            : __base_(_VSTD::forward<_Tuple>(__t)) {}
+        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
+            : base_(_VSTD::forward<_Tuple>(__t)) {}
 
     template <class _Tuple,
               typename enable_if
@@ -839,8 +839,8 @@
              >
         _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
         explicit
-        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<_BaseT, _Tuple>::value))
-            : __base_(_VSTD::forward<_Tuple>(__t)) {}
+        tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
+            : base_(_VSTD::forward<_Tuple>(__t)) {}
 
     template <class _Alloc, class _Tuple,
               typename enable_if
@@ -853,7 +853,7 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
-            : __base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+            : base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
 
     template <class _Alloc, class _Tuple,
               typename enable_if
@@ -867,7 +867,7 @@
         _LIBCPP_INLINE_VISIBILITY
         explicit
         tuple(allocator_arg_t, const _Alloc& __a, _Tuple&& __t)
-            : __base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
+            : base_(allocator_arg_t(), __a, _VSTD::forward<_Tuple>(__t)) {}
 
     using _CanCopyAssign = __all<is_copy_assignable<_Tp>::value...>;
     using _CanMoveAssign = __all<is_move_assignable<_Tp>::value...>;
@@ -876,7 +876,7 @@
     tuple& operator=(typename conditional<_CanCopyAssign::value, tuple, __nat>::type const& __t)
         _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
     {
-        __base_.operator=(__t.__base_);
+        base_.operator=(__t.base_);
         return *this;
     }
 
@@ -884,7 +884,7 @@
     tuple& operator=(typename conditional<_CanMoveAssign::value, tuple, __nat>::type&& __t)
         _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
     {
-        __base_.operator=(static_cast<_BaseT&&>(__t.__base_));
+        base_.operator=(static_cast<base&&>(__t.base_));
         return *this;
     }
 
@@ -896,15 +896,15 @@
              >
         _LIBCPP_INLINE_VISIBILITY
         tuple&
-        operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<_BaseT&, _Tuple>::value))
+        operator=(_Tuple&& __t) _NOEXCEPT_((is_nothrow_assignable<base&, _Tuple>::value))
         {
-            __base_.operator=(_VSTD::forward<_Tuple>(__t));
+            base_.operator=(_VSTD::forward<_Tuple>(__t));
             return *this;
         }
 
     _LIBCPP_INLINE_VISIBILITY
     void swap(tuple& __t) _NOEXCEPT_(__all<__is_nothrow_swappable<_Tp>::value...>::value)
-        {__base_.swap(__t.__base_);}
+        {base_.swap(__t.base_);}
 };
 
 template <>
@@ -948,7 +948,7 @@
 get(tuple<_Tp...>& __t) _NOEXCEPT
 {
     typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
-    return static_cast<__tuple_leaf<_Ip, type>&>(__t.__base_).get();
+    return static_cast<__tuple_leaf<_Ip, type>&>(__t.base_).get();
 }
 
 template <size_t _Ip, class ..._Tp>
@@ -957,7 +957,7 @@
 get(const tuple<_Tp...>& __t) _NOEXCEPT
 {
     typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
-    return static_cast<const __tuple_leaf<_Ip, type>&>(__t.__base_).get();
+    return static_cast<const __tuple_leaf<_Ip, type>&>(__t.base_).get();
 }
 
 template <size_t _Ip, class ..._Tp>
@@ -967,7 +967,7 @@
 {
     typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
     return static_cast<type&&>(
-             static_cast<__tuple_leaf<_Ip, type>&&>(__t.__base_).get());
+             static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
 }
 
 template <size_t _Ip, class ..._Tp>
@@ -977,7 +977,7 @@
 {
     typedef typename tuple_element<_Ip, tuple<_Tp...> >::type type;
     return static_cast<const type&&>(
-             static_cast<const __tuple_leaf<_Ip, type>&&>(__t.__base_).get());
+             static_cast<const __tuple_leaf<_Ip, type>&&>(__t.base_).get());
 }
 
 #if _LIBCPP_STD_VER > 11
@@ -1345,6 +1345,9 @@
 struct _LIBCPP_TEMPLATE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
     : true_type {};
 
+#endif // _LIBCPP_HAS_NO_VARIADICS
+
+#ifndef _LIBCPP_CXX03_LANG
 template <class _T1, class _T2>
 template <class... _Args1, class... _Args2, size_t ..._I1, size_t ..._I2>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1355,6 +1358,7 @@
       second(_VSTD::forward<_Args2>(_VSTD::get<_I2>(__second_args))...)
 {
 }
+#endif // _LIBCPP_CXX03_LANG
 
 #if _LIBCPP_STD_VER > 14
 template <class _Tp>
@@ -1400,8 +1404,6 @@
 
 #endif // _LIBCPP_STD_VER > 14
 
-#endif // !defined(_LIBCPP_CXX03_LANG)
-
 _LIBCPP_END_NAMESPACE_STD
 
 #endif  // _LIBCPP_TUPLE
diff --git a/include/type_traits b/include/type_traits
index 9db4d66..3aa8460 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -97,7 +97,6 @@
     template <class T> struct is_polymorphic;
     template <class T> struct is_abstract;
     template <class T> struct is_final; // C++14
-    template <class T> struct is_aggregate; // C++17
 
     template <class T, class... Args> struct is_constructible;
     template <class T>                struct is_default_constructible;
@@ -287,8 +286,6 @@
         = is_abstract<T>::value;                                         // C++17
       template <class T> constexpr bool is_final_v
         = is_final<T>::value;                                            // C++17
-      template <class T> constexpr bool is_aggregate_v
-        = is_aggregate<T>::value;                                        // C++17
       template <class T> constexpr bool is_signed_v
         = is_signed<T>::value;                                           // C++17
       template <class T> constexpr bool is_unsigned_v
@@ -1275,13 +1272,11 @@
 
 // decay
 
-template <class _Up, bool>
-struct __decay {
-    typedef typename remove_cv<_Up>::type type;
-};
-
-template <class _Up>
-struct __decay<_Up, true> {
+template <class _Tp>
+struct _LIBCPP_TEMPLATE_VIS decay
+{
+private:
+    typedef typename remove_reference<_Tp>::type _Up;
 public:
     typedef typename conditional
                      <
@@ -1296,15 +1291,6 @@
                      >::type type;
 };
 
-template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS decay
-{
-private:
-    typedef typename remove_reference<_Tp>::type _Up;
-public:
-    typedef typename __decay<_Up, __is_referenceable<_Up>::value>::type type;
-};
-
 #if _LIBCPP_STD_VER > 11
 template <class _Tp> using decay_t = typename decay<_Tp>::type;
 #endif
@@ -1339,19 +1325,6 @@
     = is_final<_Tp>::value;
 #endif
 
-// is_aggregate
-#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
-
-template <class _Tp> struct _LIBCPP_TEMPLATE_VIS
-is_aggregate : public integral_constant<bool, __is_aggregate(_Tp)> {};
-
-#if !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
-template <class _Tp>
-constexpr bool is_aggregate_v = is_aggregate<_Tp>::value;
-#endif
-
-#endif // _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
-
 // is_base_of
 
 #ifdef _LIBCPP_HAS_IS_BASE_OF
@@ -1981,18 +1954,11 @@
     typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp>::type type;
 };
 
-template <>
-struct _LIBCPP_TEMPLATE_VIS common_type<void, void, void>
-{
-public:
-    typedef void type;
-};
-
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS common_type<_Tp, void, void>
 {
 public:
-    typedef typename common_type<_Tp, _Tp>::type type;
+    typedef typename decay<_Tp>::type type;
 };
 
 template <class _Tp, class _Up>
@@ -2014,7 +1980,9 @@
 
 template <class _Tp>
 struct _LIBCPP_TEMPLATE_VIS common_type<_Tp>
-    : public common_type<_Tp, _Tp> {};
+{
+    typedef typename decay<_Tp>::type type;
+};
 
 // bullet 3 - sizeof...(Tp) == 2
 
@@ -4739,35 +4707,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-#if _LIBCPP_STD_VER > 14
-// std::byte
-namespace std  // purposefully not versioned
-{
-template <class _Integer>
-  constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
-  operator<<=(byte& __lhs, _Integer __shift) noexcept
-  { return __lhs = byte(static_cast<unsigned char>(__lhs) << __shift); }
-  
-template <class _Integer>
-  constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
-  operator<< (byte  __lhs, _Integer __shift) noexcept
-  { return         byte(static_cast<unsigned char>(__lhs) << __shift); }
-
-template <class _Integer>
-  constexpr typename enable_if<is_integral_v<_Integer>, byte>::type &
-  operator>>=(byte& __lhs, _Integer __shift) noexcept
-  { return __lhs = byte(static_cast<unsigned char>(__lhs) >> __shift); }
-
-template <class _Integer>
-  constexpr typename enable_if<is_integral_v<_Integer>, byte>::type
-  operator>> (byte  __lhs, _Integer __shift) noexcept
-  { return         byte(static_cast<unsigned char>(__lhs) >> __shift); }
-  
-template <class _Integer>
-  constexpr typename enable_if<is_integral_v<_Integer>, _Integer>::type
-  to_integer(byte __b) noexcept { return _Integer(__b); }
-
-}
-#endif
-
 #endif  // _LIBCPP_TYPE_TRAITS
diff --git a/include/typeinfo b/include/typeinfo
index 8624b34..4145ac1 100644
--- a/include/typeinfo
+++ b/include/typeinfo
@@ -108,7 +108,6 @@
 #endif
 
 public:
-    _LIBCPP_AVAILABILITY_TYPEINFO_VTABLE
     virtual ~type_info();
 
 #if defined(_LIBCPP_HAS_NONUNIQUE_TYPEINFO)
diff --git a/include/unordered_map b/include/unordered_map
index 0546c0e..3f3808c 100644
--- a/include/unordered_map
+++ b/include/unordered_map
@@ -404,7 +404,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<_Hash>::value)
     {
         using _VSTD::swap;
-        swap(static_cast<_Hash&>(*this), static_cast<_Hash&>(__y));
+        swap(static_cast<const _Hash&>(*this), static_cast<const _Hash&>(__y));
     }
 };
 
@@ -475,7 +475,7 @@
         _NOEXCEPT_(__is_nothrow_swappable<_Pred>::value)
     {
         using _VSTD::swap;
-        swap(static_cast<_Pred&>(*this), static_cast<_Pred&>(__y));
+        swap(static_cast<const _Pred&>(*this), static_cast<const _Pred&>(__y));
     }
 };
 
@@ -547,7 +547,7 @@
           __second_constructed(false)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __hash_map_node_destructor(__hash_node_destructor<allocator_type>&& __x)
         _NOEXCEPT
@@ -557,7 +557,7 @@
         {
             __x.__value_constructed = false;
         }
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __hash_map_node_destructor(const __hash_node_destructor<allocator_type>& __x)
         : __na_(__x.__na_),
@@ -566,7 +566,7 @@
         {
             const_cast<bool&>(__x.__value_constructed) = false;
         }
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     void operator()(pointer __p) _NOEXCEPT
@@ -819,18 +819,20 @@
     explicit unordered_map(const allocator_type& __a);
     unordered_map(const unordered_map& __u);
     unordered_map(const unordered_map& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_map(unordered_map&& __u)
         _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
     unordered_map(unordered_map&& __u, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     unordered_map(initializer_list<value_type> __il);
     unordered_map(initializer_list<value_type> __il, size_type __n,
                   const hasher& __hf = hasher(), const key_equal& __eql = key_equal());
     unordered_map(initializer_list<value_type> __il, size_type __n,
                   const hasher& __hf, const key_equal& __eql,
                   const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 #if _LIBCPP_STD_VER > 11
     _LIBCPP_INLINE_VISIBILITY
     unordered_map(size_type __n, const allocator_type& __a)
@@ -873,13 +875,15 @@
 #endif
         return *this;
     }
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_map& operator=(unordered_map&& __u)
         _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
+#endif
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     unordered_map& operator=(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -924,11 +928,13 @@
         _LIBCPP_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+#ifndef _LIBCPP_CXX03_LANG
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator, bool> insert(value_type&& __x)
         {return __table_.__insert_unique(_VSTD::move(__x));}
@@ -1072,7 +1078,7 @@
         // FIXME: Add debug mode checking for the iterator input
         return insert_or_assign(_VSTD::move(__k), _VSTD::forward<_Vp>(__v)).first;
      }
-#endif // _LIBCPP_STD_VER > 14
+#endif
 
     _LIBCPP_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __table_.erase(__p.__i_);}
@@ -1271,7 +1277,7 @@
     insert(__u.begin(), __u.end());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
@@ -1308,6 +1314,10 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_map(
         initializer_list<value_type> __il)
@@ -1344,6 +1354,10 @@
     insert(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
@@ -1354,6 +1368,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>&
@@ -1364,7 +1382,22 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifdef _LIBCPP_CXX03_LANG
+template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k)
+{
+    __node_allocator& __na = __table_.__node_alloc();
+    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k);
+    __h.get_deleter().__first_constructed = true;
+    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
+    __h.get_deleter().__second_constructed = true;
+    return _LIBCPP_EXPLICIT_MOVE(__h);  // explicitly moved for C++03
+}
+#endif
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 template <class _InputIterator>
@@ -1377,7 +1410,20 @@
         __table_.__insert_unique(*__first);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifdef _LIBCPP_CXX03_LANG
+template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
+_Tp&
+unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
+{
+    iterator __i = find(__k);
+    if (__i != end())
+        return __i->second;
+    __node_holder __h = __construct_node_with_key(__k);
+    pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
+    __h.release();
+    return __r.first->second;
+}
+#else
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 _Tp&
@@ -1396,35 +1442,8 @@
         std::piecewise_construct, std::forward_as_tuple(std::move(__k)),
                                   std::forward_as_tuple()).first->__cc.second;
 }
-#else // _LIBCPP_CXX03_LANG
 
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-typename unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__node_holder
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::__construct_node_with_key(const key_type& __k)
-{
-    __node_allocator& __na = __table_.__node_alloc();
-    __node_holder __h(__node_traits::allocate(__na, 1), _Dp(__na));
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.first), __k);
-    __h.get_deleter().__first_constructed = true;
-    __node_traits::construct(__na, _VSTD::addressof(__h->__value_.__cc.second));
-    __h.get_deleter().__second_constructed = true;
-    return _LIBCPP_EXPLICIT_MOVE(__h);  // explicitly moved for C++03
-}
-
-template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
-_Tp&
-unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type& __k)
-{
-    iterator __i = find(__k);
-    if (__i != end())
-        return __i->second;
-    __node_holder __h = __construct_node_with_key(__k);
-    pair<iterator, bool> __r = __table_.__node_insert_unique(__h.get());
-    __h.release();
-    return __r.first->second;
-}
-
-#endif  // _LIBCPP_CXX03_MODE
+#endif  // !_LIBCPP_CXX03_MODE
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 _Tp&
@@ -1567,11 +1586,13 @@
     explicit unordered_multimap(const allocator_type& __a);
     unordered_multimap(const unordered_multimap& __u);
     unordered_multimap(const unordered_multimap& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_multimap(unordered_multimap&& __u)
         _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
     unordered_multimap(unordered_multimap&& __u, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     unordered_multimap(initializer_list<value_type> __il);
     unordered_multimap(initializer_list<value_type> __il, size_type __n,
                        const hasher& __hf = hasher(),
@@ -1579,7 +1600,7 @@
     unordered_multimap(initializer_list<value_type> __il, size_type __n,
                        const hasher& __hf, const key_equal& __eql,
                        const allocator_type& __a);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 #if _LIBCPP_STD_VER > 11
     _LIBCPP_INLINE_VISIBILITY
     unordered_multimap(size_type __n, const allocator_type& __a)
@@ -1622,13 +1643,15 @@
 #endif
         return *this;
     }
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_multimap& operator=(unordered_multimap&& __u)
         _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
+#endif
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     unordered_multimap& operator=(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -1665,10 +1688,13 @@
     _LIBCPP_INLINE_VISIBILITY
     void insert(_InputIterator __first, _InputIterator __last);
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void insert(initializer_list<value_type> __il)
         {insert(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_CXX03_LANG
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
 
@@ -1886,7 +1912,7 @@
     insert(__u.begin(), __u.end());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
@@ -1925,6 +1951,10 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>::unordered_multimap(
         initializer_list<value_type> __il)
@@ -1961,6 +1991,10 @@
     insert(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
@@ -1971,6 +2005,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Key, class _Tp, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>&
@@ -1981,7 +2019,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 
 
diff --git a/include/unordered_set b/include/unordered_set
index a14fb00..fc53c82 100644
--- a/include/unordered_set
+++ b/include/unordered_set
@@ -408,11 +408,13 @@
     explicit unordered_set(const allocator_type& __a);
     unordered_set(const unordered_set& __u);
     unordered_set(const unordered_set& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_set(unordered_set&& __u)
         _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
     unordered_set(unordered_set&& __u, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     unordered_set(initializer_list<value_type> __il);
     unordered_set(initializer_list<value_type> __il, size_type __n,
                   const hasher& __hf = hasher(),
@@ -430,7 +432,7 @@
                                   const hasher& __hf, const allocator_type& __a)
         : unordered_set(__il, __n, __hf, key_equal(), __a) {}
 #endif
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     // ~unordered_set() = default;
     _LIBCPP_INLINE_VISIBILITY
     unordered_set& operator=(const unordered_set& __u)
@@ -438,13 +440,15 @@
         __table_ = __u.__table_;
         return *this;
     }
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_set& operator=(unordered_set&& __u)
         _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
+#endif
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     unordered_set& operator=(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -470,7 +474,7 @@
     _LIBCPP_INLINE_VISIBILITY
     const_iterator cend()   const _NOEXCEPT {return __table_.end();}
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         pair<iterator, bool> emplace(_Args&&... __args)
@@ -489,31 +493,15 @@
         iterator emplace_hint(const_iterator, _Args&&... __args)
             {return __table_.__emplace_unique(_VSTD::forward<_Args>(__args)...).first;}
 #endif
-
-    _LIBCPP_INLINE_VISIBILITY
-    pair<iterator, bool> insert(value_type&& __x)
-        {return __table_.__insert_unique(_VSTD::move(__x));}
-    _LIBCPP_INLINE_VISIBILITY
-#if _LIBCPP_DEBUG_LEVEL >= 2
-    iterator insert(const_iterator __p, value_type&& __x)
-        {
-            _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
-                "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
-                " referring to this unordered_set");
-            return insert(_VSTD::move(__x)).first;
-        }
-#else
-    iterator insert(const_iterator, value_type&& __x)
-        {return insert(_VSTD::move(__x)).first;}
-#endif
-    _LIBCPP_INLINE_VISIBILITY
-    void insert(initializer_list<value_type> __il)
-        {insert(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     pair<iterator, bool> insert(const value_type& __x)
         {return __table_.__insert_unique(__x);}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    pair<iterator, bool> insert(value_type&& __x)
+        {return __table_.__insert_unique(_VSTD::move(__x));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
 #if _LIBCPP_DEBUG_LEVEL >= 2
     iterator insert(const_iterator __p, const value_type& __x)
@@ -527,9 +515,29 @@
     iterator insert(const_iterator, const value_type& __x)
         {return insert(__x).first;}
 #endif
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+#if _LIBCPP_DEBUG_LEVEL >= 2
+    iterator insert(const_iterator __p, value_type&& __x)
+        {
+            _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__p) == this,
+                "unordered_set::insert(const_iterator, value_type&&) called with an iterator not"
+                " referring to this unordered_set");
+            return insert(_VSTD::move(__x)).first;
+        }
+#else
+    iterator insert(const_iterator, value_type&& __x)
+        {return insert(_VSTD::move(__x)).first;}
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    void insert(initializer_list<value_type> __il)
+        {insert(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __table_.erase(__p);}
@@ -709,7 +717,7 @@
     insert(__u.begin(), __u.end());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
@@ -744,6 +752,10 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 unordered_set<_Value, _Hash, _Pred, _Alloc>::unordered_set(
         initializer_list<value_type> __il)
@@ -780,6 +792,10 @@
     insert(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_set<_Value, _Hash, _Pred, _Alloc>&
@@ -790,6 +806,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_set<_Value, _Hash, _Pred, _Alloc>&
@@ -800,7 +820,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 template <class _InputIterator>
@@ -929,11 +949,13 @@
     explicit unordered_multiset(const allocator_type& __a);
     unordered_multiset(const unordered_multiset& __u);
     unordered_multiset(const unordered_multiset& __u, const allocator_type& __a);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_multiset(unordered_multiset&& __u)
         _NOEXCEPT_(is_nothrow_move_constructible<__table>::value);
     unordered_multiset(unordered_multiset&& __u, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     unordered_multiset(initializer_list<value_type> __il);
     unordered_multiset(initializer_list<value_type> __il, size_type __n,
                        const hasher& __hf = hasher(),
@@ -949,7 +971,7 @@
     unordered_multiset(initializer_list<value_type> __il, size_type __n, const hasher& __hf, const allocator_type& __a)
       : unordered_multiset(__il, __n, __hf, key_equal(), __a) {}
 #endif
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     // ~unordered_multiset() = default;
     _LIBCPP_INLINE_VISIBILITY
     unordered_multiset& operator=(const unordered_multiset& __u)
@@ -957,12 +979,14 @@
         __table_ = __u.__table_;
         return *this;
     }
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     unordered_multiset& operator=(unordered_multiset&& __u)
         _NOEXCEPT_(is_nothrow_move_assignable<__table>::value);
+#endif
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     unordered_multiset& operator=(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -988,7 +1012,7 @@
     _LIBCPP_INLINE_VISIBILITY
     const_iterator cend()   const _NOEXCEPT {return __table_.end();}
 
-#ifndef _LIBCPP_CXX03_LANG
+#if !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace(_Args&&... __args)
@@ -997,27 +1021,29 @@
         _LIBCPP_INLINE_VISIBILITY
         iterator emplace_hint(const_iterator __p, _Args&&... __args)
             {return __table_.__emplace_hint_multi(__p, _VSTD::forward<_Args>(__args)...);}
-
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
-    _LIBCPP_INLINE_VISIBILITY
-    iterator insert(const_iterator __p, value_type&& __x)
-        {return __table_.__insert_multi(__p, _VSTD::move(__x));}
-    _LIBCPP_INLINE_VISIBILITY
-    void insert(initializer_list<value_type> __il)
-        {insert(__il.begin(), __il.end());}
-#endif  // _LIBCPP_CXX03_LANG
-
+#endif  // !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const value_type& __x) {return __table_.__insert_multi(__x);}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(value_type&& __x) {return __table_.__insert_multi(_VSTD::move(__x));}
+#endif
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __p, const value_type& __x)
         {return __table_.__insert_multi(__p, __x);}
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    _LIBCPP_INLINE_VISIBILITY
+    iterator insert(const_iterator __p, value_type&& __x)
+        {return __table_.__insert_multi(__p, _VSTD::move(__x));}
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     template <class _InputIterator>
         _LIBCPP_INLINE_VISIBILITY
         void insert(_InputIterator __first, _InputIterator __last);
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    void insert(initializer_list<value_type> __il)
+        {insert(__il.begin(), __il.end());}
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     iterator erase(const_iterator __p) {return __table_.erase(__p);}
@@ -1198,7 +1224,7 @@
     insert(__u.begin(), __u.end());
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
@@ -1233,6 +1259,10 @@
 #endif
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 unordered_multiset<_Value, _Hash, _Pred, _Alloc>::unordered_multiset(
         initializer_list<value_type> __il)
@@ -1269,6 +1299,10 @@
     insert(__il.begin(), __il.end());
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
@@ -1280,6 +1314,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 inline
 unordered_multiset<_Value, _Hash, _Pred, _Alloc>&
@@ -1290,7 +1328,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Value, class _Hash, class _Pred, class _Alloc>
 template <class _InputIterator>
diff --git a/include/utility b/include/utility
index be73207..1f41c07 100644
--- a/include/utility
+++ b/include/utility
@@ -272,14 +272,14 @@
 
 template <class _Tp>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 typename conditional
 <
     !is_nothrow_move_constructible<_Tp>::value && is_copy_constructible<_Tp>::value,
     const _Tp&,
     _Tp&&
 >::type
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 const _Tp&
 #endif
 move_if_noexcept(_Tp& __x) _NOEXCEPT
@@ -293,7 +293,7 @@
 #endif
 
 struct _LIBCPP_TEMPLATE_VIS piecewise_construct_t { };
-#if defined(_LIBCPP_CXX03_LANG) || defined(_LIBCPP_BUILDING_UTILITY)
+#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_UTILITY)
 extern const piecewise_construct_t piecewise_construct;// = piecewise_construct_t();
 #else
 constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
@@ -608,7 +608,8 @@
     __x.swap(__y);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 
 template <class _Tp>
 struct __make_pair_return_impl
@@ -637,7 +638,7 @@
                (_VSTD::forward<_T1>(__t1), _VSTD::forward<_T2>(__t2));
 }
 
-#else  // _LIBCPP_CXX03_LANG
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -647,7 +648,7 @@
     return pair<_T1, _T2>(__x, __y);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _T1, class _T2>
   class _LIBCPP_TEMPLATE_VIS tuple_size<pair<_T1, _T2> >
@@ -684,7 +685,8 @@
     const _T1&
     get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.first;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     template <class _T1, class _T2>
     static
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -696,7 +698,8 @@
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
     const _T1&&
     get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T1>(__p.first);}
-#endif  // _LIBCPP_CXX03_LANG
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 };
 
 template <>
@@ -714,7 +717,8 @@
     const _T2&
     get(const pair<_T1, _T2>& __p) _NOEXCEPT {return __p.second;}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     template <class _T1, class _T2>
     static
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
@@ -726,7 +730,8 @@
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
     const _T2&&
     get(const pair<_T1, _T2>&& __p) _NOEXCEPT {return _VSTD::forward<const _T2>(__p.second);}
-#endif  // _LIBCPP_CXX03_LANG
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 };
 
 template <size_t _Ip, class _T1, class _T2>
@@ -745,7 +750,8 @@
     return __get_pair<_Ip>::get(__p);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <size_t _Ip, class _T1, class _T2>
 inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
@@ -761,7 +767,8 @@
 {
     return __get_pair<_Ip>::get(_VSTD::move(__p));
 }
-#endif  // _LIBCPP_CXX03_LANG
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 #if _LIBCPP_STD_VER > 11
 template <class _T1, class _T2>
@@ -899,7 +906,7 @@
 constexpr in_place_t in_place{};
 
 template <class _Tp>
-struct _LIBCPP_TEMPLATE_VIS in_place_type_t {
+struct _LIBCPP_TYPE_VIS in_place_type_t {
     explicit in_place_type_t() = default;
 };
 template <class _Tp>
diff --git a/include/valarray b/include/valarray
index ee61238..f0f1f62 100644
--- a/include/valarray
+++ b/include/valarray
@@ -347,14 +347,12 @@
 #include <functional>
 #include <new>
 
+#include <__undef_min_max>
+
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template<class _Tp> class _LIBCPP_TEMPLATE_VIS valarray;
@@ -809,11 +807,13 @@
     valarray(const value_type& __x, size_t __n);
     valarray(const value_type* __p, size_t __n);
     valarray(const valarray& __v);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     valarray(valarray&& __v) _NOEXCEPT;
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     valarray(initializer_list<value_type> __il);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     valarray(const slice_array<value_type>& __sa);
     valarray(const gslice_array<value_type>& __ga);
     valarray(const mask_array<value_type>& __ma);
@@ -823,12 +823,14 @@
 
     // assignment:
     valarray& operator=(const valarray& __v);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     valarray& operator=(valarray&& __v) _NOEXCEPT;
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     valarray& operator=(initializer_list<value_type>);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     valarray& operator=(const value_type& __x);
     _LIBCPP_INLINE_VISIBILITY
@@ -859,32 +861,32 @@
     __val_expr<__indirect_expr<const valarray&> > operator[](const gslice& __gs) const;
     _LIBCPP_INLINE_VISIBILITY
     gslice_array<value_type>   operator[](const gslice& __gs);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __val_expr<__indirect_expr<const valarray&> > operator[](gslice&& __gs) const;
     _LIBCPP_INLINE_VISIBILITY
     gslice_array<value_type>                      operator[](gslice&& __gs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __val_expr<__mask_expr<const valarray&> >     operator[](const valarray<bool>& __vb) const;
     _LIBCPP_INLINE_VISIBILITY
     mask_array<value_type>                        operator[](const valarray<bool>& __vb);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __val_expr<__mask_expr<const valarray&> >     operator[](valarray<bool>&& __vb) const;
     _LIBCPP_INLINE_VISIBILITY
     mask_array<value_type>                        operator[](valarray<bool>&& __vb);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __val_expr<__indirect_expr<const valarray&> > operator[](const valarray<size_t>& __vs) const;
     _LIBCPP_INLINE_VISIBILITY
     indirect_array<value_type>                    operator[](const valarray<size_t>& __vs);
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     __val_expr<__indirect_expr<const valarray&> > operator[](valarray<size_t>&& __vs) const;
     _LIBCPP_INLINE_VISIBILITY
     indirect_array<value_type>                    operator[](valarray<size_t>&& __vs);
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     // unary operators:
     valarray       operator+() const;
@@ -1478,7 +1480,7 @@
           __stride_(__stride)
         {__init(__start);}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     gslice(size_t __start, const valarray<size_t>&  __size,
@@ -1501,7 +1503,7 @@
           __stride_(move(__stride))
         {__init(__start);}
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 //  gslice(const gslice&)            = default;
 //  gslice(gslice&&)                 = default;
@@ -1654,12 +1656,12 @@
           __1d_(__gs.__1d_)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     gslice_array(gslice&& __gs, const valarray<value_type>& __v)
         : __vp_(const_cast<value_type*>(__v.__begin_)),
           __1d_(move(__gs.__1d_))
         {}
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     template <class> friend class valarray;
 };
@@ -2351,7 +2353,7 @@
           __1d_(__ia)
         {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     indirect_array(valarray<size_t>&& __ia, const valarray<value_type>& __v)
@@ -2359,7 +2361,7 @@
           __1d_(move(__ia))
         {}
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     template <class> friend class valarray;
 };
@@ -2570,7 +2572,7 @@
           __1d_(__ia)
           {}
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     _LIBCPP_INLINE_VISIBILITY
     __indirect_expr(valarray<size_t>&& __ia, const _RmExpr& __e)
@@ -2578,7 +2580,7 @@
           __1d_(move(__ia))
           {}
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 public:
     _LIBCPP_INLINE_VISIBILITY
@@ -2812,7 +2814,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -2823,6 +2825,10 @@
     __v.__begin_ = __v.__end_ = nullptr;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp>
 valarray<_Tp>::valarray(initializer_list<value_type> __il)
     : __begin_(0),
@@ -2849,7 +2855,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp>
 valarray<_Tp>::valarray(const slice_array<value_type>& __sa)
@@ -2984,7 +2990,7 @@
     return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -2999,6 +3005,10 @@
     return *this;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp>
 inline
 valarray<_Tp>&
@@ -3010,7 +3020,7 @@
     return *this;
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Tp>
 inline
@@ -3122,7 +3132,7 @@
     return gslice_array<value_type>(__gs, *this);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -3140,7 +3150,7 @@
     return gslice_array<value_type>(move(__gs), *this);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -3158,7 +3168,7 @@
     return mask_array<value_type>(__vb, *this);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -3176,7 +3186,7 @@
     return mask_array<value_type>(move(__vb), *this);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -3194,7 +3204,7 @@
     return indirect_array<value_type>(__vs, *this);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 inline
@@ -3212,7 +3222,7 @@
     return indirect_array<value_type>(move(__vs), *this);
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp>
 valarray<_Tp>
@@ -4867,6 +4877,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_VALARRAY
diff --git a/include/variant b/include/variant
index 8505f32..099e6c3 100644
--- a/include/variant
+++ b/include/variant
@@ -53,16 +53,16 @@
 
     // 20.7.2.4, modifiers
     template <class T, class... Args>
-    T& emplace(Args&&...);
+    void emplace(Args&&...);
 
     template <class T, class U, class... Args>
-    T& emplace(initializer_list<U>, Args&&...);
+    void emplace(initializer_list<U>, Args&&...);
 
     template <size_t I, class... Args>
-    variant_alternative_t<I, variant>& emplace(Args&&...);
+    void emplace(Args&&...);
 
     template <size_t I, class U, class...  Args>
-    variant_alternative_t<I, variant>& emplace(initializer_list<U>, Args&&...);
+    void emplace(initializer_list<U>, Args&&...);
 
     // 20.7.2.5, value status
     constexpr bool valueless_by_exception() const noexcept;
@@ -358,6 +358,7 @@
 
   static constexpr _Trait __copy_assignable_trait = __common_trait(
       {__copy_constructible_trait,
+       __move_constructible_trait,
        __trait<_Types, is_trivially_copy_assignable, is_copy_assignable>...});
 
   static constexpr _Trait __move_assignable_trait = __common_trait(
@@ -424,21 +425,30 @@
     constexpr auto __fmatrix =
         __make_fmatrix<_Visitor&&,
                        decltype(_VSTD::forward<_Vs>(__vs).__as_base())...>();
-    return __at(__fmatrix, __vs.index()...)(
-        _VSTD::forward<_Visitor>(__visitor),
-        _VSTD::forward<_Vs>(__vs).__as_base()...);
+    const size_t __indices[] = {__vs.index()...};
+    return __at(__fmatrix, __indices)(_VSTD::forward<_Visitor>(__visitor),
+                                      _VSTD::forward<_Vs>(__vs).__as_base()...);
   }
 
 private:
   template <class _Tp>
   inline _LIBCPP_INLINE_VISIBILITY
-  static constexpr const _Tp& __at(const _Tp& __elem) { return __elem; }
+  static constexpr const _Tp& __at_impl(const _Tp& __elem, const size_t*) {
+    return __elem;
+  }
 
-  template <class _Tp, size_t _Np, typename... _Indices>
+  template <class _Tp, size_t _Np>
+  inline _LIBCPP_INLINE_VISIBILITY
+  static constexpr auto&& __at_impl(const array<_Tp, _Np>& __elems,
+                                    const size_t* __index) {
+    return __at_impl(__elems[*__index], __index + 1);
+  }
+
+  template <class _Tp, size_t _Np, size_t _Ip>
   inline _LIBCPP_INLINE_VISIBILITY
   static constexpr auto&& __at(const array<_Tp, _Np>& __elems,
-                               size_t __index, _Indices... __indices) {
-    return __at(__elems[__index], __indices...);
+                               const size_t (&__indices)[_Ip]) {
+    return __at_impl(__elems, begin(__indices));
   }
 
   template <class _Fp, class... _Fs>
@@ -754,10 +764,9 @@
 protected:
   template <size_t _Ip, class _Tp, class... _Args>
   inline _LIBCPP_INLINE_VISIBILITY
-  static _Tp& __construct_alt(__alt<_Ip, _Tp>& __a, _Args&&... __args) {
-    ::new ((void*)_VSTD::addressof(__a))
+  static void __construct_alt(__alt<_Ip, _Tp>& __a, _Args&&... __args) {
+    ::new (_VSTD::addressof(__a))
         __alt<_Ip, _Tp>(in_place, _VSTD::forward<_Args>(__args)...);
-    return __a.__value;
   }
 
   template <class _Rhs>
@@ -867,33 +876,33 @@
 
   template <size_t _Ip, class... _Args>
   inline _LIBCPP_INLINE_VISIBILITY
-  auto& __emplace(_Args&&... __args) {
+  void __emplace(_Args&&... __args) {
     this->__destroy();
-    auto& __res = this->__construct_alt(__access::__base::__get_alt<_Ip>(*this),
+    this->__construct_alt(__access::__base::__get_alt<_Ip>(*this),
                           _VSTD::forward<_Args>(__args)...);
     this->__index = _Ip;
-    return __res;
   }
 
 protected:
-  template <size_t _Ip, class _Tp, class _Arg>
+  template <bool _CopyAssign, size_t _Ip, class _Tp, class _Arg>
   inline _LIBCPP_INLINE_VISIBILITY
-  void __assign_alt(__alt<_Ip, _Tp>& __a, _Arg&& __arg) {
+  void __assign_alt(__alt<_Ip, _Tp>& __a,
+                    _Arg&& __arg,
+                    bool_constant<_CopyAssign> __tag) {
     if (this->index() == _Ip) {
       __a.__value = _VSTD::forward<_Arg>(__arg);
     } else {
       struct {
         void operator()(true_type) const {
-          __this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg));
+          __this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg)));
         }
         void operator()(false_type) const {
-          __this->__emplace<_Ip>(_Tp(_VSTD::forward<_Arg>(__arg)));
+          __this->__emplace<_Ip>(_VSTD::forward<_Arg>(__arg));
         }
         __assignment* __this;
         _Arg&& __arg;
       } __impl{this, _VSTD::forward<_Arg>(__arg)};
-      __impl(bool_constant<is_nothrow_constructible_v<_Tp, _Arg> ||
-                           !is_nothrow_move_constructible_v<_Tp>>{});
+      __impl(__tag);
     }
   }
 
@@ -910,7 +919,8 @@
           [this](auto& __this_alt, auto&& __that_alt) {
             this->__assign_alt(
                 __this_alt,
-                _VSTD::forward<decltype(__that_alt)>(__that_alt).__value);
+                _VSTD::forward<decltype(__that_alt)>(__that_alt).__value,
+                is_lvalue_reference<_That>{});
           },
           *this, _VSTD::forward<_That>(__that));
     }
@@ -1010,7 +1020,8 @@
   inline _LIBCPP_INLINE_VISIBILITY
   void __assign(_Arg&& __arg) {
     this->__assign_alt(__access::__base::__get_alt<_Ip>(*this),
-                       _VSTD::forward<_Arg>(__arg));
+                       _VSTD::forward<_Arg>(__arg),
+                       false_type{});
   }
 
   inline _LIBCPP_INLINE_VISIBILITY
@@ -1084,6 +1095,7 @@
           __all<is_move_constructible_v<_Types>...>::value>,
       private __sfinae_assign_base<
           __all<(is_copy_constructible_v<_Types> &&
+                 is_move_constructible_v<_Types> &&
                  is_copy_assignable_v<_Types>)...>::value,
           __all<(is_move_constructible_v<_Types> &&
                  is_move_assignable_v<_Types>)...>::value> {
@@ -1126,7 +1138,7 @@
       : __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {}
 
   template <size_t _Ip, class... _Args,
-            class = enable_if_t<(_Ip < sizeof...(_Types)), int>,
+            enable_if_t<(_Ip < sizeof...(_Types)), int> = 0,
             class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
             enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
   inline _LIBCPP_INLINE_VISIBILITY
@@ -1206,8 +1218,8 @@
       class _Tp = variant_alternative_t<_Ip, variant<_Types...>>,
       enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
   inline _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(_Args&&... __args) {
-    return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+  void emplace(_Args&&... __args) {
+    __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
   }
 
   template <
@@ -1219,8 +1231,8 @@
       enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
                   int> = 0>
   inline _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
-    return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+  void emplace(initializer_list<_Up> __il, _Args&&... __args) {
+    __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
   }
 
   template <
@@ -1230,8 +1242,8 @@
           __find_detail::__find_unambiguous_index_sfinae<_Tp, _Types...>::value,
       enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
   inline _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(_Args&&... __args) {
-    return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
+  void emplace(_Args&&... __args) {
+    __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
   }
 
   template <
@@ -1243,8 +1255,8 @@
       enable_if_t<is_constructible_v<_Tp, initializer_list<_Up>&, _Args...>,
                   int> = 0>
   inline _LIBCPP_INLINE_VISIBILITY
-  _Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
-    return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
+  void emplace(initializer_list<_Up> __il, _Args&&... __args) {
+    __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
   }
 
   inline _LIBCPP_INLINE_VISIBILITY
@@ -1550,7 +1562,7 @@
   using result_type = size_t;
 
   inline _LIBCPP_INLINE_VISIBILITY
-  result_type operator()(const argument_type&) const _NOEXCEPT {
+  result_type operator()(const argument_type&) const {
     return 66740831; // return a fundamentally attractive random value.
   }
 };
diff --git a/include/vector b/include/vector
index ee19fb7..ded057b 100644
--- a/include/vector
+++ b/include/vector
@@ -275,16 +275,14 @@
 #include <__split_buffer>
 #include <__functional_base>
 
+#include <__undef_min_max>
+
 #include <__debug>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header
 #endif
 
-_LIBCPP_PUSH_MACROS
-#include <__undef_macros>
-
-
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <bool>
@@ -415,10 +413,8 @@
 void
 __vector_base<_Tp, _Allocator>::__destruct_at_end(pointer __new_last) _NOEXCEPT
 {
-    pointer __soon_to_be_end = __end_;
-    while (__new_last != __soon_to_be_end)
-        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__soon_to_be_end));
-    __end_ = __new_last;
+    while (__new_last != __end_)
+        __alloc_traits::destroy(__alloc(), _VSTD::__to_raw_pointer(--__end_));
 }
 
 template <class _Tp, class _Allocator>
@@ -529,7 +525,12 @@
                                  is_constructible<
                                     value_type,
                                     typename iterator_traits<_ForwardIterator>::reference>::value>::type* = 0);
-
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    _LIBCPP_INLINE_VISIBILITY
+    vector(initializer_list<value_type> __il);
+    _LIBCPP_INLINE_VISIBILITY
+    vector(initializer_list<value_type> __il, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 #if _LIBCPP_DEBUG_LEVEL >= 2
     _LIBCPP_INLINE_VISIBILITY
     ~vector()
@@ -542,14 +543,7 @@
     vector(const vector& __x, const allocator_type& __a);
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(const vector& __x);
-
-#ifndef _LIBCPP_CXX03_LANG
-    _LIBCPP_INLINE_VISIBILITY
-    vector(initializer_list<value_type> __il);
-
-    _LIBCPP_INLINE_VISIBILITY
-    vector(initializer_list<value_type> __il, const allocator_type& __a);
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     vector(vector&& __x)
 #if _LIBCPP_STD_VER > 14
@@ -557,18 +551,17 @@
 #else
         _NOEXCEPT_(is_nothrow_move_constructible<allocator_type>::value);
 #endif
-
     _LIBCPP_INLINE_VISIBILITY
     vector(vector&& __x, const allocator_type& __a);
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(vector&& __x)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end()); return *this;}
-
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template <class _InputIterator>
         typename enable_if
@@ -593,12 +586,11 @@
         assign(_ForwardIterator __first, _ForwardIterator __last);
 
     void assign(size_type __n, const_reference __u);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end());}
-#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY
     allocator_type get_allocator() const _NOEXCEPT
@@ -682,10 +674,9 @@
         {return _VSTD::__to_raw_pointer(this->__begin_);}
 
     _LIBCPP_INLINE_VISIBILITY void push_back(const_reference __x);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY void push_back(value_type&& __x);
-
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         _LIBCPP_INLINE_VISIBILITY
 #if _LIBCPP_STD_VER > 14
@@ -693,19 +684,19 @@
 #else
         void      emplace_back(_Args&&... __args);
 #endif
-#endif // !_LIBCPP_CXX03_LANG
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     void pop_back();
 
     iterator insert(const_iterator __position, const_reference __x);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert(const_iterator __position, value_type&& __x);
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... _Args>
         iterator emplace(const_iterator __position, _Args&&... __args);
-#endif  // !_LIBCPP_CXX03_LANG
-
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert(const_iterator __position, size_type __n, const_reference __x);
     template <class _InputIterator>
         typename enable_if
@@ -728,12 +719,11 @@
             iterator
         >::type
         insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __position, initializer_list<value_type> __il)
         {return insert(__position, __il.begin(), __il.end());}
-#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
     iterator erase(const_iterator __first, const_iterator __last);
@@ -806,16 +796,18 @@
         __base::__destruct_at_end(__new_last);
         __annotate_shrink(__old_size);
     }
-
-#ifndef _LIBCPP_CXX03_LANG
-    template <class _Up> void __push_back_slow_path(_Up&& __x);
-
-    template <class... _Args>
-    void __emplace_back_slow_path(_Args&&... __args);
+    template <class _Up>
+        void
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+        __push_back_slow_path(_Up&& __x);
 #else
-    template <class _Up> void __push_back_slow_path(_Up& __x);
+        __push_back_slow_path(_Up& __x);
 #endif
-
+#if !defined(_LIBCPP_HAS_NO_VARIADICS) && !defined(_LIBCPP_HAS_NO_RVALUE_REFERENCES)
+    template <class... _Args>
+        void
+        __emplace_back_slow_path(_Args&&... __args);
+#endif
     // The following functions are no-ops outside of AddressSanitizer mode.
     // We call annotatations only for the default Allocator because other allocators
     // may not meet the AddressSanitizer alignment constraints.
@@ -1225,7 +1217,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1272,6 +1264,8 @@
     }
 }
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 vector<_Tp, _Allocator>::vector(initializer_list<value_type> __il)
@@ -1301,6 +1295,8 @@
     }
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
 vector<_Tp, _Allocator>&
@@ -1342,7 +1338,7 @@
 #endif
 }
 
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1564,7 +1560,7 @@
 template <class _Tp, class _Allocator>
 template <class _Up>
 void
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 vector<_Tp, _Allocator>::__push_back_slow_path(_Up&& __x)
 #else
 vector<_Tp, _Allocator>::__push_back_slow_path(_Up& __x)
@@ -1595,7 +1591,7 @@
         __push_back_slow_path(__x);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -1615,6 +1611,8 @@
         __push_back_slow_path(_VSTD::move(__x));
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Allocator>
 template <class... _Args>
 void
@@ -1654,7 +1652,8 @@
 #endif
 }
 
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 inline
@@ -1759,7 +1758,7 @@
     return __make_iter(__p);
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 typename vector<_Tp, _Allocator>::iterator
@@ -1798,6 +1797,8 @@
     return __make_iter(__p);
 }
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
+
 template <class _Tp, class _Allocator>
 template <class... _Args>
 typename vector<_Tp, _Allocator>::iterator
@@ -1837,7 +1838,8 @@
     return __make_iter(__p);
 }
 
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_VARIADICS
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Tp, class _Allocator>
 typename vector<_Tp, _Allocator>::iterator
@@ -2034,7 +2036,7 @@
     _VSTD::swap(this->__begin_, __x.__begin_);
     _VSTD::swap(this->__end_, __x.__end_);
     _VSTD::swap(this->__end_cap(), __x.__end_cap());
-    __swap_allocator(this->__alloc(), __x.__alloc(),
+    __swap_allocator(this->__alloc(), __x.__alloc(), 
         integral_constant<bool,__alloc_traits::propagate_on_container_swap::value>());
 #if _LIBCPP_DEBUG_LEVEL >= 2
     __get_db()->swap(this, &__x);
@@ -2229,11 +2231,12 @@
     vector(const vector& __v);
     vector(const vector& __v, const allocator_type& __a);
     vector& operator=(const vector& __v);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     vector(initializer_list<value_type> __il);
     vector(initializer_list<value_type> __il, const allocator_type& __a);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     _LIBCPP_INLINE_VISIBILITY
     vector(vector&& __v)
 #if _LIBCPP_STD_VER > 14
@@ -2245,12 +2248,12 @@
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(vector&& __v)
         _NOEXCEPT_((__noexcept_move_assign_container<_Allocator, __alloc_traits>::value));
-
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     vector& operator=(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end()); return *this;}
-
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     template <class _InputIterator>
         typename enable_if
@@ -2269,12 +2272,11 @@
         assign(_ForwardIterator __first, _ForwardIterator __last);
 
     void assign(size_type __n, const value_type& __x);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     void assign(initializer_list<value_type> __il)
         {assign(__il.begin(), __il.end());}
-#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY allocator_type get_allocator() const _NOEXCEPT
         {return allocator_type(this->__alloc());}
@@ -2383,12 +2385,11 @@
             iterator
         >::type
         insert(const_iterator __position, _ForwardIterator __first, _ForwardIterator __last);
-
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     _LIBCPP_INLINE_VISIBILITY
     iterator insert(const_iterator __position, initializer_list<value_type> __il)
         {return insert(__position, __il.begin(), __il.end());}
-#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
     _LIBCPP_INLINE_VISIBILITY iterator erase(const_iterator __position);
     iterator erase(const_iterator __first, const_iterator __last);
@@ -2748,7 +2749,7 @@
     }
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Allocator>
 vector<bool, _Allocator>::vector(initializer_list<value_type> __il)
@@ -2778,7 +2779,7 @@
     }
 }
 
-#endif  // _LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 template <class _Allocator>
 vector<bool, _Allocator>::~vector()
@@ -2835,7 +2836,7 @@
     return *this;
 }
 
-#ifndef _LIBCPP_CXX03_LANG
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Allocator>
 inline _LIBCPP_INLINE_VISIBILITY
@@ -2910,7 +2911,7 @@
     __c.__cap() = __c.__size_ = 0;
 }
 
-#endif  // !_LIBCPP_CXX03_LANG
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class _Allocator>
 void
@@ -3200,7 +3201,7 @@
     _VSTD::swap(this->__begin_, __x.__begin_);
     _VSTD::swap(this->__size_, __x.__size_);
     _VSTD::swap(this->__cap(), __x.__cap());
-    __swap_allocator(this->__alloc(), __x.__alloc(),
+    __swap_allocator(this->__alloc(), __x.__alloc(), 
         integral_constant<bool, __alloc_traits::propagate_on_container_swap::value>());
 }
 
@@ -3359,6 +3360,4 @@
 
 _LIBCPP_END_NAMESPACE_STD
 
-_LIBCPP_POP_MACROS
-
 #endif  // _LIBCPP_VECTOR
diff --git a/include/wchar.h b/include/wchar.h
index a5666e1..c0c6ef7 100644
--- a/include/wchar.h
+++ b/include/wchar.h
@@ -166,12 +166,9 @@
 }
 #endif
 
-#if defined(__cplusplus) && defined(_LIBCPP_MSVCRT_LIKE)
-extern "C" {
-size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
-                  size_t nmc, size_t len, mbstate_t *__restrict ps);
-size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
-                  size_t nwc, size_t len, mbstate_t *__restrict ps);
+#if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT) || defined(__MINGW32__))
+extern "C++" {
+#include <support/win32/support.h> // pull in *swprintf defines
 }  // extern "C++"
 #endif  // __cplusplus && _LIBCPP_MSVCRT
 
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index fe45f5a..66bb14c 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -83,12 +83,7 @@
 add_library_flags_if(LIBCXX_HAS_C_LIB c)
 add_library_flags_if(LIBCXX_HAS_M_LIB m)
 add_library_flags_if(LIBCXX_HAS_RT_LIB rt)
-if (LIBCXX_USE_COMPILER_RT)
-  find_compiler_rt_library(builtins LIBCXX_BUILTINS_LIBRARY)
-  add_library_flags_if(LIBCXX_BUILTINS_LIBRARY "${LIBCXX_BUILTINS_LIBRARY}")
-else()
-  add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
-endif()
+add_library_flags_if(LIBCXX_HAS_GCC_S_LIB gcc_s)
 add_library_flags_if(LIBCXX_HAVE_CXX_ATOMICS_WITH_LIB atomic)
 
 # Add the unwinder library.
@@ -121,7 +116,6 @@
   add_library_flags(ucrt${LIB_SUFFIX}) # Universal C runtime
   add_library_flags(vcruntime${LIB_SUFFIX}) # C++ runtime
   add_library_flags(msvcrt${LIB_SUFFIX}) # C runtime startup files
-  add_library_flags(msvcprt${LIB_SUFFIX}) # C++ standard library. Required for exception_ptr internals.
   # Required for standards-complaint wide character formatting functions
   # (e.g. `printfw`/`scanfw`)
   add_library_flags(iso_stdio_wide_specifiers)
@@ -156,7 +150,7 @@
       "-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
       "/usr/lib/libSystem.B.dylib")
   else()
-	  if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
+    if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
       list(FIND CMAKE_OSX_ARCHITECTURES "armv7" OSX_HAS_ARMV7)
       if (NOT OSX_HAS_ARMV7 EQUAL -1)
         set(OSX_RE_EXPORT_LINE
@@ -168,10 +162,8 @@
       endif()
     else()
       set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
-      if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
-        add_link_flags("/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi-new-delete.exp")
-      endif()
     endif()
+
     add_link_flags(
       "-compatibility_version 1"
       "-install_name /usr/lib/libc++.1.dylib"
@@ -185,7 +177,7 @@
 split_list(LIBCXX_COMPILE_FLAGS)
 split_list(LIBCXX_LINK_FLAGS)
 
-# Add an object library that contains the compiled source files.
+# Add a object library that contains the compiled source files.
 add_library(cxx_objects OBJECT ${exclude_from_all} ${LIBCXX_SOURCES} ${LIBCXX_HEADERS})
 if(WIN32 AND NOT MINGW)
   target_compile_definitions(cxx_objects
@@ -242,13 +234,11 @@
 if (LIBCXX_ENABLE_STATIC)
   add_library(cxx_static STATIC $<TARGET_OBJECTS:cxx_objects>)
   target_link_libraries(cxx_static ${LIBCXX_LIBRARIES})
-  set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
   set_target_properties(cxx_static
     PROPERTIES
       LINK_FLAGS    "${LIBCXX_LINK_FLAGS}"
       OUTPUT_NAME   "c++"
   )
-
   list(APPEND LIBCXX_TARGETS "cxx_static")
   # Attempt to merge the libc++.a archive and the ABI library archive into one.
   if (LIBCXX_ENABLE_STATIC_ABI_LIBRARY)
diff --git a/lib/libc++abi-new-delete.exp b/lib/libc++abi-new-delete.exp
deleted file mode 100644
index a9e651d..0000000
--- a/lib/libc++abi-new-delete.exp
+++ /dev/null
@@ -1,8 +0,0 @@
-__ZdaPv
-__ZdlPv
-__ZdlPvRKSt9nothrow_t
-__Znam
-__ZdaPvRKSt9nothrow_t
-__Znwm
-__ZnwmRKSt9nothrow_t
-__ZnamRKSt9nothrow_t
diff --git a/lib/libc++abi2.exp b/lib/libc++abi2.exp
index eb088f3..47dcbbb 100644
--- a/lib/libc++abi2.exp
+++ b/lib/libc++abi2.exp
@@ -209,6 +209,14 @@
 __ZNSt20bad_array_new_lengthD0Ev
 __ZNSt20bad_array_new_lengthD2Ev
 __ZSt10unexpectedv
+# __ZdaPv
+# __ZdlPv
+# __ZdlPvRKSt9nothrow_t
+# __Znam
+# __ZdaPvRKSt9nothrow_t
+# __Znwm
+# __ZnwmRKSt9nothrow_t
+# __ZnamRKSt9nothrow_t
 __ZTISt10bad_typeid
 __ZTISt8bad_cast
 ___cxa_bad_typeid
diff --git a/src/chrono.cpp b/src/chrono.cpp
index d0e184a..9b277a6 100644
--- a/src/chrono.cpp
+++ b/src/chrono.cpp
@@ -37,7 +37,7 @@
 #if defined(_LIBCPP_WIN32API)
 #define WIN32_LEAN_AND_MEAN
 #define VC_EXTRA_LEAN
-#include <windows.h>
+#include <Windows.h>
 #if _WIN32_WINNT >= _WIN32_WINNT_WIN8
 #include <winapifamily.h>
 #endif
diff --git a/src/condition_variable.cpp b/src/condition_variable.cpp
index 2200aef..3f60727 100644
--- a/src/condition_variable.cpp
+++ b/src/condition_variable.cpp
@@ -14,7 +14,6 @@
 #include "condition_variable"
 #include "thread"
 #include "system_error"
-#include "__undef_macros"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
diff --git a/src/exception.cpp b/src/exception.cpp
index 4359d12..0b502cd 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -20,7 +20,7 @@
 
 #if defined(_LIBCPP_ABI_MICROSOFT)
 #include "support/runtime/exception_msvc.ipp"
-#include "support/runtime/exception_pointer_msvc.ipp"
+#include "support/runtime/exception_pointer_unimplemented.ipp"
 #elif defined(_LIBCPPABI_VERSION)
 #include "support/runtime/exception_libcxxabi.ipp"
 #include "support/runtime/exception_pointer_cxxabi.ipp"
diff --git a/src/experimental/filesystem/operations.cpp b/src/experimental/filesystem/operations.cpp
index 2856ae4..bd76858 100644
--- a/src/experimental/filesystem/operations.cpp
+++ b/src/experimental/filesystem/operations.cpp
@@ -513,8 +513,8 @@
     return true;
 }
 
-using TimeSpec = struct timespec;
-using StatT =  struct stat;
+using TimeSpec = struct ::timespec;
+using StatT = struct ::stat;
 
 #if defined(__APPLE__)
 TimeSpec extract_mtime(StatT const& st) { return st.st_mtimespec; }
diff --git a/src/functional.cpp b/src/functional.cpp
deleted file mode 100644
index 5c2646f..0000000
--- a/src/functional.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-//===----------------------- functional.cpp -------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "functional"
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION
-bad_function_call::~bad_function_call() _NOEXCEPT
-{
-}
-
-const char*
-bad_function_call::what() const _NOEXCEPT
-{
-    return "std::bad_function_call";
-}
-#endif
-
-_LIBCPP_END_NAMESPACE_STD
diff --git a/src/include/atomic_support.h b/src/include/atomic_support.h
index 08847e6..378541b 100644
--- a/src/include/atomic_support.h
+++ b/src/include/atomic_support.h
@@ -29,7 +29,7 @@
 #endif
 
 #if !defined(_LIBCPP_HAS_ATOMIC_BUILTINS) && !defined(_LIBCPP_HAS_NO_THREADS)
-# if defined(_LIBCPP_WARNING)
+# if defined(_LIBCPP_MSVC)
     _LIBCPP_WARNING("Building libc++ without __atomic builtins is unsupported")
 # else
 #   warning Building libc++ without __atomic builtins is unsupported
diff --git a/src/ios.cpp b/src/ios.cpp
index c1d2327..5c5f241 100644
--- a/src/ios.cpp
+++ b/src/ios.cpp
@@ -25,7 +25,6 @@
 #include "new"
 #include "streambuf"
 #include "string"
-#include "__undef_macros"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
diff --git a/src/iostream.cpp b/src/iostream.cpp
index 534b47a..a972be9 100644
--- a/src/iostream.cpp
+++ b/src/iostream.cpp
@@ -15,14 +15,14 @@
 
 #ifndef _LIBCPP_HAS_NO_STDIN
 _ALIGNAS_TYPE (istream) _LIBCPP_FUNC_VIS char cin[sizeof(istream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?cin@__1@std@@3V?$basic_istream@DU?$char_traits@D@__1@std@@@12@A")
 #endif
 ;
 _ALIGNAS_TYPE (__stdinbuf<char> ) static char __cin[sizeof(__stdinbuf <char>)];
 static mbstate_t mb_cin;
 _ALIGNAS_TYPE (wistream) _LIBCPP_FUNC_VIS char wcin[sizeof(wistream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?wcin@__1@std@@3V?$basic_istream@_WU?$char_traits@_W@__1@std@@@12@A")
 #endif
 ;
@@ -32,14 +32,14 @@
 
 #ifndef _LIBCPP_HAS_NO_STDOUT
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?cout@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
 #endif
 ;
 _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cout[sizeof(__stdoutbuf<char>)];
 static mbstate_t mb_cout;
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcout[sizeof(wostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?wcout@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
 #endif
 ;
@@ -48,14 +48,14 @@
 #endif
 
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cerr[sizeof(ostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?cerr@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
 #endif
 ;
 _ALIGNAS_TYPE (__stdoutbuf<char>) static char __cerr[sizeof(__stdoutbuf<char>)];
 static mbstate_t mb_cerr;
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wcerr[sizeof(wostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?wcerr@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
 #endif
 ;
@@ -63,12 +63,12 @@
 static mbstate_t mb_wcerr;
 
 _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char clog[sizeof(ostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?clog@__1@std@@3V?$basic_ostream@DU?$char_traits@D@__1@std@@@12@A")
 #endif
 ;
 _ALIGNAS_TYPE (wostream) _LIBCPP_FUNC_VIS char wclog[sizeof(wostream)]
-#if defined(_LIBCPP_ABI_MICROSOFT) && defined(__clang__)
+#if defined(_MSC_VER) && defined(__clang__)
 __asm__("?wclog@__1@std@@3V?$basic_ostream@_WU?$char_traits@_W@__1@std@@@12@A")
 #endif
 ;
diff --git a/src/locale.cpp b/src/locale.cpp
index f53ad00..0bb1a72 100644
--- a/src/locale.cpp
+++ b/src/locale.cpp
@@ -39,7 +39,6 @@
 #endif
 #include <stdlib.h>
 #include <stdio.h>
-#include "__undef_macros"
 
 // On Linux, wint_t and wchar_t have different signed-ness, and this causes
 // lots of noise in the build log, but no bugs that I know of. 
@@ -49,24 +48,6 @@
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
-struct __libcpp_unique_locale {
-  __libcpp_unique_locale(const char* nm) : __loc_(newlocale(LC_ALL_MASK, nm, 0)) {}
-
-  ~__libcpp_unique_locale() {
-    if (__loc_)
-      freelocale(__loc_);
-  }
-
-  explicit operator bool() const { return __loc_; }
-
-  locale_t& get() { return __loc_; }
-
-  locale_t __loc_;
-private:
-  __libcpp_unique_locale(__libcpp_unique_locale const&);
-  __libcpp_unique_locale& operator=(__libcpp_unique_locale const&);
-};
-
 #ifdef __cloc_defined
 locale_t __cloc() {
   // In theory this could create a race condition. In practice
@@ -90,8 +71,8 @@
 make(A0 a0)
 {
     static typename aligned_storage<sizeof(T)>::type buf;
-    auto *obj = ::new (&buf) T(a0);
-    return *obj;
+    ::new (&buf) T(a0);
+    return *reinterpret_cast<T*>(&buf);
 }
 
 template <class T, class A0, class A1>
@@ -110,8 +91,8 @@
 make(A0 a0, A1 a1, A2 a2)
 {
     static typename aligned_storage<sizeof(T)>::type buf;
-    auto *obj = ::new (&buf) T(a0, a1, a2);
-    return *obj;
+    ::new (&buf) T(a0, a1, a2);
+    return *reinterpret_cast<T*>(&buf);
 }
 
 template <typename T, size_t N>
@@ -502,8 +483,8 @@
 {
     // only one thread can get in here and it only gets in once
     static aligned_storage<sizeof(locale)>::type buf;
-    auto *obj = ::new (&buf) locale(locale::classic());
-    return *obj;
+    ::new (&buf) locale(locale::classic());
+    return *reinterpret_cast<locale*>(&buf);
 }
 
 locale&
@@ -1131,7 +1112,13 @@
 #elif __sun__
     return __ctype_mask;
 #elif defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
+#if _VC_CRT_MAJOR_VERSION < 14
+    // This is assumed to be safe, which is a nonsense assumption because we're
+    // going to end up dereferencing it later...
+    return _ctype+1; // internal ctype mask table defined in msvcrt.dll
+#else
     return __pctype_func();
+#endif
 #elif defined(__EMSCRIPTEN__)
     return *__ctype_b_loc();
 #elif defined(_NEWLIB_VERSION)
@@ -4207,7 +4194,7 @@
 
 static bool checked_string_to_wchar_convert(wchar_t& dest,
                                             const char* ptr,
-                                            locale_t loc) {
+                                            __locale_struct* loc) {
   if (*ptr == '\0')
     return false;
   mbstate_t mb = {};
@@ -4222,7 +4209,7 @@
 
 static bool checked_string_to_char_convert(char& dest,
                                            const char* ptr,
-                                           locale_t __loc) {
+                                           __locale_struct* __loc) {
   if (*ptr == '\0')
     return false;
   if (!ptr[1]) {
@@ -4317,8 +4304,8 @@
 {
     if (strcmp(nm, "C") != 0)
     {
-        __libcpp_unique_locale loc(nm);
-        if (!loc)
+        __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+        if (loc == nullptr)
             __throw_runtime_error("numpunct_byname<char>::numpunct_byname"
                                 " failed to construct for " + string(nm));
 
@@ -4355,8 +4342,8 @@
 {
     if (strcmp(nm, "C") != 0)
     {
-        __libcpp_unique_locale loc(nm);
-        if (!loc)
+        __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+        if (loc == nullptr)
             __throw_runtime_error("numpunct_byname<wchar_t>::numpunct_byname"
                                 " failed to construct for " + string(nm));
 
@@ -5842,8 +5829,8 @@
 moneypunct_byname<char, false>::init(const char* nm)
 {
     typedef moneypunct<char, false> base;
-    __libcpp_unique_locale loc(nm);
-    if (!loc)
+    __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+    if (loc == nullptr)
         __throw_runtime_error("moneypunct_byname"
                             " failed to construct for " + string(nm));
 
@@ -5886,8 +5873,8 @@
 moneypunct_byname<char, true>::init(const char* nm)
 {
     typedef moneypunct<char, true> base;
-    __libcpp_unique_locale loc(nm);
-    if (!loc)
+    __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+    if (loc == nullptr)
         __throw_runtime_error("moneypunct_byname"
                             " failed to construct for " + string(nm));
 
@@ -5946,8 +5933,8 @@
 moneypunct_byname<wchar_t, false>::init(const char* nm)
 {
     typedef moneypunct<wchar_t, false> base;
-    __libcpp_unique_locale loc(nm);
-    if (!loc)
+    __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+    if (loc == nullptr)
         __throw_runtime_error("moneypunct_byname"
                             " failed to construct for " + string(nm));
     lconv* lc = __libcpp_localeconv_l(loc.get());
@@ -6011,8 +5998,8 @@
 moneypunct_byname<wchar_t, true>::init(const char* nm)
 {
     typedef moneypunct<wchar_t, true> base;
-    __libcpp_unique_locale loc(nm);
-    if (!loc)
+    __locale_unique_ptr loc(newlocale(LC_ALL_MASK, nm, 0), freelocale);
+    if (loc == nullptr)
         __throw_runtime_error("moneypunct_byname"
                             " failed to construct for " + string(nm));
 
diff --git a/src/memory.cpp b/src/memory.cpp
index 4e0d3af..f6f6fe8 100644
--- a/src/memory.cpp
+++ b/src/memory.cpp
@@ -120,7 +120,7 @@
                                              object_owners+1))
             return this;
     }
-    return nullptr;
+    return 0;
 }
 
 #if !defined(_LIBCPP_NO_RTTI) || !defined(_LIBCPP_BUILD_STATIC)
@@ -128,7 +128,7 @@
 const void*
 __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
 {
-    return nullptr;
+    return 0;
 }
 
 #endif  // _LIBCPP_NO_RTTI
@@ -154,7 +154,7 @@
 {
     auto m = static_cast<__libcpp_mutex_t*>(__lx);
     unsigned count = 0;
-    while (!__libcpp_mutex_trylock(m))
+    while (__libcpp_mutex_trylock(m) != 0)
     {
         if (++count > 16)
         {
diff --git a/src/mutex.cpp b/src/mutex.cpp
index c36bd55..b858e88 100644
--- a/src/mutex.cpp
+++ b/src/mutex.cpp
@@ -12,7 +12,6 @@
 #include "limits"
 #include "system_error"
 #include "include/atomic_support.h"
-#include "__undef_macros"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 #ifndef _LIBCPP_HAS_NO_THREADS
diff --git a/src/new.cpp b/src/new.cpp
index 2b2682f..21b3074 100644
--- a/src/new.cpp
+++ b/src/new.cpp
@@ -183,7 +183,7 @@
     if (static_cast<size_t>(alignment) < sizeof(void*))
       alignment = std::align_val_t(sizeof(void*));
     void* p;
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCPP_MSVCRT)
     while ((p = _aligned_malloc(size, static_cast<size_t>(alignment))) == nullptr)
 #else
     while (::posix_memalign(&p, static_cast<size_t>(alignment), size) != 0)
@@ -256,7 +256,7 @@
 operator delete(void* ptr, std::align_val_t) _NOEXCEPT
 {
     if (ptr)
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCPP_MSVCRT)
         ::_aligned_free(ptr);
 #else
         ::free(ptr);
diff --git a/src/string.cpp b/src/string.cpp
index 6a175f2..fb85203 100644
--- a/src/string.cpp
+++ b/src/string.cpp
@@ -16,6 +16,9 @@
 #include "cerrno"
 #include "limits"
 #include "stdexcept"
+#ifdef _LIBCPP_MSVCRT
+#include "support/win32/support.h"
+#endif // _LIBCPP_MSVCRT
 #include <stdio.h>
 
 _LIBCPP_BEGIN_NAMESPACE_STD
@@ -430,7 +433,7 @@
 #ifndef _LIBCPP_MSVCRT
     return swprintf;
 #else
-    return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(_snwprintf);
+    return static_cast<int (__cdecl*)(wchar_t* __restrict, size_t, const wchar_t*__restrict, ...)>(swprintf);
 #endif
 }
 
diff --git a/src/strstream.cpp b/src/strstream.cpp
index 01523cf..be94f9c 100644
--- a/src/strstream.cpp
+++ b/src/strstream.cpp
@@ -13,7 +13,6 @@
 #include "cstring"
 #include "cstdlib"
 #include "__debug"
-#include "__undef_macros"
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
diff --git a/src/support/runtime/exception_pointer_msvc.ipp b/src/support/runtime/exception_pointer_msvc.ipp
deleted file mode 100644
index eab5d30..0000000
--- a/src/support/runtime/exception_pointer_msvc.ipp
+++ /dev/null
@@ -1,95 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <yvals.h> // for _CRTIMP2_PURE
-
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCreate(_Out_ void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrDestroy(_Inout_ void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrCopy(_Out_ void*,
-                                                              _In_ const void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrAssign(_Inout_ void*, _In_ const void*);
-_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrCompare(_In_ const void*, _In_ const void*);
-_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrToBool(_In_ const void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL __ExceptionPtrSwap(_Inout_ void*,
-                                                              _Inout_ void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrCurrentException(_Out_ void*);
-[[noreturn]] _CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrRethrow(_In_ const void*);
-_CRTIMP2_PURE void __CLRCALL_PURE_OR_CDECL
-__ExceptionPtrCopyException(_Inout_ void*, _In_ const void*, _In_ const void*);
-
-namespace std {
-
-exception_ptr::exception_ptr() _NOEXCEPT { __ExceptionPtrCreate(this); }
-exception_ptr::exception_ptr(nullptr_t) _NOEXCEPT { __ExceptionPtrCreate(this); }
-
-exception_ptr::exception_ptr(const exception_ptr& __other) _NOEXCEPT {
-  __ExceptionPtrCopy(this, &__other);
-}
-exception_ptr& exception_ptr::operator=(const exception_ptr& __other) _NOEXCEPT {
-  __ExceptionPtrAssign(this, &__other);
-  return *this;
-}
-
-exception_ptr& exception_ptr::operator=(nullptr_t) _NOEXCEPT {
-  exception_ptr dummy;
-  __ExceptionPtrAssign(this, &dummy);
-  return *this;
-}
-
-exception_ptr::~exception_ptr() _NOEXCEPT { __ExceptionPtrDestroy(this); }
-
-exception_ptr::operator bool() const _NOEXCEPT {
-  return __ExceptionPtrToBool(this);
-}
-
-bool operator==(const exception_ptr& __x, const exception_ptr& __y) _NOEXCEPT {
-  return __ExceptionPtrCompare(&__x, &__y);
-}
-
-
-void swap(exception_ptr& lhs, exception_ptr& rhs) _NOEXCEPT {
-  __ExceptionPtrSwap(&rhs, &lhs);
-}
-
-exception_ptr __copy_exception_ptr(void* __except, const void* __ptr) {
-  exception_ptr __ret = nullptr;
-  if (__ptr)
-    __ExceptionPtrCopyException(&__ret, __except, __ptr);
-  return __ret;
-}
-
-exception_ptr current_exception() _NOEXCEPT {
-  exception_ptr __ret;
-  __ExceptionPtrCurrentException(&__ret);
-  return __ret;
-}
-
-_LIBCPP_NORETURN
-void rethrow_exception(exception_ptr p) { __ExceptionPtrRethrow(&p); }
-
-nested_exception::nested_exception() _NOEXCEPT : __ptr_(current_exception()) {}
-
-nested_exception::~nested_exception() _NOEXCEPT {}
-
-_LIBCPP_NORETURN
-void nested_exception::rethrow_nested() const {
-  if (__ptr_ == nullptr)
-    terminate();
-  rethrow_exception(__ptr_);
-}
-
-} // namespace std
diff --git a/src/support/win32/locale_win32.cpp b/src/support/win32/locale_win32.cpp
index 13a6eae..ee13811 100644
--- a/src/support/win32/locale_win32.cpp
+++ b/src/support/win32/locale_win32.cpp
@@ -13,14 +13,16 @@
 #include <memory>
 #include <type_traits>
 
-using std::__libcpp_locale_guard;
+#include <crtversion.h>
+
+typedef _VSTD::remove_pointer<locale_t>::type __locale_struct;
+typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii;
 
 // FIXME: base currently unused. Needs manual work to construct the new locale
 locale_t newlocale( int mask, const char * locale, locale_t /*base*/ )
 {
     return _create_locale( mask, locale );
 }
-
 locale_t uselocale( locale_t newloc )
 {
     locale_t old_locale = _get_current_locale();
@@ -29,78 +31,67 @@
     // uselocale sets the thread's locale by definition, so unconditionally use thread-local locale
     _configthreadlocale( _ENABLE_PER_THREAD_LOCALE );
     // uselocale sets all categories
-    // disable setting locale on Windows temporarily because the structure is opaque (PR31516)
-    //setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
+#if _VC_CRT_MAJOR_VERSION < 14
+    setlocale( LC_ALL, newloc->locinfo->lc_category[LC_ALL].locale );
+#endif
     // uselocale returns the old locale_t
     return old_locale;
 }
-
-decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
-{
-#if defined(_LIBCPP_MSVCRT)
-  return ___mb_cur_max_l_func(__l);
-#else
-  __libcpp_locale_guard __current(__l);
-  return MB_CUR_MAX;
-#endif
-}
-
-
 lconv *localeconv_l( locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return localeconv();
 }
 size_t mbrlen_l( const char *__restrict s, size_t n,
                  mbstate_t *__restrict ps, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return mbrlen( s, n, ps );
 }
 size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
                     size_t len, mbstate_t *__restrict ps, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return mbsrtowcs( dst, src, len, ps );
 }
 size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps,
                   locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return wcrtomb( s, wc, ps );
 }
 size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s,
                   size_t n, mbstate_t *__restrict ps, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return mbrtowc( pwc, s, n, ps );
 }
 size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src,
                      size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return mbsnrtowcs( dst, src, nms, len, ps );
 }
 size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
                      size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return wcsnrtombs( dst, src, nwc, len, ps );
 }
 wint_t btowc_l( int c, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return btowc( c );
 }
 int wctob_l( wint_t c, locale_t loc )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return wctob( c );
 }
 
 int snprintf_l(char *ret, size_t n, locale_t loc, const char *format, ...)
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     va_list ap;
     va_start( ap, format );
     int result = vsnprintf( ret, n, format, ap );
@@ -118,18 +109,6 @@
 }
 int vasprintf_l( char **ret, locale_t loc, const char *format, va_list ap )
 {
-    __libcpp_locale_guard __current(loc);
+    __locale_raii __current( uselocale(loc), uselocale );
     return vasprintf( ret, format, ap );
 }
-
-#if !defined(_LIBCPP_MSVCRT)
-float strtof_l(const char* nptr, char** endptr, locale_t loc) {
-  __libcpp_locale_guard __current(loc);
-  return strtof(nptr, endptr);
-}
-
-long double strtold_l(const char* nptr, char** endptr, locale_t loc) {
-  __libcpp_locale_guard __current(loc);
-  return strtold(nptr, endptr);
-}
-#endif
diff --git a/src/support/win32/support.cpp b/src/support/win32/support.cpp
index dbd1c4c..e989681 100644
--- a/src/support/win32/support.cpp
+++ b/src/support/win32/support.cpp
@@ -15,6 +15,17 @@
 #include <cstring> // strcpy, wcsncpy
 #include <cwchar>  // mbstate_t
 
+// Some of these functions aren't standard or if they conform, the name does not.
+
+int asprintf(char **sptr, const char *__restrict format, ...)
+{
+    va_list ap;
+    va_start(ap, format);
+    int result;
+    result = vasprintf(sptr, format, ap);
+    va_end(ap);
+    return result;
+}
 
 // Like sprintf, but when return value >= 0 it returns
 // a pointer to a malloc'd string in *sptr.
diff --git a/src/system_error.cpp b/src/system_error.cpp
index 17f2c9a..cbbbb5d 100644
--- a/src/system_error.cpp
+++ b/src/system_error.cpp
@@ -65,7 +65,7 @@
 
 string do_strerror_r(int ev);
 
-#if defined(_LIBCPP_MSVCRT_LIKE)
+#if defined(_LIBCPP_MSVCRT)
 string do_strerror_r(int ev) {
   char buffer[strerror_buff_size];
   if (::strerror_s(buffer, strerror_buff_size, ev) == 0)
diff --git a/src/thread.cpp b/src/thread.cpp
index 550da8e..3f283c3 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -34,7 +34,7 @@
 
 #if defined(_LIBCPP_WIN32API)
 #include <windows.h>
-#endif
+#endif // defined(_LIBCPP_WIN32API)
 
 _LIBCPP_BEGIN_NAMESPACE_STD
 
@@ -99,7 +99,7 @@
 #else  // defined(CTL_HW) && defined(HW_NCPU)
     // TODO: grovel through /proc or check cpuid on x86 and similar
     // instructions on other architectures.
-#   if defined(_LIBCPP_WARNING)
+#   if defined(_LIBCPP_MSVC)
         _LIBCPP_WARNING("hardware_concurrency not yet implemented")
 #   else
 #       warning hardware_concurrency not yet implemented
diff --git a/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp b/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp
deleted file mode 100644
index ef3ef75..0000000
--- a/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.cxx1z.pass.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// template <class RandomAccessIterator>
-//     void
-//     random_shuffle(RandomAccessIterator first, RandomAccessIterator last);
-//
-// template <class RandomAccessIterator, class RandomNumberGenerator>
-//     void
-//     random_shuffle(RandomAccessIterator first, RandomAccessIterator last,
-//                    RandomNumberGenerator& rand);
-
-//
-//  In C++17, random_shuffle has been removed.
-//  However, for backwards compatibility, if _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
-//  is defined before including <algorithm>, then random_shuffle will be restored.
-
-#define _LIBCPP_ENABLE_CXX17_REMOVED_RANDOM_SHUFFLE
-
-#include <algorithm>
-#include <vector>
-
-struct gen
-{
-    std::ptrdiff_t operator()(std::ptrdiff_t n)
-    {
-        return n-1;
-    }
-};
-
-
-int main()
-{
-    std::vector<int> v;
-    std::random_shuffle(v.begin(), v.end());
-    gen r;
-    std::random_shuffle(v.begin(), v.end(), r);
-}
diff --git a/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp b/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
index 51a1f23..d8bb363 100644
--- a/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
+++ b/test/libcxx/atomics/diagnose_invalid_memory_order.fail.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test fails because diagnose_if doesn't emit all of the diagnostics
-// when -fdelayed-template-parsing is enabled, like it is on Windows.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: verify-support, diagnose-if-support
 // UNSUPPORTED: libcpp-has-no-threads
 
diff --git a/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp b/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
index a0b35f3..c84960f 100644
--- a/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.cons/db_copy.pass.cpp
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <list>
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
 
 // list(list&& c);
 
diff --git a/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp b/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
index 570e5a0..dd424e8 100644
--- a/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.cons/db_move.pass.cpp
@@ -9,9 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // list(list&& c);
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
index 67146bc..1d64f9b 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/emplace_db1.pass.cpp
@@ -9,9 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // template <class... Args> void emplace(const_iterator p, Args&&... args);
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
index 24cadbe..ec5de02 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator position) with end()
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
index 6d3e761..833e2b5 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_db2.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator position) with iterator from another container
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
index dd592f9..eef7a98 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator first, const_iterator last); with first iterator from another container
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
index d5e8fd9..0dd03dc 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db2.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator first, const_iterator last); with second iterator from another container
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
index 3ae20cd..22273a8 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db3.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator first, const_iterator last); with both iterators from another container
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
index 6d6e29e..d1e03c8 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/erase_iter_iter_db4.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // Call erase(const_iterator first, const_iterator last); with a bad range
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
index 03b9667..7fadb14 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_iter_iter_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // template <InputIterator Iter>
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
index 589af7c..0d0fd10 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_rvalue_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // iterator insert(const_iterator position, value_type&& x);
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
index 6999c40..4fdfbfa 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_size_value_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // iterator insert(const_iterator position, size_type n, const value_type& x);
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
index 66983f0..9a13520 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/insert_iter_value_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // iterator insert(const_iterator position, const value_type& x);
diff --git a/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp b/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
index 9151fc1..795e66d 100644
--- a/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.modifiers/pop_back_db1.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // void pop_back();
diff --git a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
index 541dd05..7a1180a 100644
--- a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // void splice(const_iterator position, list& x);
diff --git a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
index 64ef78e..fa5243e 100644
--- a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // void splice(const_iterator position, list<T,Allocator>& x, iterator i);
diff --git a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
index 9fed4b5..a385b4c 100644
--- a/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
+++ b/test/libcxx/containers/sequences/list/list.ops/db_splice_pos_list_iter_iter.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // <list>
 
 // void splice(const_iterator position, list& x, iterator first, iterator last);
diff --git a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
index 30cf3f4..43324e9 100644
--- a/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
+++ b/test/libcxx/containers/sequences/vector/asan_throw.pass.cpp
@@ -13,7 +13,6 @@
 #include <vector>
 #include <cassert>
 
-#include "test_macros.h"
 #include "asan_testing.h"
 
 class X {
@@ -71,7 +70,7 @@
 }
 
 void test_emplace_back() {
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
   std::vector<X> v;
   v.reserve(2);
   v.push_back(X(2));
@@ -84,7 +83,7 @@
   }
   assert(v.size() == 1);
   assert(is_contiguous_container_asan_correct(v));
-#endif
+#endif // _LIBCPP_HAS_NO_VARIADICS
 }
 
 void test_insert_range() {
@@ -122,7 +121,7 @@
 }
 
 void test_emplace() {
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
   std::vector<X> v;
   v.reserve(3);
   v.insert(v.end(), X(1));
@@ -136,7 +135,7 @@
   }
   assert(v.size() == 2);
   assert(is_contiguous_container_asan_correct(v));
-#endif
+#endif // _LIBCPP_HAS_NO_VARIADICS
 }
 
 void test_insert_range2() {
diff --git a/test/libcxx/containers/unord/next_pow2.pass.cpp b/test/libcxx/containers/unord/next_pow2.pass.cpp
deleted file mode 100644
index 3784eb8..0000000
--- a/test/libcxx/containers/unord/next_pow2.pass.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// REQUIRES: long_tests
-// UNSUPPORTED: c++98, c++03
-
-// Not a portable test
-
-// <__hash_table>
-
-// size_t __next_hash_pow2(size_t n);
-
-// If n <= 1, return n. If n is a power of 2, return n.
-// Otherwise, return the next power of 2.
-
-#include <__hash_table>
-#include <unordered_map>
-#include <cassert>
-
-#include <iostream>
-
-bool
-is_power_of_two(unsigned long n)
-{
-    return __builtin_popcount(n) == 1;
-}
-
-void test_next_pow2_val(size_t n)
-{
-        std::size_t npow2 = std::__next_hash_pow2(n);
-        assert(is_power_of_two(npow2) && npow2 > n);
-}
-
-void
-test_next_pow2()
-{
-    assert(!is_power_of_two(0));
-    assert(is_power_of_two(1));
-    assert(is_power_of_two(2));
-    assert(!is_power_of_two(3));
-
-    assert(std::__next_hash_pow2(0) == 0);
-    assert(std::__next_hash_pow2(1) == 1);
-
-    for (std::size_t n = 2; n < (sizeof(std::size_t) * 8 - 1); ++n)
-    {
-        std::size_t pow2 = 1ULL << n;
-        assert(std::__next_hash_pow2(pow2) == pow2);
-    }
-
-	test_next_pow2_val(3);
-	test_next_pow2_val(7);
-	test_next_pow2_val(9);
-	test_next_pow2_val(15);
-	test_next_pow2_val(127);
-	test_next_pow2_val(129);
-}
-
-// Note: this is only really useful when run with -fsanitize=undefined.
-void
-fuzz_unordered_map_reserve(unsigned num_inserts,
-                           unsigned num_reserve1,
-                           unsigned num_reserve2)
-{
-    std::unordered_map<uint64_t, unsigned long> m;
-    m.reserve(num_reserve1);
-    for (unsigned I = 0; I < num_inserts; ++I) m[I] = 0;
-    m.reserve(num_reserve2);
-    assert(m.bucket_count() >= num_reserve2);
-}
-
-int main()
-{
-    test_next_pow2();
-
-    for (unsigned num_inserts = 0; num_inserts <= 64; ++num_inserts)
-        for (unsigned num_reserve1 = 1; num_reserve1 <= 64; ++num_reserve1)
-            for (unsigned num_reserve2 = 1; num_reserve2 <= 64; ++num_reserve2)
-                fuzz_unordered_map_reserve(num_inserts, num_reserve1, num_reserve2);
-
-    return 0;
-}
diff --git a/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp b/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
index d6554a6..d682e74 100644
--- a/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
+++ b/test/libcxx/containers/unord/unord.set/missing_hash_specialization.fail.cpp
@@ -53,7 +53,7 @@
   // FIXME: It would be great to suppress the below diagnostic all together.
   //        but for now it's sufficient that it appears last. However there is
   //        currently no way to test the order diagnostics are issued.
-  // expected-error@memory:* {{call to implicitly-deleted default constructor of '__compressed_pair_elem}}
+  // expected-error@memory:* {{call to implicitly-deleted default constructor of 'std::__1::hash<std::__1::pair<int, int> >'}}
   }
   {
     using Set = std::unordered_set<int, BadHashNoCopy>;
diff --git a/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp b/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
index a727b31..91cdf85 100644
--- a/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
+++ b/test/libcxx/debug/containers/db_associative_container_tests.pass.cpp
@@ -12,9 +12,6 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // test container debugging
 
 #define _LIBCPP_DEBUG 1
diff --git a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
index 3ae009a..6e2fb7b 100644
--- a/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
+++ b/test/libcxx/debug/containers/db_sequence_container_iterators.pass.cpp
@@ -12,9 +12,6 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // test container debugging
 
 #define _LIBCPP_DEBUG 1
diff --git a/test/libcxx/debug/containers/db_string.pass.cpp b/test/libcxx/debug/containers/db_string.pass.cpp
index f6434d5..8d1a622 100644
--- a/test/libcxx/debug/containers/db_string.pass.cpp
+++ b/test/libcxx/debug/containers/db_string.pass.cpp
@@ -12,9 +12,6 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // test container debugging
 
 #define _LIBCPP_DEBUG 1
diff --git a/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp b/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
index d6a31e3..5618607 100644
--- a/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
+++ b/test/libcxx/debug/containers/db_unord_container_tests.pass.cpp
@@ -12,9 +12,6 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // test container debugging
 
 #define _LIBCPP_DEBUG 1
diff --git a/test/libcxx/debug/debug_abort.pass.cpp b/test/libcxx/debug/debug_abort.pass.cpp
index 9a1b475..b6e7b0b 100644
--- a/test/libcxx/debug/debug_abort.pass.cpp
+++ b/test/libcxx/debug/debug_abort.pass.cpp
@@ -10,9 +10,6 @@
 
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // Test that the default debug handler aborts the program.
 
 #define _LIBCPP_DEBUG 0
diff --git a/test/libcxx/debug/debug_throw.pass.cpp b/test/libcxx/debug/debug_throw.pass.cpp
index d1c8840..716750c 100644
--- a/test/libcxx/debug/debug_throw.pass.cpp
+++ b/test/libcxx/debug/debug_throw.pass.cpp
@@ -11,9 +11,6 @@
 // UNSUPPORTED: libcpp-no-exceptions
 // MODULES_DEFINES: _LIBCPP_DEBUG=0
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // Test that the default debug handler can be overridden and test the
 // throwing debug handler.
 
diff --git a/test/libcxx/debug/debug_throw_register.pass.cpp b/test/libcxx/debug/debug_throw_register.pass.cpp
index 0d2586b..ec4be70 100644
--- a/test/libcxx/debug/debug_throw_register.pass.cpp
+++ b/test/libcxx/debug/debug_throw_register.pass.cpp
@@ -12,9 +12,6 @@
 // MODULES_DEFINES: _LIBCPP_DEBUG=1
 // MODULES_DEFINES: _LIBCPP_DEBUG_USE_EXCEPTIONS
 
-// Can't test the system lib because this test enables debug mode
-// UNSUPPORTED: with_system_cxx_lib
-
 // Test that defining _LIBCPP_DEBUG_USE_EXCEPTIONS causes _LIBCPP_ASSERT
 // to throw on failure.
 
diff --git a/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp b/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp
deleted file mode 100644
index 9b84693..0000000
--- a/test/libcxx/depr/depr.function.objects/depr.adaptors.cxx1z.pass.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-
-//  In C++17, the function adapters mem_fun/mem_fun_ref, etc have been removed.
-//  However, for backwards compatibility, if _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
-//  is defined before including <functional>, then they will be restored.
-
-#define _LIBCPP_ENABLE_CXX17_REMOVED_BINDERS
-
-#include <functional>
-#include <cassert>
-
-int identity(int v) { return v; }
-int sum(int a, int b) { return a + b; }
-
-struct Foo {
-	int zero() const { return 0; }
-	int identity(int v) const { return v; }
-	int sum(int a, int b) const { return a + b; }
-};
-
-int main()
-{
-	typedef std::pointer_to_unary_function<int, int> PUF;
-	typedef std::pointer_to_binary_function<int, int, int> PBF;
-	assert((std::ptr_fun<int, int>(identity)(4) == 4));
-	assert((std::ptr_fun<int, int, int>(sum)(4, 5) == 9));
-
-	Foo f;
-	assert((std::mem_fn(&Foo::identity)(f, 5) == 5));
-	assert((std::mem_fn(&Foo::sum)(f, 5, 6) == 11));
-
-    typedef std::mem_fun_ref_t<int, Foo> MFR;
-    typedef std::const_mem_fun_ref_t<int, Foo> CMFR;
-
-	assert((std::mem_fun_ref(&Foo::zero)(f) == 0));
-	assert((std::mem_fun_ref(&Foo::identity)(f, 5) == 5));
-}
diff --git a/test/libcxx/double_include.sh.cpp b/test/libcxx/double_include.sh.cpp
index 0a9e9fc..46dfc99 100644
--- a/test/libcxx/double_include.sh.cpp
+++ b/test/libcxx/double_include.sh.cpp
@@ -137,9 +137,6 @@
 #include <experimental/algorithm>
 #include <experimental/any>
 #include <experimental/chrono>
-#if defined(__cpp_coroutines)
-#include <experimental/coroutine>
-#endif
 #include <experimental/deque>
 #include <experimental/dynarray>
 #include <experimental/filesystem>
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
index db7484d..14f5c4e 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default.pass.cpp
@@ -8,12 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
 
 // dynarray.cons
 
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
index 9c6cad8..8d7d28b 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.cons/default_throws_bad_alloc.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-no-exceptions
-// XFAIL: availability
 // dynarray.cons
 
 // explicit dynarray(size_type c);
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
index 5c745e0..84c6029 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.data/default.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
 
 // dynarray.data
 
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
index 1ed5153..376c94a 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.mutate/default.pass.cpp
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
-
 // dynarray.data
 
 // void fill(const T& v);
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
index 473313f..ef9be45 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/at.pass.cpp
@@ -9,8 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 // UNSUPPORTED: libcpp-no-exceptions
-// XFAIL: availability
-
 // dynarray.overview
 
 // const_reference at(size_type n) const;
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
index f0aa1e3..38aefdf 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/begin_end.pass.cpp
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
-
 // dynarray.overview
 
 
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
index a548429..95262aa 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/capacity.pass.cpp
@@ -8,8 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
-
 // dynarray.overview
 
 // size_type size()     const noexcept;
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
index 0ba27cf..4f1d097 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/front_back.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
 
 // dynarray.overview
 
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
index 4306d1e..4bcb229 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.overview/indexing.pass.cpp
@@ -8,14 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
 // dynarray.overview
 
 // const_reference at(size_type n) const;
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
index ab49600..c0e0180 100644
--- a/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
+++ b/test/libcxx/experimental/containers/sequences/dynarray/dynarray.zero/default.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
 // dynarray.zero
 
 // dynarray shall provide support for the special case of construction with a size of zero.
diff --git a/test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg b/test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg
deleted file mode 100644
index 93553b5..0000000
--- a/test/libcxx/experimental/containers/sequences/dynarray/lit.local.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-if ('availability' in config.available_features
-        and not 'libcpp-no-exceptions' in config.available_features):
-    config.unsupported = True
diff --git a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp b/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
deleted file mode 100644
index 6f839be..0000000
--- a/test/libcxx/experimental/filesystem/class.path/path.itr/reverse_iterator_produces_diagnostic.fail.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <experimental/filesystem>
-
-// class path
-
-#include <experimental/filesystem>
-#include <iterator>
-
-
-namespace fs = std::experimental::filesystem;
-
-int main() {
-  using namespace fs;
-  using RIt = std::reverse_iterator<path::iterator>;
-
-  // expected-error@iterator:* {{static_assert failed "The specified iterator type cannot be used with reverse_iterator; Using stashing iterators with reverse_iterator causes undefined behavior"}}
-  {
-    RIt r;
-    ((void)r);
-  }
-}
diff --git a/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp b/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp
deleted file mode 100644
index 56f47c8..0000000
--- a/test/libcxx/experimental/language.support/support.coroutines/dialect_support.sh.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// REQUIRES: fcoroutines-ts
-
-// RUN: %build -fcoroutines-ts
-// RUN: %run
-
-// A simple "breathing" test that checks that <experimental/coroutine>
-// can be parsed and used in all dialects, including C++03 in order to match
-// Clang's behavior.
-
-#include <experimental/coroutine>
-
-namespace coro = std::experimental::coroutines_v1;
-
-coro::suspend_always sa;
-coro::suspend_never sn;
-
-struct MyFuture {
-  struct promise_type {
-    typedef coro::coroutine_handle<promise_type> HandleT;
-    coro::suspend_never initial_suspend() { return sn; }
-    coro::suspend_always final_suspend() { return sa; }
-    coro::suspend_never yield_value(int) { return sn; }
-    MyFuture get_return_object() {
-      MyFuture f(HandleT::from_promise(*this));
-      return f;
-    }
-    void return_void() {}
-    void unhandled_exception() {}
-  };
-  typedef promise_type::HandleT HandleT;
-  MyFuture() : p() {}
-  MyFuture(HandleT h) : p(h) {}
-
-  coro::coroutine_handle<promise_type> p;
-};
-
-MyFuture test_coro() {
-  co_await sn;
-  co_yield 42;
-  co_return;
-}
-
-int main()
-{
-  MyFuture f = test_coro();
-  while (!f.p.done())
-    f.p.resume();
-  f.p.destroy();
-}
diff --git a/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp b/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp
deleted file mode 100644
index 229ce10..0000000
--- a/test/libcxx/experimental/language.support/support.coroutines/version.sh.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// REQUIRES: fcoroutines-ts
-
-// RUN: %build -fcoroutines-ts
-// RUN: %run
-
-#include <experimental/coroutine>
-
-#ifndef _LIBCPP_VERSION
-#error _LIBCPP_VERSION must be defined
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/iterators/trivial_iterators.pass.cpp b/test/libcxx/iterators/trivial_iterators.pass.cpp
index fa3ebf2..d924a57 100644
--- a/test/libcxx/iterators/trivial_iterators.pass.cpp
+++ b/test/libcxx/iterators/trivial_iterators.pass.cpp
@@ -179,7 +179,7 @@
     static_assert(( std::__libcpp_is_trivial_iterator<std::basic_string<char>::reverse_iterator>      ::value), "");
     static_assert(( std::__libcpp_is_trivial_iterator<std::basic_string<char>::const_reverse_iterator>::value), "");
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 //  Initializer list  (which has no reverse iterators)
     static_assert(( std::__libcpp_is_trivial_iterator<std::initializer_list<char>::iterator>              ::value), "");
     static_assert(( std::__libcpp_is_trivial_iterator<std::initializer_list<char>::const_iterator>        ::value), "");
diff --git a/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp b/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp
index c37d234..cc99b83 100644
--- a/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp
+++ b/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp
@@ -8,15 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability
-
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
-
 // test bad_array_length
 
 #include <new>
diff --git a/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
index 388fbeb..04b4000 100644
--- a/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
+++ b/test/libcxx/language.support/support.dynamic/new_faligned_allocation.sh.cpp
@@ -10,19 +10,8 @@
 // test libc++'s implementation of align_val_t, and the relevent new/delete
 // overloads in all dialects when -faligned-allocation is present.
 
-// Libc++ defers to the underlying MSVC library to provide the new/delete
-// definitions, which does not yet provide aligned allocation
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: -faligned-allocation
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // RUN: %build -faligned-allocation
 // RUN: %run
 
@@ -85,4 +74,4 @@
     assert(typeid(std::align_val_t).name() == std::string("St11align_val_t"));
   }
 #endif
-}
+}
\ No newline at end of file
diff --git a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
index 18cc0ca..9ba422f 100644
--- a/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
+++ b/test/libcxx/localization/locales/locale.convenience/conversions/conversions.string/ctor_move.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// 'do_bytes' throws a std::range_error unexpectedly
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: c++98, c++03
 
 // <locale>
diff --git a/test/libcxx/min_max_macros.sh.cpp b/test/libcxx/min_max_macros.sh.cpp
deleted file mode 100644
index bae4175..0000000
--- a/test/libcxx/min_max_macros.sh.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// Test that we can include each header in two TU's and link them together.
-
-// RUN: %compile -fsyntax-only
-
-// Prevent <ext/hash_map> from generating deprecated warnings for this test.
-#if defined(__DEPRECATED)
-#undef __DEPRECATED
-#endif
-
-#define TEST_MACROS() static_assert(min() == true && max() == true, "")
-#define min() true
-#define max() true
-
-// Top level headers
-#include <algorithm>
-TEST_MACROS();
-#include <any>
-TEST_MACROS();
-#include <array>
-TEST_MACROS();
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <atomic>
-TEST_MACROS();
-#endif
-#include <bitset>
-TEST_MACROS();
-#include <cassert>
-TEST_MACROS();
-#include <ccomplex>
-TEST_MACROS();
-#include <cctype>
-TEST_MACROS();
-#include <cerrno>
-TEST_MACROS();
-#include <cfenv>
-TEST_MACROS();
-#include <cfloat>
-TEST_MACROS();
-#include <chrono>
-TEST_MACROS();
-#include <cinttypes>
-TEST_MACROS();
-#include <ciso646>
-TEST_MACROS();
-#include <climits>
-TEST_MACROS();
-#include <clocale>
-TEST_MACROS();
-#include <cmath>
-TEST_MACROS();
-#include <codecvt>
-TEST_MACROS();
-#include <complex>
-TEST_MACROS();
-#include <complex.h>
-TEST_MACROS();
-#include <condition_variable>
-TEST_MACROS();
-#include <csetjmp>
-TEST_MACROS();
-#include <csignal>
-TEST_MACROS();
-#include <cstdarg>
-TEST_MACROS();
-#include <cstdbool>
-TEST_MACROS();
-#include <cstddef>
-TEST_MACROS();
-#include <cstdint>
-TEST_MACROS();
-#include <cstdio>
-TEST_MACROS();
-#include <cstdlib>
-TEST_MACROS();
-#include <cstring>
-TEST_MACROS();
-#include <ctgmath>
-TEST_MACROS();
-#include <ctime>
-TEST_MACROS();
-#include <ctype.h>
-TEST_MACROS();
-#include <cwchar>
-TEST_MACROS();
-#include <cwctype>
-TEST_MACROS();
-#include <deque>
-TEST_MACROS();
-#include <errno.h>
-TEST_MACROS();
-#include <exception>
-TEST_MACROS();
-#include <float.h>
-TEST_MACROS();
-#include <forward_list>
-TEST_MACROS();
-#include <fstream>
-TEST_MACROS();
-#include <functional>
-TEST_MACROS();
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <future>
-TEST_MACROS();
-#endif
-#include <initializer_list>
-TEST_MACROS();
-#include <inttypes.h>
-TEST_MACROS();
-#include <iomanip>
-TEST_MACROS();
-#include <ios>
-TEST_MACROS();
-#include <iosfwd>
-TEST_MACROS();
-#include <iostream>
-TEST_MACROS();
-#include <istream>
-TEST_MACROS();
-#include <iterator>
-TEST_MACROS();
-#include <limits>
-TEST_MACROS();
-#include <limits.h>
-TEST_MACROS();
-#include <list>
-TEST_MACROS();
-#include <locale>
-TEST_MACROS();
-#include <locale.h>
-TEST_MACROS();
-#include <map>
-TEST_MACROS();
-#include <math.h>
-TEST_MACROS();
-#include <memory>
-TEST_MACROS();
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <mutex>
-TEST_MACROS();
-#endif
-#include <new>
-TEST_MACROS();
-#include <numeric>
-TEST_MACROS();
-#include <optional>
-TEST_MACROS();
-#include <ostream>
-TEST_MACROS();
-#include <queue>
-TEST_MACROS();
-#include <random>
-TEST_MACROS();
-#include <ratio>
-TEST_MACROS();
-#include <regex>
-TEST_MACROS();
-#include <scoped_allocator>
-TEST_MACROS();
-#include <set>
-TEST_MACROS();
-#include <setjmp.h>
-TEST_MACROS();
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <shared_mutex>
-TEST_MACROS();
-#endif
-#include <sstream>
-TEST_MACROS();
-#include <stack>
-TEST_MACROS();
-#include <stdbool.h>
-TEST_MACROS();
-#include <stddef.h>
-TEST_MACROS();
-#include <stdexcept>
-TEST_MACROS();
-#include <stdint.h>
-TEST_MACROS();
-#include <stdio.h>
-TEST_MACROS();
-#include <stdlib.h>
-TEST_MACROS();
-#include <streambuf>
-TEST_MACROS();
-#include <string>
-TEST_MACROS();
-#include <string.h>
-TEST_MACROS();
-#include <string_view>
-TEST_MACROS();
-#include <strstream>
-TEST_MACROS();
-#include <system_error>
-TEST_MACROS();
-#include <tgmath.h>
-TEST_MACROS();
-#ifndef _LIBCPP_HAS_NO_THREADS
-#include <thread>
-TEST_MACROS();
-#endif
-#include <tuple>
-TEST_MACROS();
-#include <typeindex>
-TEST_MACROS();
-#include <typeinfo>
-TEST_MACROS();
-#include <type_traits>
-TEST_MACROS();
-#include <unordered_map>
-TEST_MACROS();
-#include <unordered_set>
-TEST_MACROS();
-#include <utility>
-TEST_MACROS();
-#include <valarray>
-TEST_MACROS();
-#include <variant>
-TEST_MACROS();
-#include <vector>
-TEST_MACROS();
-#include <wchar.h>
-TEST_MACROS();
-#include <wctype.h>
-TEST_MACROS();
-
-// experimental headers
-#if __cplusplus >= 201103L
-#include <experimental/algorithm>
-TEST_MACROS();
-#include <experimental/any>
-TEST_MACROS();
-#include <experimental/chrono>
-TEST_MACROS();
-#include <experimental/deque>
-TEST_MACROS();
-#include <experimental/dynarray>
-TEST_MACROS();
-#include <experimental/filesystem>
-TEST_MACROS();
-#include <experimental/forward_list>
-TEST_MACROS();
-#include <experimental/functional>
-TEST_MACROS();
-#include <experimental/iterator>
-TEST_MACROS();
-#include <experimental/list>
-TEST_MACROS();
-#include <experimental/map>
-TEST_MACROS();
-#include <experimental/memory_resource>
-TEST_MACROS();
-#include <experimental/numeric>
-TEST_MACROS();
-#include <experimental/optional>
-TEST_MACROS();
-#include <experimental/propagate_const>
-TEST_MACROS();
-#include <experimental/ratio>
-TEST_MACROS();
-#include <experimental/regex>
-TEST_MACROS();
-#include <experimental/set>
-TEST_MACROS();
-#include <experimental/string>
-TEST_MACROS();
-#include <experimental/string_view>
-TEST_MACROS();
-#include <experimental/system_error>
-TEST_MACROS();
-#include <experimental/tuple>
-TEST_MACROS();
-#include <experimental/type_traits>
-TEST_MACROS();
-#include <experimental/unordered_map>
-TEST_MACROS();
-#include <experimental/unordered_set>
-TEST_MACROS();
-#include <experimental/utility>
-TEST_MACROS();
-#include <experimental/vector>
-TEST_MACROS();
-#endif // __cplusplus >= 201103L
-
-// extended headers
-#include <ext/hash_map>
-TEST_MACROS();
-#include <ext/hash_set>
-TEST_MACROS();
diff --git a/test/libcxx/modules/cinttypes_exports.sh.cpp b/test/libcxx/modules/cinttypes_exports.sh.cpp
index ce39cee..99d20ec 100644
--- a/test/libcxx/modules/cinttypes_exports.sh.cpp
+++ b/test/libcxx/modules/cinttypes_exports.sh.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: modules-support
 
 // Test that <cinttypes> re-exports <cstdint>
diff --git a/test/libcxx/modules/clocale_exports.sh.cpp b/test/libcxx/modules/clocale_exports.sh.cpp
index aacddd2..69b1a9b 100644
--- a/test/libcxx/modules/clocale_exports.sh.cpp
+++ b/test/libcxx/modules/clocale_exports.sh.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: modules-support
 // UNSUPPORTED: c++98, c++03
 
diff --git a/test/libcxx/modules/cstdint_exports.sh.cpp b/test/libcxx/modules/cstdint_exports.sh.cpp
index 3d3cbe3..8ecc1da 100644
--- a/test/libcxx/modules/cstdint_exports.sh.cpp
+++ b/test/libcxx/modules/cstdint_exports.sh.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: modules-support
 
 // Test that <cstdint> re-exports <stdint.h>
diff --git a/test/libcxx/modules/inttypes_h_exports.sh.cpp b/test/libcxx/modules/inttypes_h_exports.sh.cpp
index 5354c8f..d1598d7 100644
--- a/test/libcxx/modules/inttypes_h_exports.sh.cpp
+++ b/test/libcxx/modules/inttypes_h_exports.sh.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test fails on Windows because the underlying libc headers on Windows
-// are not modular
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // REQUIRES: modules-support
 
 // Test that intypes.h re-exports stdint.h
diff --git a/test/libcxx/selftest/test.arc.pass.mm b/test/libcxx/selftest/test.arc.pass.mm
deleted file mode 100644
index ec272a8..0000000
--- a/test/libcxx/selftest/test.arc.pass.mm
+++ /dev/null
@@ -1,17 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#if __has_feature(objc_arc) == 0
-#error "arc should be enabled"
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/selftest/test.fail.mm b/test/libcxx/selftest/test.fail.mm
deleted file mode 100644
index 764daf0..0000000
--- a/test/libcxx/selftest/test.fail.mm
+++ /dev/null
@@ -1,13 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#if __has_feature(objc_arc) == 0
-#error This test should not compile.
-#endif
diff --git a/test/libcxx/selftest/test.pass.mm b/test/libcxx/selftest/test.pass.mm
deleted file mode 100644
index b428955..0000000
--- a/test/libcxx/selftest/test.pass.mm
+++ /dev/null
@@ -1,17 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#if __has_feature(objc_arc)
-#error "arc should *not* be enabled"
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/strings/iterators.exceptions.pass.cpp b/test/libcxx/strings/iterators.exceptions.pass.cpp
index 7dea53c..b236c51 100644
--- a/test/libcxx/strings/iterators.exceptions.pass.cpp
+++ b/test/libcxx/strings/iterators.exceptions.pass.cpp
@@ -80,7 +80,7 @@
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::reverse_iterator>      ::value), "");
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::const_reverse_iterator>::value), "");
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 //  Initializer list  (which has no reverse iterators)
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::iterator>              ::value), "");
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::const_iterator>        ::value), "");
diff --git a/test/libcxx/strings/iterators.noexcept.pass.cpp b/test/libcxx/strings/iterators.noexcept.pass.cpp
index 20b4e3d..b8e0b4c 100644
--- a/test/libcxx/strings/iterators.noexcept.pass.cpp
+++ b/test/libcxx/strings/iterators.noexcept.pass.cpp
@@ -28,7 +28,6 @@
 #include <vector>
 #include <initializer_list>
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 int main()
@@ -73,7 +72,7 @@
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::reverse_iterator>      ::value), "");
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::basic_string<char>::const_reverse_iterator>::value), "");
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 //  Initializer list  (which has no reverse iterators)
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::iterator>              ::value), "");
     static_assert(( std::__libcpp_string_gets_noexcept_iterator<std::initializer_list<char>::const_iterator>        ::value), "");
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
index 9efa597..bf567a3 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception.pass.cpp
@@ -6,6 +6,7 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+//
 
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
diff --git a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
index dca4933..1cb61d9 100644
--- a/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
+++ b/test/libcxx/thread/futures/futures.promise/set_exception_at_thread_exit.pass.cpp
@@ -6,6 +6,7 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
+//
 
 // UNSUPPORTED: libcpp-no-exceptions
 // UNSUPPORTED: libcpp-has-no-threads
diff --git a/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp b/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
new file mode 100644
index 0000000..7e4fe22
--- /dev/null
+++ b/test/libcxx/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_mangling.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
+
+// TODO(EricWF) Investigate why typeid(...).name() returns a different string
+// on GCC 4.9 but not newer GCCs.
+// XFAIL: gcc-4.9
+// XFAIL: windows
+
+// THIS TESTS C++03 EXTENSIONS.
+
+// <mutex>
+
+// template <class ...Mutex> class lock_guard;
+
+// Test that the the variadic lock guard implementation mangles the same in
+// C++11 and C++03. This is important since the mangling of `lock_guard` depends
+// on it being declared as a variadic template, even in C++03.
+
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#include <mutex>
+#include <string>
+#include <typeinfo>
+#include <cassert>
+
+int main() {
+    const std::string expect = "NSt3__110lock_guardIJNS_5mutexEEEE";
+    assert(typeid(std::lock_guard<std::mutex>).name() == expect);
+}
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
index 6024d99..bff682e 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_guard.pass.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// On Windows Clang bugs out when both __declspec and __attribute__ are present,
-// the processing goes awry preventing the definition of the types.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: libcpp-has-no-threads
 // REQUIRES: thread-safety
 
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
index 3ada120..3898d08 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_lock_unlock.pass.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// On Windows Clang bugs out when both __declspec and __attribute__ are present,
-// the processing goes awry preventing the definition of the types.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: libcpp-has-no-threads
 // REQUIRES: thread-safety
 
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
index cf3e638..941e9ff 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// On Windows Clang bugs out when both __declspec and __attribute__ are present,
-// the processing goes awry preventing the definition of the types.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: libcpp-has-no-threads
 // REQUIRES: thread-safety
 
diff --git a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
index e068104..1a5685e 100644
--- a/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
+++ b/test/libcxx/thread/thread.mutex/thread_safety_requires_capability.pass.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// On Windows Clang bugs out when both __declspec and __attribute__ are present,
-// the processing goes awry preventing the definition of the types.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: libcpp-has-no-threads
 // REQUIRES: thread-safety
 
diff --git a/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp b/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
deleted file mode 100644
index 87cd292..0000000
--- a/test/libcxx/utilities/memory/util.smartptr/util.smartptr.shared/function_type_default_deleter.fail.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// UNSUPPORTED: c++98, c++03
-
-#include <memory>
-
-template <int> struct Tag {};
-
-template <int ID>
-using SPtr = std::shared_ptr<void(Tag<ID>)>;
-
-template <int ID>
-using FnType = void(Tag<ID>);
-
-template <int ID>
-void TestFn(Tag<ID>) {}
-
-template <int ID>
-FnType<ID>* getFn() {
-  return &TestFn<ID>;
-}
-
-struct Deleter {
-  template <class Tp>
-  void operator()(Tp) const {
-    using RawT = typename std::remove_pointer<Tp>::type;
-    static_assert(std::is_function<RawT>::value ||
-                  std::is_same<typename std::remove_cv<RawT>::type,
-                               std::nullptr_t>::value,
-                  "");
-  }
-};
-
-int main() {
-  {
-    SPtr<0> s; // OK
-    SPtr<1> s1(nullptr); // OK
-    SPtr<2> s2(getFn<2>(), Deleter{}); // OK
-    SPtr<3> s3(nullptr, Deleter{}); // OK
-  }
-  // expected-error@memory:* 2 {{static_assert failed "default_delete cannot be instantiated for function types"}}
-  {
-    SPtr<4> s4(getFn<4>()); // expected-note {{requested here}}
-    SPtr<5> s5(getFn<5>(), std::default_delete<FnType<5>>{}); // expected-note {{requested here}}
-  }
-}
diff --git a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp b/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp
index 8868842..1c715e0 100644
--- a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp
+++ b/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/__has_operator_addressof.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // type_traits
 
 // extension
@@ -18,6 +16,7 @@
 
 #include <type_traits>
 
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
 
 struct A
 {
@@ -55,9 +54,11 @@
     constexpr J* operator&() const &&;
 };
 
+#endif  // _LIBCPP_HAS_NO_CONSTEXPR
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert(std::__has_operator_addressof<int>::value == false, "");
     static_assert(std::__has_operator_addressof<A>::value == false, "");
     static_assert(std::__has_operator_addressof<B>::value == true, "");
@@ -66,4 +67,5 @@
     static_assert(std::__has_operator_addressof<G>::value == true, "");
     static_assert(std::__has_operator_addressof<H>::value == true, "");
     static_assert(std::__has_operator_addressof<J>::value == true, "");
+#endif  // _LIBCPP_HAS_NO_CONSTEXPR
 }
diff --git a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.fail.cpp b/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.fail.cpp
deleted file mode 100644
index e3e083b..0000000
--- a/test/libcxx/utilities/meta/meta.unary/meta.unary.prop/missing_is_aggregate_trait.fail.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// <type_traits>
-
-// template <class T> struct is_aggregate;
-// template <class T> constexpr bool is_aggregate_v = is_aggregate<T>::value;
-
-#include <type_traits>
-
-int main ()
-{
-#ifdef _LIBCPP_HAS_NO_IS_AGGREGATE
-  // This should not compile when _LIBCPP_HAS_NO_IS_AGGREGATE is defined.
-  bool b = __is_aggregate(void);
-  ((void)b);
-#else
-#error Forcing failure...
-#endif
-}
diff --git a/test/libcxx/utilities/template.bitset/includes.pass.cpp b/test/libcxx/utilities/template.bitset/includes.pass.cpp
deleted file mode 100644
index 2e3c281..0000000
--- a/test/libcxx/utilities/template.bitset/includes.pass.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// test that <bitset> includes <cstddef>, <string>, <stdexcept> and <iosfwd>
-
-#include <bitset>
-
-#ifndef _LIBCPP_CSTDDEF
-#error <cstddef> has not been included
-#endif
-
-#ifndef _LIBCPP_STRING
-#error <string> has not been included
-#endif
-
-#ifndef _LIBCPP_STDEXCEPT
-#error <stdexcept> has not been included
-#endif
-
-#ifndef _LIBCPP_IOSFWD
-#error <iosfwd> has not been included
-#endif
-
-int main()
-{
-}
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
index 76d5f0d..c18822b 100644
--- a/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
+++ b/test/libcxx/utilities/tuple/tuple.tuple/diagnose_reference_binding.fail.cpp
@@ -34,7 +34,7 @@
     // FIXME: The below warnings may get emitted as an error, a warning, or not emitted at all
     // depending on the flags used to compile this test.
   {
-    // expected-warning@tuple:* 0+ {{binding reference member '__value_' to a temporary value}}
-    // expected-error@tuple:* 0+ {{binding reference member '__value_' to a temporary value}}
+    // expected-warning@tuple:* 0+ {{binding reference member 'value' to a temporary value}}
+    // expected-error@tuple:* 0+ {{binding reference member 'value' to a temporary value}}
   }
 }
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
new file mode 100644
index 0000000..26556c6
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -0,0 +1,209 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// The following compilers don't generate constexpr special members correctly.
+// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant const&);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTCopyAssign {
+  constexpr NTCopyAssign(int v) : value(v) {}
+  NTCopyAssign(const NTCopyAssign &) = default;
+  NTCopyAssign(NTCopyAssign &&) = default;
+  NTCopyAssign &operator=(const NTCopyAssign &that) {
+    value = that.value;
+    return *this;
+  };
+  NTCopyAssign &operator=(NTCopyAssign &&) = delete;
+  int value;
+};
+
+static_assert(!std::is_trivially_copy_assignable<NTCopyAssign>::value, "");
+static_assert(std::is_copy_assignable<NTCopyAssign>::value, "");
+
+struct TCopyAssign {
+  constexpr TCopyAssign(int v) : value(v) {}
+  TCopyAssign(const TCopyAssign &) = default;
+  TCopyAssign(TCopyAssign &&) = default;
+  TCopyAssign &operator=(const TCopyAssign &) = default;
+  TCopyAssign &operator=(TCopyAssign &&) = delete;
+  int value;
+};
+
+static_assert(std::is_trivially_copy_assignable<TCopyAssign>::value, "");
+
+struct TCopyAssignNTMoveAssign {
+  constexpr TCopyAssignNTMoveAssign(int v) : value(v) {}
+  TCopyAssignNTMoveAssign(const TCopyAssignNTMoveAssign &) = default;
+  TCopyAssignNTMoveAssign(TCopyAssignNTMoveAssign &&) = default;
+  TCopyAssignNTMoveAssign &operator=(const TCopyAssignNTMoveAssign &) = default;
+  TCopyAssignNTMoveAssign &operator=(TCopyAssignNTMoveAssign &&that) {
+    value = that.value;
+    that.value = -1;
+    return *this;
+  }
+  int value;
+};
+
+static_assert(std::is_trivially_copy_assignable_v<TCopyAssignNTMoveAssign>, "");
+
+void test_copy_assignment_sfinae() {
+  {
+    using V = std::variant<int, long>;
+    static_assert(std::is_trivially_copy_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, NTCopyAssign>;
+    static_assert(!std::is_trivially_copy_assignable<V>::value, "");
+    static_assert(std::is_copy_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TCopyAssign>;
+    static_assert(std::is_trivially_copy_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TCopyAssignNTMoveAssign>;
+    static_assert(std::is_trivially_copy_assignable<V>::value, "");
+  }
+}
+
+template <typename T> struct Result { size_t index; T value; };
+
+void test_copy_assignment_same_index() {
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int>;
+        V v(43);
+        V v2(42);
+        v = v2;
+        return {v.index(), std::get<0>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 0, "");
+    static_assert(result.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        using V = std::variant<int, long, unsigned>;
+        V v(43l);
+        V v2(42l);
+        v = v2;
+        return {v.index(), std::get<1>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42l, "");
+  }
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int, TCopyAssign, unsigned>;
+        V v(std::in_place_type<TCopyAssign>, 43);
+        V v2(std::in_place_type<TCopyAssign>, 42);
+        v = v2;
+        return {v.index(), std::get<1>(v).value};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int, TCopyAssignNTMoveAssign, unsigned>;
+        V v(std::in_place_type<TCopyAssignNTMoveAssign>, 43);
+        V v2(std::in_place_type<TCopyAssignNTMoveAssign>, 42);
+        v = v2;
+        return {v.index(), std::get<1>(v).value};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+}
+
+void test_copy_assignment_different_index() {
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        using V = std::variant<int, long, unsigned>;
+        V v(43);
+        V v2(42l);
+        v = v2;
+        return {v.index(), std::get<1>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42l, "");
+  }
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int, TCopyAssign, unsigned>;
+        V v(std::in_place_type<unsigned>, 43);
+        V v2(std::in_place_type<TCopyAssign>, 42);
+        v = v2;
+        return {v.index(), std::get<1>(v).value};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+}
+
+template <size_t NewIdx, class ValueType>
+constexpr bool test_constexpr_assign_extension_imp(
+    std::variant<long, void*, int>&& v, ValueType&& new_value)
+{
+  const std::variant<long, void*, int> cp(
+      std::forward<ValueType>(new_value));
+  v = cp;
+  return v.index() == NewIdx &&
+        std::get<NewIdx>(v) == std::get<NewIdx>(cp);
+}
+
+void test_constexpr_copy_assignment_extension() {
+#ifdef _LIBCPP_VERSION
+  using V = std::variant<long, void*, int>;
+  static_assert(std::is_trivially_copyable<V>::value, "");
+  static_assert(std::is_trivially_copy_assignable<V>::value, "");
+  static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
+  static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
+  static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
+  static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
+#endif
+}
+
+int main() {
+  test_copy_assignment_same_index();
+  test_copy_assignment_different_index();
+  test_copy_assignment_sfinae();
+  test_constexpr_copy_assignment_extension();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp
new file mode 100644
index 0000000..fb6907d
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -0,0 +1,197 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// The following compilers don't generate constexpr special members correctly.
+// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant& operator=(variant&&) noexcept(see below);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTMoveAssign {
+  constexpr NTMoveAssign(int v) : value(v) {}
+  NTMoveAssign(const NTMoveAssign &) = default;
+  NTMoveAssign(NTMoveAssign &&) = default;
+  NTMoveAssign &operator=(const NTMoveAssign &that) = default;
+  NTMoveAssign &operator=(NTMoveAssign &&that) {
+    value = that.value;
+    that.value = -1;
+    return *this;
+  };
+  int value;
+};
+
+static_assert(!std::is_trivially_move_assignable<NTMoveAssign>::value, "");
+static_assert(std::is_move_assignable<NTMoveAssign>::value, "");
+
+struct TMoveAssign {
+  constexpr TMoveAssign(int v) : value(v) {}
+  TMoveAssign(const TMoveAssign &) = delete;
+  TMoveAssign(TMoveAssign &&) = default;
+  TMoveAssign &operator=(const TMoveAssign &) = delete;
+  TMoveAssign &operator=(TMoveAssign &&) = default;
+  int value;
+};
+
+static_assert(std::is_trivially_move_assignable<TMoveAssign>::value, "");
+
+struct TMoveAssignNTCopyAssign {
+  constexpr TMoveAssignNTCopyAssign(int v) : value(v) {}
+  TMoveAssignNTCopyAssign(const TMoveAssignNTCopyAssign &) = default;
+  TMoveAssignNTCopyAssign(TMoveAssignNTCopyAssign &&) = default;
+  TMoveAssignNTCopyAssign &operator=(const TMoveAssignNTCopyAssign &that) {
+    value = that.value;
+    return *this;
+  }
+  TMoveAssignNTCopyAssign &operator=(TMoveAssignNTCopyAssign &&) = default;
+  int value;
+};
+
+static_assert(std::is_trivially_move_assignable_v<TMoveAssignNTCopyAssign>, "");
+
+void test_move_assignment_sfinae() {
+  {
+    using V = std::variant<int, long>;
+    static_assert(std::is_trivially_move_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, NTMoveAssign>;
+    static_assert(!std::is_trivially_move_assignable<V>::value, "");
+    static_assert(std::is_move_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TMoveAssign>;
+    static_assert(std::is_trivially_move_assignable<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TMoveAssignNTCopyAssign>;
+    static_assert(std::is_trivially_move_assignable<V>::value, "");
+  }
+}
+
+template <typename T> struct Result { size_t index; T value; };
+
+void test_move_assignment_same_index() {
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int>;
+        V v(43);
+        V v2(42);
+        v = std::move(v2);
+        return {v.index(), std::get<0>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 0, "");
+    static_assert(result.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        using V = std::variant<int, long, unsigned>;
+        V v(43l);
+        V v2(42l);
+        v = std::move(v2);
+        return {v.index(), std::get<1>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42l, "");
+  }
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        using V = std::variant<int, TMoveAssign, unsigned>;
+        V v(std::in_place_type<TMoveAssign>, 43);
+        V v2(std::in_place_type<TMoveAssign>, 42);
+        v = std::move(v2);
+        return {v.index(), std::get<1>(v).value};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+}
+
+void test_move_assignment_different_index() {
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        using V = std::variant<int, long, unsigned>;
+        V v(43);
+        V v2(42l);
+        v = std::move(v2);
+        return {v.index(), std::get<1>(v)};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42l, "");
+  }
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        using V = std::variant<int, TMoveAssign, unsigned>;
+        V v(std::in_place_type<unsigned>, 43);
+        V v2(std::in_place_type<TMoveAssign>, 42);
+        v = std::move(v2);
+        return {v.index(), std::get<1>(v).value};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+}
+
+
+template <size_t NewIdx, class ValueType>
+constexpr bool test_constexpr_assign_extension_imp(
+    std::variant<long, void*, int>&& v, ValueType&& new_value)
+{
+  std::variant<long, void*, int> v2(
+      std::forward<ValueType>(new_value));
+  const auto cp = v2;
+  v = std::move(v2);
+  return v.index() == NewIdx &&
+        std::get<NewIdx>(v) == std::get<NewIdx>(cp);
+}
+
+void test_constexpr_move_assignment_extension() {
+#ifdef _LIBCPP_VERSION
+  using V = std::variant<long, void*, int>;
+  static_assert(std::is_trivially_copyable<V>::value, "");
+  static_assert(std::is_trivially_move_assignable<V>::value, "");
+  static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
+  static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
+  static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
+  static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
+#endif
+}
+
+int main() {
+  test_move_assignment_same_index();
+  test_move_assignment_different_index();
+  test_move_assignment_sfinae();
+  test_constexpr_move_assignment_extension();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
new file mode 100644
index 0000000..0d30a78
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.ctor/copy.pass.cpp
@@ -0,0 +1,120 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant const&);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTCopy {
+  constexpr NTCopy(int v) : value(v) {}
+  NTCopy(const NTCopy &that) : value(that.value) {}
+  NTCopy(NTCopy &&) = delete;
+  int value;
+};
+
+static_assert(!std::is_trivially_copy_constructible<NTCopy>::value, "");
+static_assert(std::is_copy_constructible<NTCopy>::value, "");
+
+struct TCopy {
+  constexpr TCopy(int v) : value(v) {}
+  TCopy(TCopy const &) = default;
+  TCopy(TCopy &&) = delete;
+  int value;
+};
+
+static_assert(std::is_trivially_copy_constructible<TCopy>::value, "");
+
+struct TCopyNTMove {
+  constexpr TCopyNTMove(int v) : value(v) {}
+  TCopyNTMove(const TCopyNTMove&) = default;
+  TCopyNTMove(TCopyNTMove&& that) : value(that.value) { that.value = -1; }
+  int value;
+};
+
+static_assert(std::is_trivially_copy_constructible<TCopyNTMove>::value, "");
+
+void test_copy_ctor_sfinae() {
+  {
+    using V = std::variant<int, long>;
+    static_assert(std::is_trivially_copy_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, NTCopy>;
+    static_assert(!std::is_trivially_copy_constructible<V>::value, "");
+    static_assert(std::is_copy_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TCopy>;
+    static_assert(std::is_trivially_copy_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TCopyNTMove>;
+    static_assert(std::is_trivially_copy_constructible<V>::value, "");
+  }
+}
+
+void test_copy_ctor_basic() {
+  {
+    constexpr std::variant<int> v(std::in_place_index<0>, 42);
+    static_assert(v.index() == 0, "");
+    constexpr std::variant<int> v2 = v;
+    static_assert(v2.index() == 0, "");
+    static_assert(std::get<0>(v2) == 42, "");
+  }
+  {
+    constexpr std::variant<int, long> v(std::in_place_index<1>, 42);
+    static_assert(v.index() == 1, "");
+    constexpr std::variant<int, long> v2 = v;
+    static_assert(v2.index() == 1, "");
+    static_assert(std::get<1>(v2) == 42, "");
+  }
+  {
+    constexpr std::variant<TCopy> v(std::in_place_index<0>, 42);
+    static_assert(v.index() == 0, "");
+    constexpr std::variant<TCopy> v2(v);
+    static_assert(v2.index() == 0, "");
+    static_assert(std::get<0>(v2).value == 42, "");
+  }
+  {
+    constexpr std::variant<int, TCopy> v(std::in_place_index<1>, 42);
+    static_assert(v.index() == 1, "");
+    constexpr std::variant<int, TCopy> v2(v);
+    static_assert(v2.index() == 1, "");
+    static_assert(std::get<1>(v2).value == 42, "");
+  }
+  {
+    constexpr std::variant<TCopyNTMove> v(std::in_place_index<0>, 42);
+    static_assert(v.index() == 0, "");
+    constexpr std::variant<TCopyNTMove> v2(v);
+    static_assert(v2.index() == 0, "");
+    static_assert(std::get<0>(v2).value == 42, "");
+  }
+  {
+    constexpr std::variant<int, TCopyNTMove> v(std::in_place_index<1>, 42);
+    static_assert(v.index() == 1, "");
+    constexpr std::variant<int, TCopyNTMove> v2(v);
+    static_assert(v2.index() == 1, "");
+    static_assert(std::get<1>(v2).value == 42, "");
+  }
+}
+
+int main() {
+  test_copy_ctor_basic();
+  test_copy_ctor_sfinae();
+}
diff --git a/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
new file mode 100644
index 0000000..91e8c19
--- /dev/null
+++ b/test/libcxx/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -0,0 +1,153 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+// <variant>
+
+// template <class ...Types> class variant;
+
+// variant(variant&&) noexcept(see below);
+
+#include <type_traits>
+#include <variant>
+
+#include "test_macros.h"
+
+struct NTMove {
+  constexpr NTMove(int v) : value(v) {}
+  NTMove(const NTMove &) = delete;
+  NTMove(NTMove &&that) : value(that.value) { that.value = -1; }
+  int value;
+};
+
+static_assert(!std::is_trivially_move_constructible<NTMove>::value, "");
+static_assert(std::is_move_constructible<NTMove>::value, "");
+
+struct TMove {
+  constexpr TMove(int v) : value(v) {}
+  TMove(const TMove &) = delete;
+  TMove(TMove &&) = default;
+  int value;
+};
+
+static_assert(std::is_trivially_move_constructible<TMove>::value, "");
+
+struct TMoveNTCopy {
+  constexpr TMoveNTCopy(int v) : value(v) {}
+  TMoveNTCopy(const TMoveNTCopy& that) : value(that.value) {}
+  TMoveNTCopy(TMoveNTCopy&&) = default;
+  int value;
+};
+
+static_assert(std::is_trivially_move_constructible<TMoveNTCopy>::value, "");
+
+void test_move_ctor_sfinae() {
+  {
+    using V = std::variant<int, long>;
+    static_assert(std::is_trivially_move_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, NTMove>;
+    static_assert(!std::is_trivially_move_constructible<V>::value, "");
+    static_assert(std::is_move_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TMove>;
+    static_assert(std::is_trivially_move_constructible<V>::value, "");
+  }
+  {
+    using V = std::variant<int, TMoveNTCopy>;
+    static_assert(std::is_trivially_move_constructible<V>::value, "");
+  }
+}
+
+template <typename T>
+struct Result { size_t index; T value; };
+
+void test_move_ctor_basic() {
+  {
+    struct {
+      constexpr Result<int> operator()() const {
+        std::variant<int> v(std::in_place_index<0>, 42);
+        std::variant<int> v2 = std::move(v);
+        return {v2.index(), std::get<0>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 0, "");
+    static_assert(result.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<long> operator()() const {
+        std::variant<int, long> v(std::in_place_index<1>, 42);
+        std::variant<int, long> v2 = std::move(v);
+        return {v2.index(), std::get<1>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<TMove> operator()() const {
+        std::variant<TMove> v(std::in_place_index<0>, 42);
+        std::variant<TMove> v2(std::move(v));
+        return {v2.index(), std::get<0>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 0, "");
+    static_assert(result.value.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<TMove> operator()() const {
+        std::variant<int, TMove> v(std::in_place_index<1>, 42);
+        std::variant<int, TMove> v2(std::move(v));
+        return {v2.index(), std::get<1>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<TMoveNTCopy> operator()() const {
+        std::variant<TMoveNTCopy> v(std::in_place_index<0>, 42);
+        std::variant<TMoveNTCopy> v2(std::move(v));
+        return {v2.index(), std::get<0>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 0, "");
+    static_assert(result.value.value == 42, "");
+  }
+  {
+    struct {
+      constexpr Result<TMoveNTCopy> operator()() const {
+        std::variant<int, TMoveNTCopy> v(std::in_place_index<1>, 42);
+        std::variant<int, TMoveNTCopy> v2(std::move(v));
+        return {v2.index(), std::get<1>(std::move(v2))};
+      }
+    } test;
+    constexpr auto result = test();
+    static_assert(result.index == 1, "");
+    static_assert(result.value.value == 42, "");
+  }
+}
+
+int main() {
+  test_move_ctor_basic();
+  test_move_ctor_sfinae();
+}
diff --git a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
index 0c1cc15..9a954d9 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.move/move.pass.cpp
@@ -16,9 +16,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 template <class InIter, class OutIter>
@@ -37,7 +38,8 @@
         assert(ia[i] == ib[i]);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class InIter, class OutIter>
 void
 test1()
@@ -53,7 +55,8 @@
     for (unsigned i = 0; i < N; ++i)
         assert(*ib[i] == static_cast<int>(i));
 }
-#endif
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -92,7 +95,7 @@
     test<const int*, random_access_iterator<int*> >();
     test<const int*, int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test1<input_iterator<std::unique_ptr<int>*>, output_iterator<std::unique_ptr<int>*> >();
     test1<input_iterator<std::unique_ptr<int>*>, input_iterator<std::unique_ptr<int>*> >();
     test1<input_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
@@ -127,5 +130,5 @@
     test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
index 9b3df5a..c5f9d3a 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.move/move_backward.pass.cpp
@@ -16,9 +16,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 template <class InIter, class OutIter>
@@ -37,7 +38,8 @@
         assert(ia[i] == ib[i]);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class InIter, class OutIter>
 void
 test1()
@@ -53,7 +55,8 @@
     for (unsigned i = 0; i < N; ++i)
         assert(*ib[i] == static_cast<int>(i));
 }
-#endif
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -69,7 +72,7 @@
     test<const int*, random_access_iterator<int*> >();
     test<const int*, int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test1<bidirectional_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<bidirectional_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
     test1<bidirectional_iterator<std::unique_ptr<int>*>, std::unique_ptr<int>*>();
@@ -81,5 +84,5 @@
     test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
index ce74684..8eddfbc 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
@@ -17,7 +17,9 @@
 
 #include <algorithm>
 #include <cassert>
-
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#include <memory>
+#endif
 
 #include "test_iterators.h"
 
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
index e2abf7c..e24598a 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <algorithm>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<RandomAccessIterator Iter>
 //   requires ShuffleIterator<Iter>
diff --git a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
index 313b6ba..c923d84 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle_rand.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <algorithm>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<RandomAccessIterator Iter, Callable<auto, Iter::difference_type> Rand>
 //   requires ShuffleIterator<Iter>
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
index a77a9ed..80f8656 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove.pass.cpp
@@ -17,9 +17,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 template <class Iter>
@@ -38,7 +39,8 @@
     assert(ia[5] == 4);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class Iter>
 void
 test1()
@@ -60,7 +62,8 @@
     assert(*ia[4] == 3);
     assert(*ia[5] == 4);
 }
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -69,10 +72,12 @@
     test<random_access_iterator<int*> >();
     test<int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1<forward_iterator<std::unique_ptr<int>*> >();
     test1<bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<random_access_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*>();
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
index 8532998..de3f0a7 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_copy_if.pass.cpp
@@ -21,8 +21,6 @@
 
 #include "test_iterators.h"
 
-bool equalToTwo(int v) { return v == 2; }
-
 template <class InIter, class OutIter>
 void
 test()
@@ -30,8 +28,8 @@
     int ia[] = {0, 1, 2, 3, 4, 2, 3, 4, 2};
     const unsigned sa = sizeof(ia)/sizeof(ia[0]);
     int ib[sa];
-    OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa),
-                                    OutIter(ib), equalToTwo);
+    OutIter r = std::remove_copy_if(InIter(ia), InIter(ia+sa), OutIter(ib),
+                                    std::bind2nd(std::equal_to<int>(), 2));
     assert(base(r) == ib + sa-3);
     assert(ib[0] == 0);
     assert(ib[1] == 1);
diff --git a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
index c40f3e7..b234431 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.remove/remove_if.pass.cpp
@@ -18,9 +18,10 @@
 #include <algorithm>
 #include <functional>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 #include "counting_predicates.hpp"
 
@@ -45,7 +46,8 @@
     assert(cp.count() == sa);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 struct pred
 {
     bool operator()(const std::unique_ptr<int>& i) {return *i == 2;}
@@ -75,7 +77,8 @@
     assert(*ia[4] == 3);
     assert(*ia[5] == 4);
 }
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -84,10 +87,12 @@
     test<random_access_iterator<int*> >();
     test<int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1<forward_iterator<std::unique_ptr<int>*> >();
     test1<bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<random_access_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*>();
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
index f2ffece..1eff3d3 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_copy_if.pass.cpp
@@ -23,8 +23,6 @@
 
 #include "test_iterators.h"
 
-bool equalToTwo(int v) { return v == 2; }
-
 template <class InIter, class OutIter>
 void
 test()
@@ -32,8 +30,8 @@
     int ia[] = {0, 1, 2, 3, 4};
     const unsigned sa = sizeof(ia)/sizeof(ia[0]);
     int ib[sa] = {0};
-    OutIter r = std::replace_copy_if(InIter(ia), InIter(ia+sa),
-                                     OutIter(ib), equalToTwo, 5);
+    OutIter r = std::replace_copy_if(InIter(ia), InIter(ia+sa), OutIter(ib),
+                                     std::bind2nd(std::equal_to<int>(), 2), 5);
     assert(base(r) == ib + sa);
     assert(ib[0] == 0);
     assert(ib[1] == 1);
diff --git a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
index ebb2945..8d6ab04 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.replace/replace_if.pass.cpp
@@ -22,15 +22,13 @@
 
 #include "test_iterators.h"
 
-bool equalToTwo(int v) { return v == 2; }
-
 template <class Iter>
 void
 test()
 {
     int ia[] = {0, 1, 2, 3, 4};
     const unsigned sa = sizeof(ia)/sizeof(ia[0]);
-    std::replace_if(Iter(ia), Iter(ia+sa), equalToTwo, 5);
+    std::replace_if(Iter(ia), Iter(ia+sa), std::bind2nd(std::equal_to<int>(), 2), 5);
     assert(ia[0] == 0);
     assert(ia[1] == 1);
     assert(ia[2] == 5);
diff --git a/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
index 84f2c8c..64a5a6a 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.swap/swap_ranges.pass.cpp
@@ -16,9 +16,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 template<class Iter1, class Iter2>
@@ -37,7 +38,8 @@
     assert(j[2] == 3);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template<class Iter1, class Iter2>
 void
 test1()
@@ -57,7 +59,8 @@
     assert(*j[1] == 2);
     assert(*j[2] == 3);
 }
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 void test2()
 {
@@ -128,7 +131,8 @@
     test<int*, random_access_iterator<int*> >();
     test<int*, int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1<forward_iterator<std::unique_ptr<int>*>, forward_iterator<std::unique_ptr<int>*> >();
     test1<forward_iterator<std::unique_ptr<int>*>, bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<forward_iterator<std::unique_ptr<int>*>, random_access_iterator<std::unique_ptr<int>*> >();
@@ -148,7 +152,8 @@
     test1<std::unique_ptr<int>*, bidirectional_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, random_access_iterator<std::unique_ptr<int>*> >();
     test1<std::unique_ptr<int>*, std::unique_ptr<int>*>();
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     test2();
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
index 6c5e621..68556fd 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.transform/unary_transform.pass.cpp
@@ -21,8 +21,6 @@
 
 #include "test_iterators.h"
 
-int plusOne(int v) { return v + 1; }
-
 template <class InIter, class OutIter>
 void
 test()
@@ -30,8 +28,8 @@
     int ia[] = {0, 1, 2, 3, 4};
     const unsigned sa = sizeof(ia)/sizeof(ia[0]);
     int ib[sa] = {0};
-    OutIter r = std::transform(InIter(ia), InIter(ia+sa),
-                               OutIter(ib), plusOne);
+    OutIter r = std::transform(InIter(ia), InIter(ia+sa), OutIter(ib),
+                               std::bind2nd(std::plus<int>(), 1));
     assert(base(r) == ib + sa);
     assert(ib[0] == 1);
     assert(ib[1] == 2);
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
index 049ccfe..ab4ffad 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique.pass.cpp
@@ -17,9 +17,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 template <class Iter>
@@ -83,7 +84,7 @@
     assert(ii[2] == 2);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 struct do_nothing
 {
@@ -167,7 +168,8 @@
     assert(*ii[1] == 1);
     assert(*ii[2] == 2);
 }
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -176,10 +178,12 @@
     test<random_access_iterator<int*> >();
     test<int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1<forward_iterator<Ptr*> >();
     test1<bidirectional_iterator<Ptr*> >();
     test1<random_access_iterator<Ptr*> >();
     test1<Ptr*>();
-#endif
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
index 1640052..c6df235 100644
--- a/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
+++ b/test/std/algorithms/alg.modifying.operations/alg.unique/unique_pred.pass.cpp
@@ -17,9 +17,10 @@
 
 #include <algorithm>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
+#endif
 
-#include "test_macros.h"
 #include "test_iterators.h"
 
 struct count_equal
@@ -109,7 +110,7 @@
     assert(count_equal::count == si-1);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 struct do_nothing
 {
@@ -209,7 +210,8 @@
     assert(*ii[2] == 2);
     assert(count_equal::count == si-1);
 }
-#endif // TEST_STD_VER >= 11
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
@@ -218,10 +220,12 @@
     test<random_access_iterator<int*> >();
     test<int*>();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1<forward_iterator<Ptr*> >();
     test1<bidirectional_iterator<Ptr*> >();
     test1<random_access_iterator<Ptr*> >();
     test1<Ptr*>();
-#endif
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
index ec0526c..025bc06 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.count/count_if.pass.cpp
@@ -20,24 +20,17 @@
 
 #include "test_iterators.h"
 
-struct eq {
-	eq (int val) : v(val) {}
-	bool operator () (int v2) const { return v == v2; }
-	int v;
-	};
-
-
 int main()
 {
     int ia[] = {0, 1, 2, 2, 0, 1, 2, 3};
     const unsigned sa = sizeof(ia)/sizeof(ia[0]);
     assert(std::count_if(input_iterator<const int*>(ia),
                          input_iterator<const int*>(ia + sa),
-                         eq(2)) == 3);
+                         std::bind2nd(std::equal_to<int>(),2)) == 3);
     assert(std::count_if(input_iterator<const int*>(ia),
                          input_iterator<const int*>(ia + sa),
-                         eq(7)) == 0);
+                         std::bind2nd(std::equal_to<int>(),7)) == 0);
     assert(std::count_if(input_iterator<const int*>(ia),
                          input_iterator<const int*>(ia),
-                         eq(2)) == 0);
+                         std::bind2nd(std::equal_to<int>(),2)) == 0);
 }
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
index 761d71b..bde6ff3 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if.pass.cpp
@@ -20,22 +20,16 @@
 
 #include "test_iterators.h"
 
-struct eq {
-	eq (int val) : v(val) {}
-	bool operator () (int v2) const { return v == v2; }
-	int v;
-	};
-
 int main()
 {
     int ia[] = {0, 1, 2, 3, 4, 5};
     const unsigned s = sizeof(ia)/sizeof(ia[0]);
     input_iterator<const int*> r = std::find_if(input_iterator<const int*>(ia),
                                                 input_iterator<const int*>(ia+s),
-                                                eq(3));
+                                                std::bind2nd(std::equal_to<int>(), 3));
     assert(*r == 3);
     r = std::find_if(input_iterator<const int*>(ia),
                      input_iterator<const int*>(ia+s),
-                     eq(10));
+                     std::bind2nd(std::equal_to<int>(), 10));
     assert(r == input_iterator<const int*>(ia+s));
 }
diff --git a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
index 2e52e26..661e643 100644
--- a/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
+++ b/test/std/algorithms/alg.nonmodifying/alg.find/find_if_not.pass.cpp
@@ -20,23 +20,16 @@
 
 #include "test_iterators.h"
 
-struct ne {
-	ne (int val) : v(val) {}
-	bool operator () (int v2) const { return v != v2; }
-	int v;
-	};
-
-
 int main()
 {
     int ia[] = {0, 1, 2, 3, 4, 5};
     const unsigned s = sizeof(ia)/sizeof(ia[0]);
     input_iterator<const int*> r = std::find_if_not(input_iterator<const int*>(ia),
                                                     input_iterator<const int*>(ia+s),
-                                                    ne(3));
+                                                    std::bind2nd(std::not_equal_to<int>(), 3));
     assert(*r == 3);
     r = std::find_if_not(input_iterator<const int*>(ia),
                          input_iterator<const int*>(ia+s),
-                         ne(10));
+                         std::bind2nd(std::not_equal_to<int>(), 10));
     assert(r == input_iterator<const int*>(ia+s));
 }
diff --git a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp b/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
deleted file mode 100644
index fd24edb..0000000
--- a/test/std/algorithms/alg.nonmodifying/alg.foreach/for_each_n.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <algorithm>
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template<class InputIterator, class Size, class Function>
-//    InputIterator for_each_n(InputIterator first, Size n, Function f);
-
-
-#include <algorithm>
-#include <cassert>
-
-#include "test_iterators.h"
-
-struct for_each_test
-{
-    for_each_test(int c) : count(c) {}
-    int count;
-    void operator()(int& i) {++i; ++count;}
-};
-
-int main()
-{
-    typedef input_iterator<int*> Iter;
-    int ia[] = {0, 1, 2, 3, 4, 5};
-    const unsigned s = sizeof(ia)/sizeof(ia[0]);
-
-    {
-    auto f = for_each_test(0);
-    Iter it = std::for_each_n(Iter(ia), 0, std::ref(f));
-    assert(it == Iter(ia));
-    assert(f.count == 0);    
-    }
-
-    {
-    auto f = for_each_test(0);
-    Iter it = std::for_each_n(Iter(ia), s, std::ref(f));
-    
-    assert(it == Iter(ia+s));
-    assert(f.count == s);    
-    for (unsigned i = 0; i < s; ++i)
-        assert(ia[i] == static_cast<int>(i+1));
-    }
-
-    {
-    auto f = for_each_test(0);
-    Iter it = std::for_each_n(Iter(ia), 1, std::ref(f));
-    
-    assert(it == Iter(ia+1));
-    assert(f.count == 1);    
-    for (unsigned i = 0; i < 1; ++i)
-        assert(ia[i] == static_cast<int>(i+2));
-    }
-}
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
index 33b8ff9..8e7931f 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/pop.heap/pop_heap_comp.pass.cpp
@@ -18,9 +18,9 @@
 #include <functional>
 #include <random>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
 
 struct indirect_less
 {
@@ -29,6 +29,7 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 std::mt19937 randomness;
 
@@ -52,7 +53,7 @@
 {
     test(1000);
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     const int N = 1000;
     std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -67,5 +68,5 @@
     }
     delete [] ia;
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
index 1b1987a..38d09ce 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/push.heap/push_heap_comp.pass.cpp
@@ -19,10 +19,9 @@
 #include <functional>
 #include <random>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -30,6 +29,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 std::mt19937 randomness;
 
 void test(int N)
@@ -50,7 +51,7 @@
 {
     test(1000);
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     const int N = 1000;
     std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -64,5 +65,5 @@
     }
     delete [] ia;
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
index 02839ab..c0a05e4 100644
--- a/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.heap.operations/sort.heap/sort_heap_comp.pass.cpp
@@ -18,10 +18,9 @@
 #include <functional>
 #include <random>
 #include <cassert>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -29,6 +28,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 std::mt19937 randomness;
 
 void test(int N)
@@ -52,7 +53,7 @@
     test(10);
     test(1000);
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     const int N = 1000;
     std::unique_ptr<int>* ia = new std::unique_ptr<int> [N];
@@ -64,5 +65,5 @@
     assert(std::is_sorted(ia, ia+N, indirect_less()));
     delete [] ia;
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
index fa30797..88249ed 100644
--- a/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.nth.element/nth_element_comp.pass.cpp
@@ -21,10 +21,9 @@
 #include <random>
 #include <cassert>
 #include <cstddef>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -32,6 +31,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 std::mt19937 randomness;
 
 void
@@ -77,7 +78,7 @@
     test(1000);
     test(1009);
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::vector<std::unique_ptr<int> > v(1000);
     for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -85,5 +86,5 @@
     std::nth_element(v.begin(), v.begin() + v.size()/2, v.end(), indirect_less());
     assert(static_cast<std::size_t>(*v[v.size()/2]) == v.size()/2);
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
index fb79767..847a582 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/partial.sort/partial_sort_comp.pass.cpp
@@ -21,10 +21,9 @@
 #include <random>
 #include <cassert>
 #include <cstddef>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -32,6 +31,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 std::mt19937 randomness;
 
 void
@@ -83,7 +84,7 @@
     test_larger_sorts(1009);
     }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::vector<std::unique_ptr<int> > v(1000);
     for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -92,5 +93,5 @@
     for (int i = 0; static_cast<std::size_t>(i) < v.size()/2; ++i)
         assert(*v[i] == i);
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
index 87d66c4..c770159 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/sort/sort_comp.pass.cpp
@@ -20,10 +20,9 @@
 #include <vector>
 #include <cassert>
 #include <cstddef>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -31,6 +30,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 int main()
 {
     {
@@ -42,7 +43,7 @@
     assert(std::is_sorted(v.begin(), v.end()));
     }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::vector<std::unique_ptr<int> > v(1000);
     for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -53,5 +54,5 @@
     assert(*v[1] == 1);
     assert(*v[2] == 2);
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
index 8306cc3..347711b 100644
--- a/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
+++ b/test/std/algorithms/alg.sorting/alg.sort/stable.sort/stable_sort_comp.pass.cpp
@@ -21,10 +21,9 @@
 #include <random>
 #include <cassert>
 #include <cstddef>
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #include <memory>
 
-#include "test_macros.h"
-
 struct indirect_less
 {
     template <class P>
@@ -32,6 +31,8 @@
         {return *x < *y;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 std::mt19937 randomness;
 
 struct first_only
@@ -71,7 +72,7 @@
 {
     test();
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::vector<std::unique_ptr<int> > v(1000);
     for (int i = 0; static_cast<std::size_t>(i) < v.size(); ++i)
@@ -82,5 +83,5 @@
     assert(*v[1] == 1);
     assert(*v[2] == 2);
     }
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/Emplaceable.h b/test/std/containers/Emplaceable.h
index f9319d4..34dd326 100644
--- a/test/std/containers/Emplaceable.h
+++ b/test/std/containers/Emplaceable.h
@@ -10,10 +10,7 @@
 #ifndef EMPLACEABLE_H
 #define EMPLACEABLE_H
 
-#include <utility>
-#include "test_macros.h"
-
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 class Emplaceable
 {
@@ -52,5 +49,6 @@
 
 }
 
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 #endif  // EMPLACEABLE_H
diff --git a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
index 8d27eab..f8fc21f 100644
--- a/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
+++ b/test/std/containers/associative/map/map.access/index_tuple.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -19,13 +17,17 @@
 
 #include <map>
 
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 #include <tuple>
 
+#endif
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     using namespace std;
     map<tuple<int,int>, size_t> m;
     m[make_tuple(2,3)]=7;
+#endif
 }
diff --git a/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp
index 354911b..6796006 100644
--- a/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::pair<const int, double> V;
     std::map<int, double> m =
@@ -46,6 +45,7 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::pair<const int, double> V;
     std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -70,4 +70,6 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp
index 0504b1a..c55d18f 100644
--- a/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::pair<const int, double> V;
     std::map<int, double> m =
@@ -42,6 +41,7 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::pair<const int, double> V;
     std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -62,4 +62,6 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp
index d9c1fb8..3133eb2 100644
--- a/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/initializer_list_compare.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::pair<const int, double> V;
     typedef test_compare<std::less<int> > C;
@@ -43,6 +42,7 @@
     assert(*next(m.begin(), 2) == V(3, 1));
     assert(m.key_comp() == C(3));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::pair<const int, double> V;
     typedef test_compare<std::less<int> > C;
@@ -64,4 +64,6 @@
     assert(*next(m.begin(), 2) == V(3, 1));
     assert(m.key_comp() == C(3));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp
index 70783e6..d7552b3 100644
--- a/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/initializer_list_compare_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::pair<const int, double> V;
     typedef test_compare<std::less<int> > C;
@@ -46,6 +45,7 @@
     assert(m.key_comp() == C(3));
     assert(m.get_allocator() == A(6));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::pair<const int, double> V;
     typedef test_compare<std::less<int> > C;
@@ -69,6 +69,7 @@
     assert(m.key_comp() == C(3));
     assert(m.get_allocator() == A());
     }
+#if TEST_STD_VER > 11
     {
     typedef std::pair<const int, double> V;
     typedef min_allocator<V> A;
@@ -93,6 +94,7 @@
     assert(*next(m.begin(), 2) == V(3, 1));
     assert(m.get_allocator() == a);
     }
+#endif
     {
     typedef std::pair<const int, double> V;
     typedef explicit_allocator<V> A;
@@ -117,4 +119,6 @@
     assert(m.key_comp() == C(3));
     assert(m.get_allocator() == a);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
index 923a212..705fb58 100644
--- a/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/iter_iter_comp_alloc.pass.cpp
@@ -92,6 +92,7 @@
         V(3, 2),
     };
     {
+    typedef std::pair<const int, double> V;
     typedef min_allocator<V> A;
     typedef test_compare<std::less<int> > C;
     A a;
@@ -105,6 +106,7 @@
     assert(m.get_allocator() == a);
     }
     {
+    typedef std::pair<const int, double> V;
     typedef explicit_allocator<V> A;
     typedef test_compare<std::less<int> > C;
     A a;
diff --git a/test/std/containers/associative/map/map.cons/move.pass.cpp b/test/std/containers/associative/map/map.cons/move.pass.cpp
index dd68f9c..2d19b88 100644
--- a/test/std/containers/associative/map/map.cons/move.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     typedef std::pair<const int, double> V;
     {
         typedef test_compare<std::less<int> > C;
@@ -70,6 +69,7 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef test_compare<std::less<int> > C;
         typedef min_allocator<V> A;
@@ -115,4 +115,6 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
index 5f7ab8e..8349f13 100644
--- a/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -190,6 +189,7 @@
         }
         assert(Counter_base::gConstructed == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -268,4 +268,6 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/map/map.cons/move_assign.pass.cpp b/test/std/containers/associative/map/map.cons/move_assign.pass.cpp
index 8c0ef6e..09b41d3 100644
--- a/test/std/containers/associative/map/map.cons/move_assign.pass.cpp
+++ b/test/std/containers/associative/map/map.cons/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -145,6 +144,7 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -185,4 +185,6 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp b/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp
index 3b595fc..63d014f 100644
--- a/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp
+++ b/test/std/containers/associative/map/map.modifiers/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::map<int, DefaultOnly> M;
         typedef std::pair<M::iterator, bool> R;
@@ -93,6 +92,7 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
         typedef std::pair<M::iterator, bool> R;
@@ -160,4 +160,6 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp b/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp
index 7236276..319a239 100644
--- a/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/associative/map/map.modifiers/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::map<int, DefaultOnly> M;
         typedef M::iterator R;
@@ -90,6 +89,7 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::map<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
         typedef M::iterator R;
@@ -155,4 +155,6 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp b/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp
index de8191a..9cf3f3d 100644
--- a/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/map/map.modifiers/insert_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class map
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::pair<const int, double> V;
     std::map<int, double> m =
@@ -44,6 +43,7 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::pair<const int, double> V;
     std::map<int, double, std::less<int>, min_allocator<V>> m =
@@ -66,4 +66,6 @@
     assert(*next(m.begin()) == V(2, 1));
     assert(*next(m.begin(), 2) == V(3, 1));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp
index ae4ab34..4c0326d 100644
--- a/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multimap<int, double> C;
     typedef C::value_type V;
@@ -51,6 +50,7 @@
     assert(*++i == V(3, 1.5));
     assert(*++i == V(3, 2));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
     typedef C::value_type V;
@@ -80,4 +80,6 @@
     assert(*++i == V(3, 1.5));
     assert(*++i == V(3, 2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp
index 54b948c..6f645b6 100644
--- a/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multimap<int, double> C;
     typedef C::value_type V;
@@ -50,6 +49,7 @@
     assert(*++i == V(3, 1.5));
     assert(*++i == V(3, 2));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
     typedef C::value_type V;
@@ -78,4 +78,6 @@
     assert(*++i == V(3, 1.5));
     assert(*++i == V(3, 2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp
index a78e188..6d20d14 100644
--- a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef std::multimap<int, double, Cmp> C;
@@ -54,6 +53,7 @@
     assert(*++i == V(3, 2));
     assert(m.key_comp() == Cmp(4));
     }
+#if TEST_STD_VER >= 11
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef std::multimap<int, double, Cmp, min_allocator<std::pair<const int, double>>> C;
@@ -86,4 +86,6 @@
     assert(*++i == V(3, 2));
     assert(m.key_comp() == Cmp(4));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp
index ba6f76e..8d12a05 100644
--- a/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/initializer_list_compare_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef test_allocator<std::pair<const int, double> > A;
@@ -57,6 +56,8 @@
     assert(m.key_comp() == Cmp(4));
     assert(m.get_allocator() == A(5));
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#if TEST_STD_VER >= 11
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef min_allocator<std::pair<const int, double> > A;
@@ -91,6 +92,7 @@
     assert(m.key_comp() == Cmp(4));
     assert(m.get_allocator() == A());
     }
+#if TEST_STD_VER > 11
     {
     typedef test_compare<std::less<int> > C;
     typedef std::pair<const int, double> V;
@@ -122,6 +124,7 @@
     assert(*++i == V(3, 2));
     assert(m.get_allocator() == a);
     }
+#endif
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef explicit_allocator<std::pair<const int, double> > A;
@@ -156,4 +159,5 @@
     assert(m.key_comp() == Cmp(4));
     assert(m.get_allocator() == A{});
     }
+#endif
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
index 769c709..7edec77 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     typedef std::pair<const int, double> V;
     {
         typedef test_compare<std::less<int> > C;
@@ -76,6 +75,7 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef test_compare<std::less<int> > C;
         typedef min_allocator<V> A;
@@ -127,4 +127,6 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
index 5882283..6ce7127 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -190,6 +189,7 @@
         }
         assert(Counter_base::gConstructed == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -268,4 +268,6 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp b/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp
index 2474254..924e9dd 100644
--- a/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.cons/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -145,6 +144,7 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<MoveOnly, MoveOnly> V;
         typedef std::pair<const MoveOnly, MoveOnly> VC;
@@ -185,4 +185,6 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp
index 024cc67..7f5b698 100644
--- a/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.modifiers/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multimap<int, DefaultOnly> M;
         typedef M::iterator R;
@@ -85,6 +84,7 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
         typedef M::iterator R;
@@ -145,4 +145,6 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp
index d5fde83..a6ed318 100644
--- a/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.modifiers/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multimap<int, DefaultOnly> M;
         typedef M::iterator R;
@@ -90,6 +89,7 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::multimap<int, DefaultOnly, std::less<int>, min_allocator<std::pair<const int, DefaultOnly>>> M;
         typedef M::iterator R;
@@ -155,4 +155,6 @@
         assert(m.begin()->first == 2);
         assert(m.begin()->second == 3.5);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp b/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp
index 20e0ba1..89befb3 100644
--- a/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.modifiers/insert_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <map>
 
 // class multimap
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multimap<int, double> C;
     typedef C::value_type V;
@@ -54,6 +53,7 @@
     assert(*++i == V(3, 2));
     assert(*++i == V(3, 1.5));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::multimap<int, double, std::less<int>, min_allocator<std::pair<const int, double>>> C;
     typedef C::value_type V;
@@ -86,4 +86,6 @@
     assert(*++i == V(3, 2));
     assert(*++i == V(3, 1.5));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
index 9e67f97..df46d37 100644
--- a/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/equal_range.pass.cpp
@@ -183,6 +183,7 @@
 #endif
 #if TEST_STD_VER > 11
     {
+    typedef std::pair<const int, double> V;
     typedef std::multimap<int, double, std::less<>> M;
 
     typedef std::pair<M::iterator, M::iterator> R;
diff --git a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
index 474b7b6..f5295e5 100644
--- a/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/find.pass.cpp
@@ -147,6 +147,7 @@
 #endif
 #if TEST_STD_VER > 11
     {
+    typedef std::pair<const int, double> V;
     typedef std::multimap<int, double, std::less<>> M;
     typedef M::iterator R;
 
diff --git a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
index 28ff332..8a650fa 100644
--- a/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/lower_bound.pass.cpp
@@ -155,6 +155,7 @@
 #endif
 #if TEST_STD_VER > 11
     {
+    typedef std::pair<const int, double> V;
     typedef std::multimap<int, double, std::less<>> M;
     typedef M::iterator R;
     V ar[] =
diff --git a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
index 4f4b388..05760dc 100644
--- a/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
+++ b/test/std/containers/associative/multimap/multimap.ops/upper_bound.pass.cpp
@@ -155,6 +155,7 @@
 #endif
 #if TEST_STD_VER > 11
     {
+    typedef std::pair<const int, double> V;
     typedef std::multimap<int, double, std::less<>> M;
     typedef M::iterator R;
     V ar[] =
diff --git a/test/std/containers/associative/multiset/emplace.pass.cpp b/test/std/containers/associative/multiset/emplace.pass.cpp
index 7e2628d..93842a2 100644
--- a/test/std/containers/associative/multiset/emplace.pass.cpp
+++ b/test/std/containers/associative/multiset/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multiset<DefaultOnly> M;
         typedef M::iterator R;
@@ -69,6 +68,7 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::multiset<int, std::less<int>, min_allocator<int>> M;
         typedef M::iterator R;
@@ -78,4 +78,6 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multiset/emplace_hint.pass.cpp b/test/std/containers/associative/multiset/emplace_hint.pass.cpp
index 2b9b92d..48519fd 100644
--- a/test/std/containers/associative/multiset/emplace_hint.pass.cpp
+++ b/test/std/containers/associative/multiset/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multiset<DefaultOnly> M;
         typedef M::iterator R;
@@ -69,6 +68,7 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::multiset<int, std::less<int>, min_allocator<int>> M;
         typedef M::iterator R;
@@ -78,4 +78,6 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
index 23a65a3..590c668 100644
--- a/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/multiset/insert_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multiset<int> C;
     typedef C::value_type V;
@@ -40,6 +39,8 @@
     assert(*++i == V(8));
     assert(*++i == V(10));
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#if TEST_STD_VER >= 11
     {
     typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -57,4 +58,5 @@
     assert(*++i == V(8));
     assert(*++i == V(10));
     }
+#endif
 }
diff --git a/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp b/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp
index f39fca5..0afc8dc 100644
--- a/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp
+++ b/test/std/containers/associative/multiset/insert_iter_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multiset<MoveOnly> M;
         typedef M::iterator R;
@@ -47,6 +46,8 @@
         assert(m.size() == 4);
         assert(*r == 3);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::multiset<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M;
         typedef M::iterator R;
@@ -71,4 +72,5 @@
         assert(m.size() == 4);
         assert(*r == 3);
     }
+#endif
 }
diff --git a/test/std/containers/associative/multiset/insert_rv.pass.cpp b/test/std/containers/associative/multiset/insert_rv.pass.cpp
index 68d3487..3ee464b 100644
--- a/test/std/containers/associative/multiset/insert_rv.pass.cpp
+++ b/test/std/containers/associative/multiset/insert_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::multiset<MoveOnly> M;
         typedef M::iterator R;
@@ -47,6 +46,8 @@
         assert(m.size() == 4);
         assert(*r == 3);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::multiset<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M;
         typedef M::iterator R;
@@ -71,4 +72,5 @@
         assert(m.size() == 4);
         assert(*r == 3);
     }
+#endif
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp
index 915a15f..2c5318a 100644
--- a/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multiset<int> C;
     typedef C::value_type V;
@@ -37,6 +36,8 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#if TEST_STD_VER >= 11
     {
     typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -52,4 +53,5 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#endif
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
index f3ee002..b3d6066 100644
--- a/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::multiset<int> C;
     typedef C::value_type V;
@@ -37,6 +36,8 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+#if TEST_STD_VER >= 11
     {
     typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -51,6 +52,7 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#if TEST_STD_VER > 11
     {
     typedef std::multiset<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -67,4 +69,6 @@
     assert(*++i == V(6));
     assert(m.get_allocator() == a);
     }
+#endif
+#endif
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp
index 3312ca1..c67657a 100644
--- a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     typedef test_compare<std::less<int> > Cmp;
     typedef std::multiset<int, Cmp> C;
     typedef C::value_type V;
@@ -35,4 +34,5 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     assert(m.key_comp() == Cmp(10));
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp
index e495fce..8311489 100644
--- a/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/initializer_list_compare_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     typedef test_compare<std::less<int> > Cmp;
     typedef test_allocator<int> A;
     typedef std::multiset<int, Cmp, A> C;
@@ -38,4 +37,5 @@
     assert(*++i == V(6));
     assert(m.key_comp() == Cmp(10));
     assert(m.get_allocator() == A(4));
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
index 2adfb5c..5a905cf 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef int V;
         typedef test_compare<std::less<int> > C;
@@ -77,6 +76,8 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef int V;
         V ar[] =
@@ -114,4 +115,5 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#endif
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
index 29797c3..3da3fc0 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -184,4 +183,5 @@
         }
         assert(Counter_base::gConstructed == 0);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp b/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp
index e767ff1..b0ec4f3 100644
--- a/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp
+++ b/test/std/containers/associative/multiset/multiset.cons/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class multiset
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -142,6 +141,8 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -181,4 +182,5 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
 }
diff --git a/test/std/containers/associative/set/emplace.pass.cpp b/test/std/containers/associative/set/emplace.pass.cpp
index 5d50a24..47ef455 100644
--- a/test/std/containers/associative/set/emplace.pass.cpp
+++ b/test/std/containers/associative/set/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::set<DefaultOnly> M;
         typedef std::pair<M::iterator, bool> R;
@@ -75,6 +74,7 @@
         assert(m.size() == 1);
         assert(*r.first == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::set<int, std::less<int>, min_allocator<int>> M;
         typedef std::pair<M::iterator, bool> R;
@@ -85,4 +85,6 @@
         assert(m.size() == 1);
         assert(*r.first == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/emplace_hint.pass.cpp b/test/std/containers/associative/set/emplace_hint.pass.cpp
index 8962c0c..036f4d6 100644
--- a/test/std/containers/associative/set/emplace_hint.pass.cpp
+++ b/test/std/containers/associative/set/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::set<DefaultOnly> M;
         typedef M::iterator R;
@@ -69,6 +68,7 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::set<int, std::less<int>, min_allocator<int>> M;
         typedef M::iterator R;
@@ -78,4 +78,6 @@
         assert(m.size() == 1);
         assert(*r == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/insert_initializer_list.pass.cpp b/test/std/containers/associative/set/insert_initializer_list.pass.cpp
index 3114d48..490d759 100644
--- a/test/std/containers/associative/set/insert_initializer_list.pass.cpp
+++ b/test/std/containers/associative/set/insert_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::set<int> C;
     typedef C::value_type V;
@@ -40,6 +39,7 @@
     assert(*++i == V(8));
     assert(*++i == V(10));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::set<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -57,4 +57,6 @@
     assert(*++i == V(8));
     assert(*++i == V(10));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/set/insert_iter_rv.pass.cpp b/test/std/containers/associative/set/insert_iter_rv.pass.cpp
index 9579988..be827d6 100644
--- a/test/std/containers/associative/set/insert_iter_rv.pass.cpp
+++ b/test/std/containers/associative/set/insert_iter_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::set<MoveOnly> M;
         typedef M::iterator R;
@@ -47,6 +46,7 @@
         assert(m.size() == 3);
         assert(*r == 3);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::set<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M;
         typedef M::iterator R;
@@ -71,4 +71,6 @@
         assert(m.size() == 3);
         assert(*r == 3);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/insert_rv.pass.cpp b/test/std/containers/associative/set/insert_rv.pass.cpp
index 25cbfcb..e528ef3 100644
--- a/test/std/containers/associative/set/insert_rv.pass.cpp
+++ b/test/std/containers/associative/set/insert_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::set<MoveOnly> M;
         typedef std::pair<M::iterator, bool> R;
@@ -51,6 +50,7 @@
         assert(m.size() == 3);
         assert(*r.first == 3);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::set<MoveOnly, std::less<MoveOnly>, min_allocator<MoveOnly>> M;
         typedef std::pair<M::iterator, bool> R;
@@ -79,4 +79,6 @@
         assert(m.size() == 3);
         assert(*r.first == 3);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp b/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp
index 9906a1c..70e174a 100644
--- a/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::set<int> C;
     typedef C::value_type V;
@@ -37,6 +36,7 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::set<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -52,4 +52,6 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp
index 31521b2..5bb5460 100644
--- a/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef std::set<int> C;
     typedef C::value_type V;
@@ -36,6 +35,7 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#if TEST_STD_VER >= 11
     {
     typedef std::set<int, std::less<int>, min_allocator<int>> C;
     typedef C::value_type V;
@@ -50,4 +50,6 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp
index ea72b6d..a0afa02 100644
--- a/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/initializer_list_compare.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     typedef test_compare<std::less<int> > Cmp;
     typedef std::set<int, Cmp> C;
     typedef C::value_type V;
@@ -35,4 +34,5 @@
     assert(*++i == V(5));
     assert(*++i == V(6));
     assert(m.key_comp() == Cmp(10));
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
index f6cb734..80d41b0 100644
--- a/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/initializer_list_compare_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef test_allocator<int> A;
@@ -42,6 +41,7 @@
     assert(m.key_comp() == Cmp(10));
     assert(m.get_allocator() == A(4));
     }
+#if TEST_STD_VER > 11
     {
     typedef test_compare<std::less<int> > Cmp;
     typedef test_allocator<int> A;
@@ -59,4 +59,6 @@
     assert(*++i == V(6));
     assert(m.get_allocator() == A(4));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/associative/set/set.cons/move.pass.cpp b/test/std/containers/associative/set/set.cons/move.pass.cpp
index dd313e4..c836d45 100644
--- a/test/std/containers/associative/set/set.cons/move.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef int V;
         typedef test_compare<std::less<int> > C;
@@ -71,6 +70,7 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef int V;
         V ar[] =
@@ -102,4 +102,6 @@
         assert(mo.size() == 0);
         assert(distance(mo.begin(), mo.end()) == 0);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp b/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
index 9e1cd81..ba2adf5 100644
--- a/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -185,4 +184,5 @@
         assert(Counter_base::gConstructed == 0);
     }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/associative/set/set.cons/move_assign.pass.cpp b/test/std/containers/associative/set/set.cons/move_assign.pass.cpp
index 7862f7b..07cb415 100644
--- a/test/std/containers/associative/set/set.cons/move_assign.pass.cpp
+++ b/test/std/containers/associative/set/set.cons/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <set>
 
 // class set
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -142,6 +141,7 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly V;
         typedef test_compare<std::less<MoveOnly> > C;
@@ -181,4 +181,6 @@
         assert(m3.key_comp() == C(5));
         assert(m1.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp
index 6210a59..b102f11 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp
@@ -15,7 +15,6 @@
 #include <queue>
 #include <cassert>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 template <class T>
@@ -31,11 +30,11 @@
         : base(comp, c, a) {}
     test(const value_compare& comp, const container_type& c,
         const test_allocator<int>& a) : base(comp, c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(const value_compare& comp, container_type&& c,
          const test_allocator<int>& a) : base(comp, std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 
     using base::c;
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp
index b1d13fb..4d99fc1 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_comp_alloc.pass.cpp
@@ -15,7 +15,6 @@
 #include <queue>
 #include <cassert>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 template <class T>
@@ -31,11 +30,11 @@
         : base(comp, a) {}
     test(const value_compare& comp, const container_type& c,
         const test_allocator<int>& a) : base(comp, c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(const value_compare& comp, container_type&& c,
          const test_allocator<int>& a) : base(comp, std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 
     using base::c;
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp
index df255b4..8bdf7db 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // template <class Alloc>
@@ -19,6 +17,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -53,9 +52,11 @@
     using base::c;
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test<MoveOnly> qo(std::less<MoveOnly>(),
                       make<std::vector<MoveOnly, test_allocator<MoveOnly> > >(5),
                       test_allocator<MoveOnly>(2));
@@ -63,4 +64,5 @@
     assert(q.size() == 5);
     assert(q.c.get_allocator() == test_allocator<MoveOnly>(6));
     assert(q.top() == MoveOnly(4));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp
index 4b20b26..d43e538 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue& operator=(priority_queue&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,12 +28,15 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::priority_queue<MoveOnly> qo(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5));
     std::priority_queue<MoveOnly> q;
     q = std::move(qo);
     assert(q.size() == 5);
     assert(q.top() == MoveOnly(4));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp
index 719f6d9..b61fb88 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_comp_rcontainer.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // explicit priority_queue(const Compare& comp, container_type&& c);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,10 +28,13 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::priority_queue<MoveOnly> q(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5));
     assert(q.size() == 5);
     assert(q.top() == MoveOnly(4));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp
index 450dff3..7abe796 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_iter_iter_comp_rcont.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // template <class InputIterator>
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     int a[] = {3, 5, 2, 0, 6, 8, 1};
     const int n = sizeof(a)/sizeof(a[0]);
     std::priority_queue<MoveOnly> q(a+n/2, a+n,
@@ -29,4 +28,5 @@
                                     std::vector<MoveOnly>(a, a+n/2));
     assert(q.size() == n);
     assert(q.top() == MoveOnly(8));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp
index 229ec02..aac8403 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/ctor_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue(priority_queue&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,11 +28,14 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::priority_queue<MoveOnly> qo(std::less<MoveOnly>(), make<std::vector<MoveOnly> >(5));
     std::priority_queue<MoveOnly> q = std::move(qo);
     assert(q.size() == 5);
     assert(q.top() == MoveOnly(4));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
index e0547d6..5dec2b9 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue()
@@ -17,6 +15,7 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
 
 #include <queue>
 #include <cassert>
@@ -31,5 +30,5 @@
         typedef std::priority_queue<MoveOnly> C;
         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     }
-#endif
+#endif // _LIBCPP_VERSION
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
index 9c2058d..0218992 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.cons/move_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue(priority_queue&&)
@@ -17,6 +15,8 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
+
 #include <queue>
 #include <cassert>
 
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp
index be928fc..4f14e93 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.members/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue();
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::priority_queue<Emplaceable> q;
     q.emplace(1, 2.5);
     assert(q.top() == Emplaceable(1, 2.5));
@@ -29,4 +28,5 @@
     assert(q.top() == Emplaceable(3, 4.5));
     q.emplace(2, 3.5);
     assert(q.top() == Emplaceable(3, 4.5));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp b/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp
index 7f48272..4b20a9b 100644
--- a/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp
+++ b/test/std/containers/container.adaptors/priority.queue/priqueue.members/push_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // priority_queue();
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::priority_queue<MoveOnly> q;
     q.push(1);
     assert(q.top() == 1);
@@ -29,4 +28,5 @@
     assert(q.top() == 3);
     q.push(2);
     assert(q.top() == 3);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp
index 404db12..b3ee758 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_alloc.pass.cpp
@@ -15,7 +15,6 @@
 #include <queue>
 #include <cassert>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 struct test
@@ -25,10 +24,10 @@
 
     explicit test(const test_allocator<int>& a) : base(a) {}
     test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 };
 
diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
index 06a53fe..e4fff91 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_container_alloc.pass.cpp
@@ -16,7 +16,6 @@
 #include <cassert>
 #include <cstddef>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 template <class C>
@@ -38,10 +37,10 @@
 
     explicit test(const test_allocator<int>& a) : base(a) {}
     test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 };
 
diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp
index 2435856..0163588 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rcontainer_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // template <class Alloc>
@@ -20,6 +18,7 @@
 #include "test_allocator.h"
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -48,10 +47,13 @@
     allocator_type get_allocator() {return this->c.get_allocator();}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
     assert(q.get_allocator() == test_allocator<MoveOnly>(4));
     assert(q.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp
index 76428e3..7237bf2 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons.alloc/ctor_rqueue_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // template <class Alloc>
@@ -20,6 +18,7 @@
 #include "test_allocator.h"
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -48,11 +47,14 @@
     allocator_type get_allocator() {return this->c.get_allocator();}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
     test<MoveOnly> q2(std::move(q), test_allocator<MoveOnly>(5));
     assert(q2.get_allocator() == test_allocator<MoveOnly>(5));
     assert(q2.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp
index 57e2296..8dd5d2f 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // queue(queue&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,11 +28,14 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     std::queue<MoveOnly> q2 = std::move(q);
     assert(q2.size() == 5);
     assert(q.empty());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp
index 1b3f256..f72067b 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/ctor_rcontainer.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // explicit queue(container_type&& c);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,9 +28,12 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     assert(q.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
index 7518bcc..781d740 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // queue()
@@ -16,6 +14,8 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
+
 #include <queue>
 #include <cassert>
 
@@ -29,5 +29,5 @@
         typedef std::queue<MoveOnly> C;
         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     }
-#endif
+#endif // _LIBCPP_VERSION
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
index a89fbef..58c8f9d 100644
--- a/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.cons/move_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // queue(queue&&)
@@ -16,6 +14,7 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
 
 #include <queue>
 #include <cassert>
@@ -30,5 +29,5 @@
         typedef std::queue<MoveOnly> C;
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
-#endif
+#endif // _LIBCPP_VERSION
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp
index 0932b7d..af1b7e2 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // queue& operator=(queue&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,12 +28,15 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::queue<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     std::queue<MoveOnly> q2;
     q2 = std::move(q);
     assert(q2.size() == 5);
     assert(q.empty());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp b/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp
index 2e0a19a..d899282 100644
--- a/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp
+++ b/test/std/containers/container.adaptors/queue/queue.defn/push_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <queue>
 
 // void push(value_type&& v);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::queue<MoveOnly> q;
     q.push(MoveOnly(1));
     assert(q.size() == 1);
@@ -33,4 +32,5 @@
     assert(q.size() == 3);
     assert(q.front() == MoveOnly(1));
     assert(q.back() == MoveOnly(3));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp
index bac8378..94899d4 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_alloc.pass.cpp
@@ -15,7 +15,6 @@
 #include <stack>
 #include <cassert>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 struct test
@@ -25,10 +24,10 @@
 
     explicit test(const test_allocator<int>& a) : base(a) {}
     test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 };
 
diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
index 237870b..b3cf392 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_container_alloc.pass.cpp
@@ -16,7 +16,6 @@
 #include <cassert>
 #include <cstddef>
 
-#include "test_macros.h"
 #include "test_allocator.h"
 
 template <class C>
@@ -38,10 +37,10 @@
 
     explicit test(const test_allocator<int>& a) : base(a) {}
     test(const container_type& c, const test_allocator<int>& a) : base(c, a) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test(container_type&& c, const test_allocator<int>& a) : base(std::move(c), a) {}
     test(test&& q, const test_allocator<int>& a) : base(std::move(q), a) {}
-#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test_allocator<int> get_allocator() {return c.get_allocator();}
 };
 
diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp
index b0da1ef..374aa99 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rcontainer_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // template <class Alloc>
@@ -20,6 +18,7 @@
 #include "test_allocator.h"
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -48,10 +47,13 @@
     allocator_type get_allocator() {return this->c.get_allocator();}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
     assert(q.get_allocator() == test_allocator<MoveOnly>(4));
     assert(q.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp
index e75a8a2..5fa5bd2 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons.alloc/ctor_rqueue_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // template <class Alloc>
@@ -20,6 +18,7 @@
 #include "test_allocator.h"
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -48,11 +47,14 @@
     allocator_type get_allocator() {return this->c.get_allocator();}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     test<MoveOnly> q(make<C>(5), test_allocator<MoveOnly>(4));
     test<MoveOnly> q2(std::move(q), test_allocator<MoveOnly>(5));
     assert(q2.get_allocator() == test_allocator<MoveOnly>(5));
     assert(q2.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp
index d837e3d..44fab41 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // stack(stack&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,11 +28,14 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     std::stack<MoveOnly> q2 = std::move(q);
     assert(q2.size() == 5);
     assert(q.empty());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp
index 01d4674..ab08da9 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/ctor_rcontainer.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // explicit stack(container_type&& c);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,9 +28,12 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     assert(q.size() == 5);
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
index 03c709e..2e217c5 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // stack()
@@ -16,6 +14,7 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
 
 #include <stack>
 #include <cassert>
@@ -30,5 +29,5 @@
         typedef std::stack<MoveOnly> C;
         static_assert(std::is_nothrow_default_constructible<C>::value, "");
     }
-#endif
+#endif // _LIBCPP_VERSION
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
index 92aef08..af6793f 100644
--- a/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.cons/move_noexcept.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // stack(stack&&)
@@ -16,6 +14,8 @@
 
 // This tests a conforming extension
 
+// UNSUPPORTED: c++98, c++03
+
 #include <stack>
 #include <cassert>
 
@@ -29,5 +29,5 @@
         typedef std::stack<MoveOnly> C;
         static_assert(std::is_nothrow_move_constructible<C>::value, "");
     }
-#endif
+#endif // _LIBCPP_VERSION
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp
index cbb6346..75cbec1 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // stack& operator=(stack&& q);
@@ -18,6 +16,7 @@
 
 #include "MoveOnly.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -29,12 +28,15 @@
     return c;
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::stack<MoveOnly> q(make<std::deque<MoveOnly> >(5));
     std::stack<MoveOnly> q2;
     q2 = std::move(q);
     assert(q2.size() == 5);
     assert(q.empty());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp b/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp
index 9165f6e..67d0ea3 100644
--- a/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp
+++ b/test/std/containers/container.adaptors/stack/stack.defn/push_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <stack>
 
 // void push(value_type&& v);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::stack<MoveOnly> q;
     q.push(MoveOnly(1));
     assert(q.size() == 1);
@@ -30,4 +29,5 @@
     q.push(MoveOnly(3));
     assert(q.size() == 3);
     assert(q.top() == MoveOnly(3));
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/array/array.size/size.pass.cpp b/test/std/containers/sequences/array/array.size/size.pass.cpp
index 2fe5355..a833fdc 100644
--- a/test/std/containers/sequences/array/array.size/size.pass.cpp
+++ b/test/std/containers/sequences/array/array.size/size.pass.cpp
@@ -14,8 +14,6 @@
 #include <array>
 #include <cassert>
 
-#include "test_macros.h"
-
 // std::array is explicitly allowed to be initialized with A a = { init-list };.
 // Disable the missing braces warning for this reason.
 #include "disable_missing_braces_warning.h"
@@ -38,7 +36,7 @@
         assert(c.max_size() == 0);
         assert(c.empty());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
         typedef double T;
         typedef std::array<T, 3> C;
diff --git a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
index fdb751d..dea6492 100644
--- a/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // void assign(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d;
     d.assign({3, 4, 5, 6});
@@ -29,6 +28,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d;
     d.assign({3, 4, 5, 6});
@@ -38,4 +38,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
index dd70cda..dbf2705 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -28,6 +27,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -36,4 +36,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
index 2619569..9be3c63 100644
--- a/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/initializer_list_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
     assert(d.get_allocator() == test_allocator<int>(3));
@@ -30,6 +29,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
     assert(d.get_allocator() == min_allocator<int>());
@@ -39,4 +39,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
index 6e935a5..6887513 100644
--- a/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque(deque&&);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -52,6 +51,7 @@
         assert(c1.size() == 0);
         assert(c3.get_allocator() == c1.get_allocator());
     }
+#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -67,4 +67,6 @@
         assert(c1.size() == 0);
         assert(c3.get_allocator() == c1.get_allocator());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
index 5a9a77c..4aa0fa6 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque(deque&& c, const allocator_type& a);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -67,6 +66,7 @@
         assert(c3.get_allocator() == A(3));
         assert(c1.size() != 0);
     }
+#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -82,4 +82,6 @@
         assert(c3.get_allocator() == A());
         assert(c1.size() == 0);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
index 8a65bc2..ed8f154 100644
--- a/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque& operator=(deque&& c);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -70,6 +69,7 @@
         assert(c1.size() == 0);
         assert(c3.get_allocator() == A(5));
     }
+#if TEST_STD_VER >= 11
     {
         int ab[] = {3, 4, 2, 8, 0, 1, 44, 34, 45, 96, 80, 1, 13, 31, 45};
         int* an = ab + sizeof(ab)/sizeof(ab[0]);
@@ -86,4 +86,6 @@
         assert(c1.size() == 0);
         assert(c3.get_allocator() == A());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
index 117e942..597f642 100644
--- a/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.cons/op_equal_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // deque& operator=(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d;
     d = {3, 4, 5, 6};
@@ -29,6 +28,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::deque<int, min_allocator<int>> d;
     d = {3, 4, 5, 6};
@@ -38,4 +38,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
index 6d33424..5f78040 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::deque<int> d(10, 1);
     std::deque<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -60,4 +59,5 @@
     assert(d[12] == 1);
     assert(d[13] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
index 060d83b..b5c8810 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_back_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // void push_back(value_type&& v);
@@ -21,6 +19,7 @@
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -58,19 +57,24 @@
     }
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
     const int N = sizeof(rng)/sizeof(rng[0]);
     for (int j = 0; j < N; ++j)
         test<std::deque<MoveOnly> >(rng[j]);
     }
+#if TEST_STD_VER >= 11
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2046, 2047, 2048, 2049, 4094, 4095, 4096};
     const int N = sizeof(rng)/sizeof(rng[0]);
     for (int j = 0; j < N; ++j)
         test<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[j]);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
index df3d2d0..8e734a6 100644
--- a/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/deque/deque.modifiers/push_front_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <deque>
 
 // void push_front(value_type&& v);
@@ -20,6 +18,7 @@
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class C>
 C
@@ -67,9 +66,11 @@
     test(c1, -10);
 }
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
     const int N = sizeof(rng)/sizeof(rng[0]);
@@ -77,6 +78,7 @@
         for (int j = 0; j < N; ++j)
             testN<std::deque<MoveOnly> >(rng[i], rng[j]);
     }
+#if TEST_STD_VER >= 11
     {
     int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
     const int N = sizeof(rng)/sizeof(rng[0]);
@@ -84,4 +86,6 @@
         for (int j = 0; j < N; ++j)
             testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
index 69fb6eb..d4dda02 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // void assign(initializer_list<value_type> il);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         typedef std::forward_list<T> C;
@@ -43,6 +42,7 @@
             assert(*i == 10+n);
         assert(n == 4);
     }
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -65,4 +65,6 @@
             assert(*i == 10+n);
         assert(n == 4);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
index 6111835..9352848 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // forward_list& operator=(forward_list&& x);
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef test_allocator<T> A;
@@ -160,6 +159,7 @@
         assert(c1.get_allocator() == A(10));
         assert(c0.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly T;
         typedef min_allocator<T> A;
@@ -194,4 +194,6 @@
         assert(c1.get_allocator() == A());
         assert(c0.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
index 84f1eb9..3d35916 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/assign_op_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // forward_list& operator=(initializer_list<value_type> il);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         typedef std::forward_list<T> C;
@@ -43,6 +42,7 @@
             assert(*i == 10+n);
         assert(n == 4);
     }
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -65,4 +65,6 @@
             assert(*i == 10+n);
         assert(n == 4);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
index 7575c0e..ac73d14 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // forward_list(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         typedef std::forward_list<T> C;
@@ -29,6 +28,7 @@
             assert(*i == n);
         assert(n == 10);
     }
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -38,4 +38,6 @@
             assert(*i == n);
         assert(n == 10);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
index cf9cbff..844be20 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/init_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // forward_list(initializer_list<value_type> il, const allocator_type& a);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         typedef test_allocator<T> A;
@@ -32,6 +31,7 @@
         assert(n == 10);
         assert(c.get_allocator() == A(14));
     }
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef min_allocator<T> A;
@@ -43,4 +43,6 @@
         assert(n == 10);
         assert(c.get_allocator() == A());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
index 92a9e39..a5948b9 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // forward_list(forward_list&& x);
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef test_allocator<T> A;
@@ -53,6 +52,7 @@
         assert(c0.empty());
         assert(c.get_allocator() == A(10));
     }
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly T;
         typedef min_allocator<T> A;
@@ -68,4 +68,6 @@
         assert(c0.empty());
         assert(c.get_allocator() == A());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
new file mode 100644
index 0000000..2d963a1
--- /dev/null
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <forward_list>
+
+// explicit forward_list(size_type n);
+
+#include <forward_list>
+#include <cassert>
+
+#include "DefaultOnly.h"
+
+int main()
+{
+    {
+        typedef DefaultOnly T;
+        typedef std::forward_list<T> C;
+        unsigned N = 10;
+        C c = N;
+        unsigned n = 0;
+        for (C::const_iterator i = c.begin(), e = c.end(); i != e; ++i, ++n)
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+            assert(*i == T());
+#else
+            ;
+#endif
+        assert(n == N);
+    }
+}
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
index 061dd6d..b536ccf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.cons/size.pass.cpp
@@ -36,11 +36,6 @@
 
 int main()
 {
-    { // test that the ctor is explicit
-      typedef std::forward_list<DefaultOnly> C;
-      static_assert((std::is_constructible<C, size_t>::value), "");
-      static_assert((!std::is_convertible<size_t, C>::value), "");
-    }
     {
         typedef DefaultOnly T;
         typedef std::forward_list<T> C;
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
index 8d7c4e9..dd8ea88 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/emplace_after.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // template <class... Args>
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef Emplaceable T;
         typedef std::forward_list<T> C;
@@ -53,6 +52,7 @@
         assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
         assert(distance(c.begin(), c.end()) == 4);
     }
+#if TEST_STD_VER >= 11
     {
         typedef Emplaceable T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -84,4 +84,6 @@
         assert(*next(c.begin(), 3) == Emplaceable(2, 3.5));
         assert(distance(c.begin(), c.end()) == 4);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
index 90ee0d2..15e1a08 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // iterator insert_after(const_iterator p, initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         typedef std::forward_list<T> C;
@@ -45,6 +44,7 @@
         assert(*next(c.begin(), 3) == 1);
         assert(*next(c.begin(), 4) == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -70,4 +70,6 @@
         assert(*next(c.begin(), 3) == 1);
         assert(*next(c.begin(), 4) == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
index 173ccaa..2e21cc7 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/insert_after_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // iterator insert_after(const_iterator p, value_type&& v);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef std::forward_list<T> C;
@@ -53,6 +52,7 @@
         assert(*next(c.begin(), 3) == 2);
         assert(distance(c.begin(), c.end()) == 4);
     }
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -85,4 +85,6 @@
         assert(*next(c.begin(), 3) == 2);
         assert(distance(c.begin(), c.end()) == 4);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
index 545b0e6..d831ceb 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/pop_front.pass.cpp
@@ -32,7 +32,7 @@
         c.pop_front();
         assert(distance(c.begin(), c.end()) == 0);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef std::forward_list<T> C;
@@ -45,6 +45,8 @@
         c.pop_front();
         assert(distance(c.begin(), c.end()) == 0);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef int T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -58,6 +60,7 @@
         c.pop_front();
         assert(distance(c.begin(), c.end()) == 0);
     }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -70,5 +73,6 @@
         c.pop_front();
         assert(distance(c.begin(), c.end()) == 0);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 #endif
 }
diff --git a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
index 7fc2b9d..dfcd2cf 100644
--- a/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
+++ b/test/std/containers/sequences/forwardlist/forwardlist.modifiers/push_front_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <forward_list>
 
 // void push_front(value_type&& v);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef MoveOnly T;
         typedef std::forward_list<T> C;
@@ -33,6 +32,7 @@
         assert(*next(c.begin()) == 1);
         assert(distance(c.begin(), c.end()) == 2);
     }
+#if TEST_STD_VER >= 11
     {
         typedef MoveOnly T;
         typedef std::forward_list<T, min_allocator<T>> C;
@@ -45,4 +45,6 @@
         assert(*next(c.begin()) == 1);
         assert(distance(c.begin(), c.end()) == 2);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
index 4704cf4..9b2c6d6 100644
--- a/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // void assign(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::list<int> d;
     d.assign({3, 4, 5, 6});
@@ -30,6 +29,7 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::list<int, min_allocator<int>> d;
     d.assign({3, 4, 5, 6});
@@ -40,4 +40,6 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
index eec2142..2f863c6 100644
--- a/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // list& operator=(list&& c);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
         std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -63,6 +62,7 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#if TEST_STD_VER >= 11
     {
         std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
         std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -77,4 +77,6 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
index 8f04e73..4041320 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // list(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::list<int> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -29,6 +28,7 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::list<int, min_allocator<int>> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -38,4 +38,6 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
index 3388e00..6040c64 100644
--- a/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/initializer_list_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // list(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::list<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
     assert(d.get_allocator() == test_allocator<int>(3));
@@ -31,6 +30,7 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::list<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
     assert(d.get_allocator() == min_allocator<int>());
@@ -41,4 +41,6 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
index 7236f7c..9f8a536 100644
--- a/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // list(list&& c, const allocator_type& a);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::list<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
         std::list<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -60,6 +59,7 @@
         assert(!l.empty());
         assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
     }
+#if TEST_STD_VER >= 11
     {
         std::list<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
         std::list<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -73,4 +73,6 @@
         assert(l.empty());
         assert(l2.get_allocator() == min_allocator<MoveOnly>());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
index b638e21..1097bda 100644
--- a/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.cons/op_equal_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // list& operator=(initializer_list<value_type> il);
@@ -19,6 +17,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::list<int> d;
     d = {3, 4, 5, 6};
@@ -29,6 +28,7 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::list<int, min_allocator<int>> d;
     d = {3, 4, 5, 6};
@@ -39,4 +39,6 @@
     assert(*i++ == 5);
     assert(*i++ == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
index 2d5231e..91845e5 100644
--- a/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::list<int> d(10, 1);
     std::list<int>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
@@ -41,6 +40,7 @@
     assert(*i++ == 1);
     assert(*i++ == 1);
     }
+#if TEST_STD_VER >= 11
     {
     std::list<int, min_allocator<int>> d(10, 1);
     std::list<int, min_allocator<int>>::iterator i = d.insert(next(d.cbegin(), 2), {3, 4, 5, 6});
@@ -62,4 +62,6 @@
     assert(*i++ == 1);
     assert(*i++ == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
index 3d9d00a..10acede 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_back_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // void push_back(value_type&& x);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<MoveOnly> l1;
     l1.push_back(MoveOnly(1));
@@ -31,6 +30,7 @@
     assert(l1.front() == MoveOnly(1));
     assert(l1.back() == MoveOnly(2));
     }
+#if TEST_STD_VER >= 11
     {
     std::list<MoveOnly, min_allocator<MoveOnly>> l1;
     l1.push_back(MoveOnly(1));
@@ -41,4 +41,6 @@
     assert(l1.front() == MoveOnly(1));
     assert(l1.back() == MoveOnly(2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
index 6fef6ad..5321ee0 100644
--- a/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
+++ b/test/std/containers/sequences/list/list.modifiers/push_front_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <list>
 
 // void push_front(value_type&& x);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
     std::list<MoveOnly> l1;
     l1.push_front(MoveOnly(1));
@@ -31,6 +30,7 @@
     assert(l1.front() == MoveOnly(2));
     assert(l1.back() == MoveOnly(1));
     }
+#if TEST_STD_VER >= 11
     {
     std::list<MoveOnly, min_allocator<MoveOnly>> l1;
     l1.push_front(MoveOnly(1));
@@ -41,4 +41,6 @@
     assert(l1.front() == MoveOnly(2));
     assert(l1.back() == MoveOnly(1));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
index 60146a8..ac7a2ce 100644
--- a/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // void assign(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<bool> d;
     d.assign({true, false, false, true});
@@ -29,6 +28,7 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<bool, min_allocator<bool>> d;
     d.assign({true, false, false, true});
@@ -38,4 +38,6 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
index 13cd65f..f07c1d9 100644
--- a/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector& operator=(vector&& c);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -62,6 +61,7 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
         std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -76,4 +76,6 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
index c737f05..81a8ae4 100644
--- a/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/emplace_back.pass.cpp
@@ -48,7 +48,7 @@
         assert(c.front() == false);
         assert(c.back() == true);
 #endif
-        c.emplace_back(true);
+        c.emplace_back(1 == 1);
         assert(c.size() == 3);
         assert(c.front() == false);
         assert(c[1] == true);
@@ -82,7 +82,7 @@
         assert(c.front() == false);
         assert(c.back() == true);
 #endif
-        c.emplace_back(true);
+        c.emplace_back(1 == 1);
         assert(c.size() == 3);
         assert(c.front() == false);
         assert(c[1] == true);
diff --git a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
index a850fa2..07bae0e 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<bool> d = {true, false, false, true};
     assert(d.size() == 4);
@@ -28,6 +27,7 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<bool, min_allocator<bool>> d = {true, false, false, true};
     assert(d.size() == 4);
@@ -36,4 +36,6 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
index 9a2df42..5f7f514 100644
--- a/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/initializer_list_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<bool, test_allocator<bool>> d({true, false, false, true}, test_allocator<bool>(3));
     assert(d.get_allocator() == test_allocator<bool>(3));
@@ -30,6 +29,7 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<bool, min_allocator<bool>> d({true, false, false, true}, min_allocator<bool>());
     assert(d.get_allocator() == min_allocator<bool>());
@@ -39,4 +39,6 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
index df4cb19..3a176d9 100644
--- a/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/insert_iter_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<bool> d(10, true);
     std::vector<bool>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false});
@@ -40,6 +39,7 @@
     assert(d[12] == true);
     assert(d[13] == true);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<bool, min_allocator<bool>> d(10, true);
     std::vector<bool, min_allocator<bool>>::iterator i = d.insert(d.cbegin() + 2, {false, true, true, false});
@@ -60,4 +60,6 @@
     assert(d[12] == true);
     assert(d[13] == true);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector.bool/move.pass.cpp b/test/std/containers/sequences/vector.bool/move.pass.cpp
index f189e2b..f3a11ec 100644
--- a/test/std/containers/sequences/vector.bool/move.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(vector&& c);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -46,6 +45,7 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
         std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -59,4 +59,6 @@
         assert(l.empty());
         assert(l2.get_allocator() == lo.get_allocator());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
index b3b6f96..7aaa7c5 100644
--- a/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(vector&& c, const allocator_type& a);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<bool, test_allocator<bool> > l(test_allocator<bool>(5));
         std::vector<bool, test_allocator<bool> > lo(test_allocator<bool>(5));
@@ -59,6 +58,7 @@
         assert(!l.empty());
         assert(l2.get_allocator() == other_allocator<bool>(4));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<bool, min_allocator<bool> > l(min_allocator<bool>{});
         std::vector<bool, min_allocator<bool> > lo(min_allocator<bool>{});
@@ -72,4 +72,6 @@
         assert(l.empty());
         assert(l2.get_allocator() == min_allocator<bool>());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
index 6187433..4b959cf 100644
--- a/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/op_equal_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector& operator=(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<bool> d;
     d = {true, false, false, true};
@@ -29,6 +28,7 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<bool, min_allocator<bool>> d;
     d = {true, false, false, true};
@@ -38,4 +38,6 @@
     assert(d[2] == false);
     assert(d[3] == true);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
index 89f5a66..4f82792 100644
--- a/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
+++ b/test/std/containers/sequences/vector.bool/vector_bool.pass.cpp
@@ -31,7 +31,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<H::argument_type, T>::value), "" );
     static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
 
     bool ba[] = {true, false, true, true, false};
     T vb(std::begin(ba), std::end(ba));
@@ -44,7 +43,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<H::argument_type, T>::value), "" );
     static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     bool ba[] = {true, false, true, true, false};
     T vb(std::begin(ba), std::end(ba));
     H h;
diff --git a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
index 273bdad..6409aca 100644
--- a/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.capacity/resize_size.pass.cpp
@@ -13,8 +13,6 @@
 
 #include <vector>
 #include <cassert>
-
-#include "test_macros.h"
 #include "test_allocator.h"
 #include "MoveOnly.h"
 #include "min_allocator.h"
@@ -22,30 +20,7 @@
 
 int main()
 {
-    {
-        std::vector<int> v(100);
-        v.resize(50);
-        assert(v.size() == 50);
-        assert(v.capacity() == 100);
-        assert(is_contiguous_container_asan_correct(v));
-        v.resize(200);
-        assert(v.size() == 200);
-        assert(v.capacity() >= 200);
-        assert(is_contiguous_container_asan_correct(v));
-    }
-    {
-        // Add 1 for implementations that dynamically allocate a container proxy.
-        std::vector<int, limited_allocator<int, 300 + 1> > v(100);
-        v.resize(50);
-        assert(v.size() == 50);
-        assert(v.capacity() == 100);
-        assert(is_contiguous_container_asan_correct(v));
-        v.resize(200);
-        assert(v.size() == 200);
-        assert(v.capacity() >= 200);
-        assert(is_contiguous_container_asan_correct(v));
-    }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<MoveOnly> v(100);
         v.resize(50);
@@ -69,6 +44,32 @@
         assert(v.capacity() >= 200);
         assert(is_contiguous_container_asan_correct(v));
     }
+#else  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    {
+        std::vector<int> v(100);
+        v.resize(50);
+        assert(v.size() == 50);
+        assert(v.capacity() == 100);
+        assert(is_contiguous_container_asan_correct(v));
+        v.resize(200);
+        assert(v.size() == 200);
+        assert(v.capacity() >= 200);
+        assert(is_contiguous_container_asan_correct(v));
+    }
+    {
+        // Add 1 for implementations that dynamically allocate a container proxy.
+        std::vector<int, limited_allocator<int, 300 + 1> > v(100);
+        v.resize(50);
+        assert(v.size() == 50);
+        assert(v.capacity() == 100);
+        assert(is_contiguous_container_asan_correct(v));
+        v.resize(200);
+        assert(v.size() == 200);
+        assert(v.capacity() >= 200);
+        assert(is_contiguous_container_asan_correct(v));
+    }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         std::vector<MoveOnly, min_allocator<MoveOnly>> v(100);
         v.resize(50);
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
index 853f755..222fa9c 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // void assign(initializer_list<value_type> il);
@@ -22,6 +20,7 @@
 template <typename Vec>
 void test ( Vec &v )
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     v.assign({3, 4, 5, 6});
     assert(v.size() == 4);
     assert(is_contiguous_container_asan_correct(v));
@@ -29,6 +28,7 @@
     assert(v[1] == 4);
     assert(v[2] == 5);
     assert(v[3] == 6);
+#endif
 }
 
 int main()
@@ -41,6 +41,8 @@
     test(d1);
     test(d2);
     }
+
+#if TEST_STD_VER >= 11
     {
     typedef std::vector<int, min_allocator<int>> V;
     V d1;
@@ -49,4 +51,5 @@
     test(d1);
     test(d2);
     }
+#endif
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
index c2b6b83..acbee97 100644
--- a/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector& operator=(vector&& c);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
         std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -77,6 +76,7 @@
         assert(l2.get_allocator() == lo.get_allocator());
         assert(is_contiguous_container_asan_correct(l2));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
         std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -96,4 +96,6 @@
         assert(l2.get_allocator() == lo.get_allocator());
         assert(is_contiguous_container_asan_correct(l2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
index edbad8c..408bcc3 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(initializer_list<value_type> il);
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<int> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -29,6 +28,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<int, min_allocator<int>> d = {3, 4, 5, 6};
     assert(d.size() == 4);
@@ -38,4 +38,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
index ac5d017..f4c3b5c 100644
--- a/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/initializer_list_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(initializer_list<value_type> il, const Allocator& a = allocator_type());
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<int, test_allocator<int>> d({3, 4, 5, 6}, test_allocator<int>(3));
     assert(d.get_allocator() == test_allocator<int>(3));
@@ -32,6 +31,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<int, min_allocator<int>> d({3, 4, 5, 6}, min_allocator<int>());
     assert(d.get_allocator() == min_allocator<int>());
@@ -42,4 +42,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
index cd50d54..d51b364 100644
--- a/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(vector&& c);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
         std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -69,6 +68,7 @@
         assert(*j == 3);
         assert(is_contiguous_container_asan_correct(c2));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
         std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -98,4 +98,6 @@
         assert(*j == 3);
         assert(is_contiguous_container_asan_correct(c2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
index 767a0ce..fcdd35a 100644
--- a/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector(vector&& c, const allocator_type& a);
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<MoveOnly, test_allocator<MoveOnly> > l(test_allocator<MoveOnly>(5));
         std::vector<MoveOnly, test_allocator<MoveOnly> > lo(test_allocator<MoveOnly>(5));
@@ -76,6 +75,7 @@
         assert(l2.get_allocator() == other_allocator<MoveOnly>(4));
         assert(is_contiguous_container_asan_correct(l2));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<MoveOnly, min_allocator<MoveOnly> > l(min_allocator<MoveOnly>{});
         std::vector<MoveOnly, min_allocator<MoveOnly> > lo(min_allocator<MoveOnly>{});
@@ -94,4 +94,6 @@
         assert(l2.get_allocator() == min_allocator<MoveOnly>());
         assert(is_contiguous_container_asan_correct(l2));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
index 21dd5c3..4e5a204 100644
--- a/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.cons/op_equal_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // vector& operator=(initializer_list<value_type> il);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<int> d;
     d = {3, 4, 5, 6};
@@ -31,6 +30,7 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<int, min_allocator<int>> d;
     d = {3, 4, 5, 6};
@@ -41,4 +41,6 @@
     assert(d[2] == 5);
     assert(d[3] == 6);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
deleted file mode 100644
index 5f053eb..0000000
--- a/test/std/containers/sequences/vector/vector.modifiers/clear.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <vector>
-
-// void clear();
-
-#include <vector>
-#include <cassert>
-
-#include "min_allocator.h"
-#include "asan_testing.h"
-
-int main()
-{
-    {
-    int a[] = {1, 2, 3};
-    std::vector<int> c(a, a+3);
-    c.clear();
-    assert(c.empty());
-    LIBCPP_ASSERT(c.__invariants());
-    LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
-    }
-#if TEST_STD_VER >= 11
-    {
-    int a[] = {1, 2, 3};
-    std::vector<int, min_allocator<int>> c(a, a+3);
-    c.clear();
-    assert(c.empty());
-    LIBCPP_ASSERT(c.__invariants());
-    LIBCPP_ASSERT(is_contiguous_container_asan_correct(c));
-    }
-#endif
-}
diff --git a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
index e5e0277..7e4aed8 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/emplace_extra.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         std::vector<int> v;
         v.reserve(3);
@@ -39,6 +38,7 @@
         assert(v[0] == 3);
         assert(is_contiguous_container_asan_correct(v));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<int, min_allocator<int>> v;
         v.reserve(3);
@@ -57,4 +57,6 @@
         assert(v[0] == 3);
         assert(is_contiguous_container_asan_correct(v));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
index 785a5be..dbdccf1 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter.pass.cpp
@@ -18,21 +18,6 @@
 #include "min_allocator.h"
 #include "asan_testing.h"
 
-#ifndef TEST_HAS_NO_EXCEPTIONS
-struct Throws {
-    Throws() : v_(0) {}
-    Throws(int v) : v_(v) {}
-    Throws(const Throws  &rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
-    Throws(      Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
-    Throws& operator=(const Throws  &rhs) { v_ = rhs.v_; return *this; }
-    Throws& operator=(      Throws &&rhs) { v_ = rhs.v_; return *this; }
-    int v_;
-    static bool sThrows;
-    };
-
-bool Throws::sThrows = false;
-#endif
-
 int main()
 {
     {
@@ -87,17 +72,4 @@
     assert(is_contiguous_container_asan_correct(l1));
     }
 #endif
-#ifndef TEST_HAS_NO_EXCEPTIONS
-// Test for LWG2853:
-// Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T.
-    {
-    Throws arr[] = {1, 2, 3};
-    std::vector<Throws> v(arr, arr+3);
-    Throws::sThrows = true;
-    v.erase(v.begin());
-    v.erase(--v.end());
-    v.erase(v.begin());
-    assert(v.size() == 0);
-    }
-#endif
 }
diff --git a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
index 2fc4981..f7fa0db 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/erase_iter_iter.pass.cpp
@@ -18,21 +18,6 @@
 #include "min_allocator.h"
 #include "asan_testing.h"
 
-#ifndef TEST_HAS_NO_EXCEPTIONS
-struct Throws {
-    Throws() : v_(0) {}
-    Throws(int v) : v_(v) {}
-    Throws(const Throws  &rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
-    Throws(      Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
-    Throws& operator=(const Throws  &rhs) { v_ = rhs.v_; return *this; }
-    Throws& operator=(      Throws &&rhs) { v_ = rhs.v_; return *this; }
-    int v_;
-    static bool sThrows;
-    };
-
-bool Throws::sThrows = false;
-#endif
-
 int main()
 {
     int a1[] = {1, 2, 3};
@@ -140,17 +125,4 @@
         assert(is_contiguous_container_asan_correct(outer[1]));
     }
 #endif
-#ifndef TEST_HAS_NO_EXCEPTIONS
-// Test for LWG2853:
-// Throws: Nothing unless an exception is thrown by the assignment operator or move assignment operator of T.
-    {
-    Throws arr[] = {1, 2, 3};
-    std::vector<Throws> v(arr, arr+3);
-    Throws::sThrows = true;
-    v.erase(v.begin(), --v.end());
-    assert(v.size() == 1);
-    v.erase(v.begin(), v.end());
-    assert(v.size() == 0);
-    }
-#endif
 }
diff --git a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
index 9072d42..b0fe123 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/insert_iter_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // iterator insert(const_iterator p, initializer_list<value_type> il);
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
     std::vector<int> d(10, 1);
     std::vector<int>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -42,6 +41,7 @@
     assert(d[12] == 1);
     assert(d[13] == 1);
     }
+#if TEST_STD_VER >= 11
     {
     std::vector<int, min_allocator<int>> d(10, 1);
     std::vector<int, min_allocator<int>>::iterator i = d.insert(d.cbegin() + 2, {3, 4, 5, 6});
@@ -63,4 +63,6 @@
     assert(d[12] == 1);
     assert(d[13] == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
index ac1fffd..f4a1f5d 100644
--- a/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
+++ b/test/std/containers/sequences/vector/vector.modifiers/push_back_rvalue.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <vector>
 
 // void push_back(value_type&& x);
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::vector<MoveOnly> c;
         c.push_back(MoveOnly(0));
@@ -82,6 +81,7 @@
         for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
             assert(c[j] == MoveOnly(j));
     }
+#if TEST_STD_VER >= 11
     {
         std::vector<MoveOnly, min_allocator<MoveOnly>> c;
         c.push_back(MoveOnly(0));
@@ -110,4 +110,6 @@
         for (int j = 0; static_cast<std::size_t>(j) < c.size(); ++j)
             assert(c[j] == MoveOnly(j));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
index 9fca1f1..4d92b3d4 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -29,6 +27,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_map<int, std::string,
@@ -61,6 +60,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_map<int, std::string,
@@ -93,4 +93,6 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
index 0d08fae..e86d35b 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef test_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_map<int, std::string,
@@ -168,6 +167,7 @@
         assert(c.max_load_factor() == 1);
         assert(c0.size() == 0);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_map<int, std::string,
@@ -214,4 +214,18 @@
         assert(c.max_load_factor() == 1);
         assert(c0.size() == 0);
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_map<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+        std::unordered_map<int, int>::iterator i = s1.begin();
+        std::pair<const int, int> k = *i;
+        std::unordered_map<int, int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
index b06e4db..bebab03 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -62,6 +61,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -158,5 +158,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
-#endif // TEST_STD_VER > 11
+#endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
index ca48808..9055e3d 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -65,6 +64,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -98,4 +98,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
index 02360f8..db0010b 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -66,6 +65,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -100,4 +100,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
index c6a3976..c76ce39 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -33,6 +31,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -68,6 +67,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -103,4 +103,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
index 5acc4c3..6cb57d4 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -33,6 +31,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -69,6 +68,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -141,4 +141,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
index 2963631..681c0e9 100644
--- a/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.cnstr/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<int, std::string> P;
         typedef test_allocator<std::pair<const int, std::string>> A;
@@ -114,6 +113,7 @@
 
         assert(c0.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<int, std::string> P;
         typedef min_allocator<std::pair<const int, std::string>> A;
@@ -196,4 +196,6 @@
 
         assert(c0.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp
index 18c83dd..26f7161 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_map<int, Emplaceable> C;
         typedef std::pair<C::iterator, bool> R;
@@ -50,6 +49,7 @@
         assert(r.first->first == 5);
         assert(r.first->second == Emplaceable(6, 7));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, Emplaceable, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, Emplaceable>>> C;
@@ -75,4 +75,6 @@
         assert(r.first->first == 5);
         assert(r.first->second == Emplaceable(6, 7));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp
index ce7fa83..477f2cf 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -18,6 +16,9 @@
 // template <class... Args>
 //     iterator emplace_hint(const_iterator p, Args&&... args);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
 
 #include <unordered_map>
 #include <cassert>
@@ -27,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_map<int, Emplaceable> C;
         typedef C::iterator R;
@@ -49,6 +51,7 @@
         assert(r->first == 5);
         assert(r->second == Emplaceable(6, 7));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, Emplaceable, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, Emplaceable>>> C;
@@ -72,4 +75,19 @@
         assert(r->first == 5);
         assert(r->second == Emplaceable(6, 7));
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_map<int, Emplaceable> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        R r = c.emplace_hint(c2.end(), std::piecewise_construct,
+                                       std::forward_as_tuple(3),
+                                       std::forward_as_tuple());
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp
index 477a229..a4d8b5d 100644
--- a/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.map/unord.map.modifiers/insert_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_map<int, std::string> C;
         typedef std::pair<int, std::string> P;
@@ -46,6 +45,7 @@
         assert(c.at(3) == "three");
         assert(c.at(4) == "four");
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_map<int, std::string, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, std::string>>> C;
@@ -67,4 +67,6 @@
         assert(c.at(3) == "three");
         assert(c.at(4) == "four");
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
index cefbf45..6d27dec 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -30,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef test_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_multimap<int, std::string,
@@ -86,6 +85,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_multimap<int, std::string,
@@ -142,4 +142,6 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
index 9bd55ac..b9b8723 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef test_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_multimap<int, std::string,
@@ -226,6 +225,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<std::pair<const int, std::string> > A;
         typedef std::unordered_multimap<int, std::string,
@@ -291,4 +291,18 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_multimap<int, int> s1 = {{1, 1}, {2, 2}, {3, 3}};
+        std::unordered_multimap<int, int>::iterator i = s1.begin();
+        std::pair<const int, int> k = *i;
+        std::unordered_multimap<int, int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
index 1a222ce..445fd2d 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -84,6 +83,7 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >());
         assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >()));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -250,5 +250,7 @@
         assert(c.get_allocator() == a);
         assert(!(c.get_allocator() == A()));
     }
-#endif // TEST_STD_VER > 11
+#endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
index ef75b6c..92a43b4 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -87,6 +86,7 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >());
         assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >()));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -142,4 +142,6 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >());
         assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
index 9981253..d7afafc 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -88,6 +87,7 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >());
         assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >()));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -144,4 +144,6 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >());
         assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
index 1ca9464..9842a4b 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -33,6 +31,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -90,6 +89,7 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
         assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >()));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -147,4 +147,6 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
         assert((c.get_allocator() == min_allocator<std::pair<const int, std::string> >()));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
index e8efefb..244c3f5 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -33,6 +31,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -91,6 +90,7 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
         assert((c.get_allocator() == test_allocator<std::pair<const int, std::string> >(10)));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string,
                                    test_hash<std::hash<int> >,
@@ -208,4 +208,6 @@
         assert(c.key_eq() == test_compare<std::equal_to<int> >(9));
         assert(c.get_allocator() == A{});
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
index 0e00452..878ef59 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.cnstr/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -34,6 +32,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::pair<int, std::string> P;
         typedef test_allocator<std::pair<const int, std::string>> A;
@@ -162,6 +161,7 @@
 
         assert(c0.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::pair<int, std::string> P;
         typedef min_allocator<std::pair<const int, std::string>> A;
@@ -290,4 +290,6 @@
 
         assert(c0.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp
index 68e5267..96678cf 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multimap<int, Emplaceable> C;
         typedef C::iterator R;
@@ -47,6 +46,7 @@
         assert(r->first == 5);
         assert(r->second == Emplaceable(6, 7));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, Emplaceable, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, Emplaceable>>> C;
@@ -69,4 +69,6 @@
         assert(r->first == 5);
         assert(r->second == Emplaceable(6, 7));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
index 86950e2..a809513 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -18,6 +16,9 @@
 // template <class... Args>
 //     iterator emplace_hint(const_iterator p, Args&&... args);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
 
 #include <unordered_map>
 #include <cassert>
@@ -28,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multimap<int, Emplaceable> C;
         typedef C::iterator R;
@@ -58,6 +60,7 @@
         assert(r->first == 3);
         LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, Emplaceable, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, Emplaceable>>> C;
@@ -89,4 +92,19 @@
         assert(r->first == 3);
         LIBCPP_ASSERT(r->second == Emplaceable(5, 6));
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multimap<int, Emplaceable> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        R r = c.emplace_hint(c2.end(), std::piecewise_construct,
+                                       std::forward_as_tuple(3),
+                                       std::forward_as_tuple());
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
index ef15771..e0b1c69 100644
--- a/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.multimap/unord.multimap.modifiers/insert_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_map>
 
 // template <class Key, class T, class Hash = hash<Key>, class Pred = equal_to<Key>,
@@ -27,6 +25,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multimap<int, std::string> C;
         typedef std::pair<int, std::string> P;
@@ -72,6 +71,7 @@
         assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
         assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multimap<int, std::string, std::hash<int>, std::equal_to<int>,
                             min_allocator<std::pair<const int, std::string>>> C;
@@ -118,4 +118,6 @@
         assert(static_cast<std::size_t>(std::distance(c.begin(), c.end())) == c.size());
         assert(static_cast<std::size_t>(std::distance(c.cbegin(), c.cend())) == c.size());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/emplace.pass.cpp b/test/std/containers/unord/unord.multiset/emplace.pass.cpp
index 5d925c8..d8d9e9b 100644
--- a/test/std/containers/unord/unord.multiset/emplace.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<Emplaceable> C;
         typedef C::iterator R;
@@ -42,6 +41,7 @@
         assert(c.size() == 3);
         assert(*r == Emplaceable(5, 6));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
                       std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
@@ -59,4 +59,6 @@
         assert(c.size() == 3);
         assert(*r == Emplaceable(5, 6));
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp b/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp
index d9bab1f..3756476 100644
--- a/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -18,6 +16,9 @@
 // template <class... Args>
 //     iterator emplace_hint(const_iterator p, Args&&... args);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
 
 #include <unordered_set>
 #include <cassert>
@@ -27,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<Emplaceable> C;
         typedef C::iterator R;
@@ -44,6 +46,7 @@
         assert(c.size() == 3);
         assert(*r == Emplaceable(5, 6));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<Emplaceable, std::hash<Emplaceable>,
                       std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
@@ -62,4 +65,16 @@
         assert(c.size() == 3);
         assert(*r == Emplaceable(5, 6));
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multiset<Emplaceable> C;
+        typedef C::iterator R;
+        C c1;
+        C c2;
+        R r = c1.emplace_hint(c2.begin(), 5, 6);
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp
index ffe6534..f5026e1 100644
--- a/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/insert_hint_rvalue.pass.cpp
@@ -15,10 +15,13 @@
 
 // iterator insert(const_iterator p, value_type&& x);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
 #include <unordered_set>
 #include <cassert>
 
-#include "test_macros.h"
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
@@ -46,7 +49,7 @@
         assert(c.size() == 4);
         assert(*r == 5.5);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<MoveOnly> C;
         typedef C::iterator R;
@@ -69,6 +72,8 @@
         assert(c.size() == 4);
         assert(*r == 5);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<double, std::hash<double>,
                                 std::equal_to<double>, min_allocator<double>> C;
@@ -92,6 +97,7 @@
         assert(c.size() == 4);
         assert(*r == 5.5);
     }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
                             std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
@@ -115,5 +121,18 @@
         assert(c.size() == 4);
         assert(*r == 5);
     }
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_multiset<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        R r = c.insert(e, P(3.5));
+        assert(false);
+    }
+#endif
+#endif
 }
diff --git a/test/std/containers/unord/unord.multiset/insert_init.pass.cpp b/test/std/containers/unord/unord.multiset/insert_init.pass.cpp
index 88661b5..9010cac 100644
--- a/test/std/containers/unord/unord.multiset/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/insert_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int> C;
         typedef int P;
@@ -45,6 +44,7 @@
         assert(c.count(3) == 1);
         assert(c.count(4) == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int, std::hash<int>,
                                       std::equal_to<int>, min_allocator<int>> C;
@@ -66,4 +66,6 @@
         assert(c.count(3) == 1);
         assert(c.count(4) == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp
index 8939490..04f9e34 100644
--- a/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/insert_rvalue.pass.cpp
@@ -18,7 +18,6 @@
 #include <unordered_set>
 #include <cassert>
 
-#include "test_macros.h"
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
@@ -45,7 +44,7 @@
         assert(c.size() == 4);
         assert(*r == 5.5);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<MoveOnly> C;
         typedef C::iterator R;
@@ -67,6 +66,8 @@
         assert(c.size() == 4);
         assert(*r == 5);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<double, std::hash<double>,
                                 std::equal_to<double>, min_allocator<double>> C;
@@ -89,6 +90,7 @@
         assert(c.size() == 4);
         assert(*r == 5.5);
     }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
                             std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
@@ -111,5 +113,6 @@
         assert(c.size() == 4);
         assert(*r == 5);
     }
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
index ce66403..3e42305 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -29,6 +27,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef test_allocator<int> A;
         typedef std::unordered_multiset<int,
@@ -61,6 +60,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<int> A;
         typedef std::unordered_multiset<int,
@@ -93,4 +93,6 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
index dfcb63e..658bb93 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -30,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef test_allocator<int> A;
         typedef std::unordered_multiset<int,
@@ -173,6 +172,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef test_allocator<int> A;
         typedef std::unordered_multiset<int,
@@ -263,4 +263,18 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_multiset<int> s1 = {1, 2, 3};
+        std::unordered_multiset<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_multiset<int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
index df49abe..ced52b5 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -30,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -60,6 +59,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -159,5 +159,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
-#endif // TEST_STD_VER > 11
+#endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
index b835079..845139f 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -63,6 +62,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -95,4 +95,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
index 92edfc3..4dc78bd 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -65,6 +64,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -98,4 +98,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
index 877306d..f331208 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -66,6 +65,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -100,4 +100,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
index e77be84..17f064f 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -67,6 +66,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_multiset<int,
                                    test_hash<std::hash<int> >,
@@ -102,4 +102,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
index fb144d9..bc804b4 100644
--- a/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef int P;
         typedef test_allocator<int> A;
@@ -121,6 +120,7 @@
 
         assert(c0.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef int P;
         typedef min_allocator<int> A;
@@ -203,4 +203,6 @@
 
         assert(c0.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.set/emplace.pass.cpp b/test/std/containers/unord/unord.set/emplace.pass.cpp
index c09ad15..19af806 100644
--- a/test/std/containers/unord/unord.set/emplace.pass.cpp
+++ b/test/std/containers/unord/unord.set/emplace.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<Emplaceable> C;
         typedef std::pair<C::iterator, bool> R;
@@ -45,6 +44,7 @@
         assert(*r.first == Emplaceable(5, 6));
         assert(!r.second);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
                       std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
@@ -65,4 +65,6 @@
         assert(*r.first == Emplaceable(5, 6));
         assert(!r.second);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.set/emplace_hint.pass.cpp b/test/std/containers/unord/unord.set/emplace_hint.pass.cpp
index 16f9eff..97f3591 100644
--- a/test/std/containers/unord/unord.set/emplace_hint.pass.cpp
+++ b/test/std/containers/unord/unord.set/emplace_hint.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -18,6 +16,9 @@
 // template <class... Args>
 //     iterator emplace_hint(const_iterator p, Args&&... args);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
 
 #include <unordered_set>
 #include <cassert>
@@ -27,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<Emplaceable> C;
         typedef C::iterator R;
@@ -44,6 +46,7 @@
         assert(c.size() == 2);
         assert(*r == Emplaceable(5, 6));
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<Emplaceable, std::hash<Emplaceable>,
                       std::equal_to<Emplaceable>, min_allocator<Emplaceable>> C;
@@ -62,4 +65,16 @@
         assert(c.size() == 2);
         assert(*r == Emplaceable(5, 6));
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_set<Emplaceable> C;
+        typedef C::iterator R;
+        C c1;
+        C c2;
+        R r = c1.emplace_hint(c2.begin(), 5, 6);
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp
index 676c395..da94bc5 100644
--- a/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.set/insert_hint_rvalue.pass.cpp
@@ -15,10 +15,13 @@
 
 // iterator insert(const_iterator p, value_type&& x);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
+
 #include <unordered_set>
 #include <cassert>
 
-#include "test_macros.h"
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
@@ -46,7 +49,7 @@
         assert(c.size() == 3);
         assert(*r == 5.5);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<MoveOnly> C;
         typedef C::iterator R;
@@ -69,6 +72,8 @@
         assert(c.size() == 3);
         assert(*r == 5);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<double, std::hash<double>,
                                 std::equal_to<double>, min_allocator<double>> C;
@@ -92,6 +97,7 @@
         assert(c.size() == 3);
         assert(*r == 5.5);
     }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
                             std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
@@ -115,5 +121,18 @@
         assert(c.size() == 3);
         assert(*r == 5);
     }
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if _LIBCPP_DEBUG >= 1
+    {
+        typedef std::unordered_set<double> C;
+        typedef C::iterator R;
+        typedef C::value_type P;
+        C c;
+        C c2;
+        C::const_iterator e = c2.end();
+        R r = c.insert(e, P(3.5));
+        assert(false);
+    }
+#endif
+#endif
 }
diff --git a/test/std/containers/unord/unord.set/insert_init.pass.cpp b/test/std/containers/unord/unord.set/insert_init.pass.cpp
index c106fed..27b7290 100644
--- a/test/std/containers/unord/unord.set/insert_init.pass.cpp
+++ b/test/std/containers/unord/unord.set/insert_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_set<int> C;
         typedef int P;
@@ -45,6 +44,7 @@
         assert(c.count(3) == 1);
         assert(c.count(4) == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int, std::hash<int>,
                                       std::equal_to<int>, min_allocator<int>> C;
@@ -66,4 +66,6 @@
         assert(c.count(3) == 1);
         assert(c.count(4) == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp b/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp
index 45b168d..5d12f22 100644
--- a/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp
+++ b/test/std/containers/unord/unord.set/insert_rvalue.pass.cpp
@@ -18,7 +18,6 @@
 #include <unordered_set>
 #include <cassert>
 
-#include "test_macros.h"
 #include "MoveOnly.h"
 #include "min_allocator.h"
 
@@ -49,7 +48,7 @@
         assert(*r.first == 5.5);
         assert(r.second);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<MoveOnly> C;
         typedef std::pair<C::iterator, bool> R;
@@ -75,6 +74,8 @@
         assert(*r.first == 5);
         assert(r.second);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<double, std::hash<double>,
                                 std::equal_to<double>, min_allocator<double>> C;
@@ -101,6 +102,7 @@
         assert(*r.first == 5.5);
         assert(r.second);
     }
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
                             std::equal_to<MoveOnly>, min_allocator<MoveOnly>> C;
@@ -127,5 +129,6 @@
         assert(*r.first == 5);
         assert(r.second);
     }
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#endif
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
index 4f7ccfe..2db01a2 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -29,6 +27,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef test_allocator<int> A;
         typedef std::unordered_set<int,
@@ -61,6 +60,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<int> A;
         typedef std::unordered_set<int,
@@ -93,4 +93,6 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
index bc36582..78a3763 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/assign_move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -30,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef test_allocator<int> A;
         typedef std::unordered_set<int,
@@ -165,6 +164,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef min_allocator<int> A;
         typedef std::unordered_set<int,
@@ -210,4 +210,18 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::unordered_set<int> s1 = {1, 2, 3};
+        std::unordered_set<int>::iterator i = s1.begin();
+        int k = *i;
+        std::unordered_set<int> s2;
+        s2 = std::move(s1);
+        assert(*i == k);
+        s2.erase(i);
+        assert(s2.size() == 2);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
index 7ba340b..eea61c7 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -30,7 +28,8 @@
 
 int main()
 {
-  {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+    {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
                                    test_compare<std::equal_to<int> >,
@@ -60,6 +59,7 @@
         assert(fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -160,4 +160,6 @@
         assert(c.max_load_factor() == 1);
     }
 #endif
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
index 0ca9b48..95baa3d 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -31,6 +29,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -63,6 +62,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -95,4 +95,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
index 45ed588..108d67b 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -65,6 +64,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -98,4 +98,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
index 8ace22a..5cb4d49 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -66,6 +65,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -100,4 +100,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
index 4fd50a8..7c1cbc8 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/init_size_hash_equal_allocator.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -32,6 +30,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -67,6 +66,7 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::unordered_set<int,
                                    test_hash<std::hash<int> >,
@@ -102,4 +102,6 @@
         assert(std::fabs(c.load_factor() - (float)c.size()/c.bucket_count()) < FLT_EPSILON);
         assert(c.max_load_factor() == 1);
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
index bcd10b0..4d2830b 100644
--- a/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
+++ b/test/std/containers/unord/unord.set/unord.set.cnstr/move_alloc.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <unordered_set>
 
 // template <class Value, class Hash = hash<Value>, class Pred = equal_to<Value>,
@@ -30,6 +28,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         typedef int P;
         typedef test_allocator<int> A;
@@ -112,6 +111,7 @@
 
         assert(c0.empty());
     }
+#if TEST_STD_VER >= 11
     {
         typedef int P;
         typedef min_allocator<int> A;
@@ -153,4 +153,6 @@
 
         assert(c0.empty());
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp
deleted file mode 100644
index fc37c9a..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.cxx1z.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-// pointer_to_binary_function
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-double binary_f(int i, short j) {return i - j + .75;}
-
-int main()
-{
-    typedef std::pointer_to_binary_function<int, short, double> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp
index e47731a..41c9999 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_binary_function.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // pointer_to_binary_function
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp
deleted file mode 100644
index 687a819..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.cxx1z.fail.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-// pointer_to_unary_function
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-double unary_f(int i) {return 0.5 - i;}
-
-int main()
-{
-    typedef std::pointer_to_unary_function<int, double> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp
index 2d713b3..126cf32 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/pointer_to_unary_function.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // pointer_to_unary_function
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp
deleted file mode 100644
index 2d23219..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.cxx1z.fail.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template <CopyConstructible Arg, Returnable Result>
-// pointer_to_unary_function<Arg, Result>
-// ptr_fun(Result (*f)(Arg));
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-double unary_f(int i) {return 0.5 - i;}
-
-int main()
-{
-    assert(std::ptr_fun(unary_f)(36) == -35.5);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp
index 65f2a8d..c7ce90d 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun1.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <CopyConstructible Arg, Returnable Result>
 // pointer_to_unary_function<Arg, Result>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp
deleted file mode 100644
index 202abe2..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.cxx1z.fail.cpp
+++ /dev/null
@@ -1,28 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template <CopyConstructible Arg1, CopyConstructible Arg2, Returnable Result>
-// pointer_to_binary_function<Arg1,Arg2,Result>
-// ptr_fun(Result (*f)(Arg1, Arg2));
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-double binary_f(int i, short j) {return i - j + .75;}
-
-int main()
-{
-    assert(std::ptr_fun(binary_f)(36, 27) == 9.75);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp
index 5628c02..17c4b61 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.function.pointer.adaptors/ptr_fun2.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <CopyConstructible Arg1, CopyConstructible Arg2, Returnable Result>
 // pointer_to_binary_function<Arg1,Arg2,Result>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
deleted file mode 100644
index 1c56aa9..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<cReturnable S, ClassType T>
-//   const_mem_fun_t<S,T>
-//   mem_fun(S (T::*f)() const);
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    const A a = A();
-    assert(std::mem_fun(&A::a3)(&a) == 1);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp
index 4693c81..455eed9 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<cReturnable S, ClassType T>
 //   const_mem_fun_t<S,T>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp
deleted file mode 100644
index c727e95..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T, CopyConstructible A>
-//   const_mem_fun1_t<S,T,A>
-//   mem_fun(S (T::*f)(A) const);
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    const A a = A();
-    assert(std::mem_fun(&A::a4)(&a, 6) == 5);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp
index 9f0b605..46fd6d2 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T, CopyConstructible A>
 //   const_mem_fun1_t<S,T,A>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp
deleted file mode 100644
index 39b3112..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// const_mem_fun1_ref_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::const_mem_fun1_ref_t<double, A, unsigned> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
index 65fc8c0..0c4bb93 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_ref_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // const_mem_fun1_ref_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp
deleted file mode 100644
index f07a3b7..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// const_mem_fun1_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::const_mem_fun1_t<double, A, unsigned> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp
index 71588fa..ca670bc 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun1_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // const_mem_fun1_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp
deleted file mode 100644
index fea1441..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T>
-//   const_mem_fun_ref_t<S,T>
-//   mem_fun_ref(S (T::*f)() const);
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    const A a = A();
-    assert(std::mem_fun_ref(&A::a3)(a) == 1);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp
index 22f44c6..74d8950 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T>
 //   const_mem_fun_ref_t<S,T>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp
deleted file mode 100644
index f993b7c..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T, CopyConstructible A>
-//   const_mem_fun1_ref_t<S,T,A>
-//   mem_fun_ref(S (T::*f)(A) const);
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    const A a = A();
-    assert(std::mem_fun_ref(&A::a4)(a, 6) == 5);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
index 267b806..b858561 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref1.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T, CopyConstructible A>
 //   const_mem_fun1_ref_t<S,T,A>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp
deleted file mode 100644
index e195213..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// const_mem_fun_ref_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::const_mem_fun_ref_t<int, A> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
index 6f80993..9eec24e 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_ref_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // const_mem_fun_ref_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp
deleted file mode 100644
index 228eb3d..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// const_mem_fun_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::const_mem_fun_t<int, A> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp
index 01945fc..9681b74 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // const_mem_fun_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp
deleted file mode 100644
index 8f59a1a..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T>
-//   mem_fun_t<S,T>
-//   mem_fun(S (T::*f)());
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    A a;
-    assert(std::mem_fun(&A::a1)(&a) == 5);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp
index f3c1297..d0d2860 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T>
 //   mem_fun_t<S,T>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp
deleted file mode 100644
index 6191de3..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T, CopyConstructible A>
-//   mem_fun1_t<S,T,A>
-//   mem_fun(S (T::*f)(A));
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    A a;
-    assert(std::mem_fun(&A::a2)(&a, 5) == 6);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp
index 30f3c94..acee9af 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T, CopyConstructible A>
 //   mem_fun1_t<S,T,A>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp
deleted file mode 100644
index 0effd33..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// mem_fun1_ref_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::mem_fun1_ref_t<short, A, int> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
index 0b63bb7..a78cbf2 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_ref_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // mem_fun1_ref_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp
deleted file mode 100644
index aa8e25a..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// mem_fun1_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::mem_fun1_t<short, A, int> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp
index 79895c4..90ba9bb 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun1_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // mem_fun1_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp
deleted file mode 100644
index ff7f28a..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T>
-//   mem_fun_ref_t<S,T>
-//   mem_fun_ref(S (T::*f)());
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    A a;
-    assert(std::mem_fun_ref(&A::a1)(a) == 5);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp
index 8a6a8b9..d3843fc 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T>
 //   mem_fun_ref_t<S,T>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp
deleted file mode 100644
index 82d47fe..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.cxx1z.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// template<Returnable S, ClassType T, CopyConstructible A>
-//   mem_fun1_ref_t<S,T,A>
-//   mem_fun_ref(S (T::*f)(A));
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    A a;
-    assert(std::mem_fun_ref(&A::a2)(a, 5) == 6);
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp
index 142b16a..39a324d 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref1.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template<Returnable S, ClassType T, CopyConstructible A>
 //   mem_fun1_ref_t<S,T,A>
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp
deleted file mode 100644
index f1cf01c..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// mem_fun_ref_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::mem_fun_ref_t<char, A> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp
index 5af028b..236d8d0 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_ref_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // mem_fun_ref_t
 
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp
deleted file mode 100644
index e6a1ed3..0000000
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.cxx1z.fail.cpp
+++ /dev/null
@@ -1,33 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <functional>
-
-// mem_fun_t
-// Removed in c++1z
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-#include <functional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A
-{
-    char a1() {return 5;}
-    short a2(int i) {return short(i+1);}
-    int a3() const {return 1;}
-    double a4(unsigned i) const {return i-1;}
-};
-
-int main()
-{
-    typedef std::mem_fun_t<char, A> F;
-}
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp
index c33e2f7..3fc84cd 100644
--- a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/mem_fun_t.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // mem_fun_t
 
diff --git a/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp b/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp
index 796e4ad..b6b7526 100644
--- a/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp
+++ b/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <class Fn, class T>
 //   binder1st<Fn>
diff --git a/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp b/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp
index cbf1dbf..b7feb24 100644
--- a/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp
+++ b/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <class Fn, class T>
 //   binder2nd<Fn>
diff --git a/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp b/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp
index 480148b..8b7aaf0 100644
--- a/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp
+++ b/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <class Fn>
 // class binder1st
diff --git a/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp b/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp
index 3dfb1f0..645c168 100644
--- a/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp
+++ b/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.pass.cpp
@@ -8,7 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // <functional>
-// REQUIRES: c++98 || c++03 || c++11 || c++14
 
 // template <class Fn>
 // class binder2nd
diff --git a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp
index c829a97..dda19a9 100644
--- a/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp
+++ b/test/std/depr/depr.str.strstreams/depr.strstreambuf/depr.strstreambuf.members/overflow.pass.cpp
@@ -9,10 +9,6 @@
 
 // <strstream>
 
-// There was an overflow in the dylib on older macOS versions
-// UNSUPPORTED: availability=macosx10.8
-// UNSUPPORTED: availability=macosx10.7
-
 // class strstreambuf
 
 // int overflow(int c);
diff --git a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
index 0783de8..65ecc49 100644
--- a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/generic_category.pass.cpp
@@ -7,13 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <system_error>
 
 // class error_category
@@ -31,7 +24,7 @@
     errno = E2BIG; // something that message will never generate
     const std::error_category& e_cat1 = std::generic_category();
     const std::string msg = e_cat1.message(-1);
-    LIBCPP_ASSERT(msg == "Unknown error -1" || msg == "Unknown error");
+    LIBCPP_ASSERT(msg == "Unknown error -1");
     assert(errno == E2BIG);
 }
 
diff --git a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
index 8cccb02..d1a9488 100644
--- a/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.errcat/syserr.errcat.objects/system_category.pass.cpp
@@ -13,13 +13,6 @@
 
 // const error_category& system_category();
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 #include <system_error>
 #include <cassert>
 #include <string>
@@ -31,7 +24,7 @@
     errno = E2BIG; // something that message will never generate
     const std::error_category& e_cat1 = std::system_category();
     const std::string msg = e_cat1.message(-1);
-    LIBCPP_ASSERT(msg == "Unknown error -1" || msg == "Unknown error");
+    LIBCPP_ASSERT(msg == "Unknown error -1");
     assert(errno == E2BIG);
 }
 
diff --git a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
index dac13bd..4091f44 100644
--- a/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.hash/error_code.pass.cpp
@@ -29,7 +29,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<H::argument_type, T>::value), "" );
     static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     H h;
     T ec(i, std::system_category());
     const std::size_t result = h(ec);
diff --git a/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp b/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
index eef37c6..d455210 100644
--- a/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
+++ b/test/std/diagnostics/syserr/syserr.hash/error_condition.pass.cpp
@@ -29,7 +29,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<H::argument_type, T>::value), "" );
     static_assert((std::is_same<H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     H h;
     T ec(i, std::system_category());
     const std::size_t result = h(ec);
diff --git a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
index 7140fab..17b01fe 100644
--- a/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/copy.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any& operator=(any const &);
diff --git a/test/std/experimental/any/any.class/any.assign/move.pass.cpp b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
index 35fc56c..49508fe 100644
--- a/test/std/experimental/any/any.class/any.assign/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/move.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any& operator=(any &&);
diff --git a/test/std/experimental/any/any.class/any.assign/value.pass.cpp b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
index 8ff4ad5..b42a4ba 100644
--- a/test/std/experimental/any/any.class/any.assign/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.assign/value.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any& operator=(any const &);
@@ -181,4 +174,4 @@
     test_assign_throws<small_throws_on_copy>();
     test_assign_throws<large_throws_on_copy>();
     test_assign_throws<throws_on_move, /* Move = */ true>();
-}
+}
\ No newline at end of file
diff --git a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
index 47f12d7..69341ca 100644
--- a/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/copy.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any(any const &);
diff --git a/test/std/experimental/any/any.class/any.cons/move.pass.cpp b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
index c5395da..2a05094 100644
--- a/test/std/experimental/any/any.class/any.cons/move.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/move.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any(any &&) noexcept;
diff --git a/test/std/experimental/any/any.class/any.cons/value.pass.cpp b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
index fcace50..a3ab0ed 100644
--- a/test/std/experimental/any/any.class/any.cons/value.pass.cpp
+++ b/test/std/experimental/any/any.class/any.cons/value.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // template <class Value> any(Value &&)
@@ -120,4 +113,4 @@
     test_copy_value_throws<small_throws_on_copy>();
     test_copy_value_throws<large_throws_on_copy>();
     test_move_value_throws();
-}
+}
\ No newline at end of file
diff --git a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
index 1b0b75d..781ed73 100644
--- a/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/clear.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any::clear() noexcept
diff --git a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
index 9f499b4..b1d3154 100644
--- a/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
+++ b/test/std/experimental/any/any.class/any.modifiers/swap.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <experimental/any>
 
 // any::swap(any &) noexcept
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index ca6d1de..47fe52f 100644
--- a/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/test/std/experimental/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -9,8 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11
 
-// XFAIL: availability=macosx
-
 // <experimental/any>
 
 // template <class ValueType>
diff --git a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
index 1c52a64..c6cc68d 100644
--- a/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
+++ b/test/std/experimental/any/any.nonmembers/any.cast/not_copy_constructible.fail.cpp
@@ -42,4 +42,4 @@
     any_cast<no_copy>(static_cast<any &&>(a));
     // expected-error@experimental/any:* 3 {{static_assert failed "_ValueType is required to be a reference or a CopyConstructible type."}}
     // expected-error@experimental/any:* 3 {{calling a private constructor of class 'no_copy'}}
-}
+}
\ No newline at end of file
diff --git a/test/std/experimental/any/any.nonmembers/swap.pass.cpp b/test/std/experimental/any/any.nonmembers/swap.pass.cpp
index e79bc9e..a3fbd43 100644
--- a/test/std/experimental/any/any.nonmembers/swap.pass.cpp
+++ b/test/std/experimental/any/any.nonmembers/swap.pass.cpp
@@ -34,8 +34,7 @@
 
         swap(a1, a2);
 
-        // Support testing against system dylibs that don't have bad_any_cast.
-        assert(*any_cast<int>(&a1) == 2);
-        assert(*any_cast<int>(&a2) == 1);
+        assert(any_cast<int>(a1) == 2);
+        assert(any_cast<int>(a2) == 1);
     }
 }
diff --git a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp b/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
index 078e006..4c83481 100644
--- a/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
+++ b/test/std/experimental/filesystem/class.path/path.member/path.decompose/path.decompose.pass.cpp
@@ -54,6 +54,12 @@
 #include "count_new.hpp"
 #include "filesystem_test_helper.hpp"
 
+template <class It>
+std::reverse_iterator<It> mkRev(It it) {
+  return std::reverse_iterator<It>(it);
+}
+
+
 namespace fs = std::experimental::filesystem;
 struct PathDecomposeTestcase
 {
@@ -141,11 +147,7 @@
     assert(checkCollectionsEqual(p.begin(), p.end(),
                                  TC.elements.begin(), TC.elements.end()));
     // check backwards
-
-    std::vector<fs::path> Parts;
-    for (auto it = p.end(); it != p.begin(); )
-      Parts.push_back(*--it);
-    assert(checkCollectionsEqual(Parts.begin(), Parts.end(),
+    assert(checkCollectionsEqual(mkRev(p.end()), mkRev(p.begin()),
                                  TC.elements.rbegin(), TC.elements.rend()));
   }
 }
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp
deleted file mode 100644
index 30081fc..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.capacity/operator_bool.pass.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr explicit operator bool() const noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
-  static_assert(std::is_nothrow_constructible<bool, C>::value, "");
-  static_assert(!std::is_convertible<C, bool>::value, "");
-  {
-    constexpr C c; ((void)c);
-    static_assert(bool(c) == false, "");
-  }
-  { // null case
-    const C c = {}; ((void)c);
-    ASSERT_NOEXCEPT(bool(c));
-    if (c)
-      assert(false);
-    else
-      assert(true);
-    assert(c.address() == nullptr);
-    assert(bool(c) == false);
-  }
-  { // non-null case
-    char dummy = 42;
-    C c = C::from_address((void*)&dummy);
-    assert(c.address() == &dummy);
-    assert(bool(c) == true);
-  }
-}
-
-int main()
-{
-  do_test<coro::coroutine_handle<>>();
-  do_test<coro::coroutine_handle<int>>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp
deleted file mode 100644
index 278ea9d..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/equal_comp.pass.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool operator==(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator!=(coroutine_handle<>, coroutine_handle<>) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
-  const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
-  const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
-  const bool ExpectIsEqual = (LHSVal == RHSVal);
-  assert((LHS == RHS) == ExpectIsEqual);
-  assert((RHS == LHS) == ExpectIsEqual);
-  assert((LHS != RHS) == !ExpectIsEqual);
-  assert((RHS != LHS) == !ExpectIsEqual);
-  {
-    static_assert(noexcept(LHS == RHS), "");
-    static_assert(noexcept(LHS != RHS), "");
-    ASSERT_SAME_TYPE(decltype(LHS == RHS), bool);
-    ASSERT_SAME_TYPE(decltype(LHS != RHS), bool);
-  }
-}
-
-int main()
-{
-  std::pair<uintptr_t, uintptr_t> const TestCases[] = {
-      {0, 0},
-      {16, 16},
-      {0, 16},
-      {16, 0}
-  };
-  for (auto& TC : TestCases) {
-    do_test<coro::coroutine_handle<>>(TC.first, TC.second);
-    do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp
deleted file mode 100644
index e92adf0..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.compare/less_comp.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool operator<(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator>(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator>=(coroutine_handle<>, coroutine_handle<>) noexcept
-// bool operator<=(coroutine_handle<>, coroutine_handle<>) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
-  const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
-  const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
-  assert((LHS < RHS) == (LHSVal < RHSVal));
-  assert((RHS < LHS) == (RHSVal < LHSVal));
-  assert((LHS > RHS) == (LHSVal > RHSVal));
-  assert((RHS > LHS) == (RHSVal > LHSVal));
-  assert((LHS <= RHS) == (LHSVal <= RHSVal));
-  assert((RHS <= LHS) == (RHSVal <= LHSVal));
-  assert((LHS >= RHS) == (LHSVal >= RHSVal));
-  assert((RHS >= LHS) == (RHSVal >= LHSVal));
-  {
-    static_assert(noexcept(LHS < RHS), "");
-    static_assert(noexcept(LHS > RHS), "");
-    static_assert(noexcept(LHS <= RHS), "");
-    static_assert(noexcept(LHS >= RHS), "");
-    ASSERT_SAME_TYPE(decltype(LHS < RHS), bool);
-    ASSERT_SAME_TYPE(decltype(LHS > RHS), bool);
-    ASSERT_SAME_TYPE(decltype(LHS <= RHS), bool);
-    ASSERT_SAME_TYPE(decltype(LHS >= RHS), bool);
-  }
-}
-
-int main()
-{
-  std::pair<uintptr_t, uintptr_t> const TestCases[] = {
-      {0, 0},
-      {16, 16},
-      {0, 16},
-      {16, 0}
-  };
-  for (auto& TC : TestCases) {
-    do_test<coro::coroutine_handle<>>(TC.first, TC.second);
-    do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
deleted file mode 100644
index 240d932..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.completion/done.pass.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// bool done() const
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise> const& H) {
-  // FIXME Add a runtime test
-  {
-    ASSERT_SAME_TYPE(decltype(H.done()), bool);
-    LIBCPP_ASSERT_NOT_NOEXCEPT(H.done());
-  }
-}
-
-int main()
-{
-  do_test(coro::coroutine_handle<>{});
-  do_test(coro::coroutine_handle<int>{});
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp
deleted file mode 100644
index 0cd3d05..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/assign.pass.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// coroutine_handle& operator=(nullptr_t) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
-  int dummy = 42;
-  void* dummy_h = &dummy;
-  {
-    C c; ((void)c);
-    static_assert(std::is_nothrow_assignable<C&, std::nullptr_t>::value, "");
-    static_assert(!std::is_assignable<C&, void*>::value, "");
-  }
-  {
-    C c = C::from_address(dummy_h);
-    assert(c.address() == &dummy);
-    c = nullptr;
-    assert(c.address() == nullptr);
-    c = nullptr;
-    assert(c.address() == nullptr);
-  }
-  {
-    C c;
-    C& cr = (c = nullptr);
-    assert(&c == &cr);
-  }
-}
-
-int main()
-{
-  do_test<coro::coroutine_handle<>>();
-  do_test<coro::coroutine_handle<int>>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp
deleted file mode 100644
index be5174d..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.con/construct.pass.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr coroutine_handle() noexcept
-// constexpr coroutine_handle(nullptr_t) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
-  {
-    constexpr C c;
-    static_assert(std::is_nothrow_default_constructible<C>::value, "");
-    static_assert(c.address() == nullptr, "");
-  }
-  {
-    constexpr C c(nullptr);
-    static_assert(std::is_nothrow_constructible<C, std::nullptr_t>::value, "");
-    static_assert(c.address() == nullptr, "");
-  }
-  {
-    C c;
-    assert(c.address() == nullptr);
-  }
-  {
-    C c(nullptr);
-    assert(c.address() == nullptr);
-  }
-}
-
-int main()
-{
-  do_test<coro::coroutine_handle<>>();
-  do_test<coro::coroutine_handle<int>>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp
deleted file mode 100644
index aba5eb6..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/address.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// constexpr void* address() const noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
-  {
-    constexpr C c; ((void)c);
-    static_assert(c.address() == nullptr, "");
-  }
-  {
-    const C c = {}; ((void)c);
-    ASSERT_NOEXCEPT(c.address());
-    ASSERT_SAME_TYPE(decltype(c.address()), void*);
-    assert(c.address() == nullptr);
-  }
-  {
-    char dummy = 42;
-    C c = C::from_address((void*)&dummy);
-    assert(c.address() == &dummy);
-  }
-}
-
-int main()
-{
-  do_test<coro::coroutine_handle<>>();
-  do_test<coro::coroutine_handle<int>>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
deleted file mode 100644
index 1c87b94..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.fail.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// static coroutine_handle from_address(void*) noexcept
-
-// Test that `from_address` is explicitly ill-formed when called with a typed
-// pointer. The user cannot possibly have a typed pointer to the coroutine.
-// FIXME: This behavior is an extension, and should upstreamed into the TS or
-// the test removed if the TS changes are rejected.
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-namespace coro = std::experimental;
-
-int main()
-{
-  {
-    using H = coro::coroutine_handle<>;
-    // expected-error@experimental/coroutine:* 3 {{coroutine_handle<void>::from_address cannot be called with non-void pointers}}
-    H::from_address((int*)nullptr); // expected-note {{requested here}}
-    H::from_address((const void*)nullptr); // expected-note {{requested here}}
-    H::from_address((const char*)nullptr); // expected-note {{requested here}}
-  }
-  {
-    using H = coro::coroutine_handle<int>;
-    // expected-error@experimental/coroutine:* 1 {{static_assert failed "coroutine_handle<promise_type>::from_address cannot be used with pointers to the coroutine's promise type; use 'from_promise' instead"}}
-    H::from_address((const char*)nullptr); // expected-note {{requested here}}
-    // expected-error@experimental/coroutine:* 1 {{coroutine_handle<promise_type>::from_address cannot be called with non-void pointers}}
-    H::from_address((int*)nullptr); // expected-note {{requested here}}
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp
deleted file mode 100644
index 636d5da..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.export/from_address.pass.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// static coroutine_handle from_address(void*) noexcept
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test() {
-  {
-    C c = C::from_address(nullptr);
-    static_assert(noexcept(C::from_address(nullptr)), "");
-    // FIXME: Should the return type not be 'C'?
-    static_assert(std::is_same<decltype(C::from_address(nullptr)), C>::value, "");
-    assert(c.address() == nullptr);
-  }
-  {
-    char dummy = 42;
-    C c = C::from_address((void*)&dummy);
-    assert(c.address() == &dummy);
-  }
-}
-
-int main()
-{
-  do_test<coro::coroutine_handle<>>();
-  do_test<coro::coroutine_handle<int>>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
deleted file mode 100644
index 3422329..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.hash/hash.pass.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// namespace std {
-//  template <class P> struct hash<experimental::coroutine_handle<P>>;
-// }
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class C>
-void do_test(uintptr_t LHSVal, uintptr_t RHSVal) {
-  const size_t ExpectLHS = std::hash<void*>{}(reinterpret_cast<void*>(LHSVal));
-  const size_t ExpectRHS = std::hash<void*>{}(reinterpret_cast<void*>(RHSVal));
-  const C LHS = C::from_address(reinterpret_cast<void*>(LHSVal));
-  const C RHS = C::from_address(reinterpret_cast<void*>(RHSVal));
-  const std::hash<C> h;
-  // FIXME: libc++'s implementation hash's the result of LHS.address(), so we
-  // expect that value. However this is not required.
-  assert(h(LHS) == ExpectLHS);
-  assert(h(RHS) == ExpectRHS);
-  assert((h(LHS) == h(RHS)) == (LHSVal == RHSVal));
-  {
-    ASSERT_SAME_TYPE(decltype(h(LHS)), size_t);
-    ASSERT_NOEXCEPT(std::hash<C>{}(LHS));
-  }
-}
-
-int main()
-{
-  std::pair<uintptr_t, uintptr_t> const TestCases[] = {
-      {0, 0},
-      {0, 8},
-      {8, 8},
-      {8, 16}
-  };
-  for (auto& TC : TestCases) {
-    do_test<coro::coroutine_handle<>>(TC.first, TC.second);
-    do_test<coro::coroutine_handle<int>>(TC.first, TC.second);
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
deleted file mode 100644
index 4a61047..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.prom/promise.pass.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise>
-// struct coroutine_handle<Promise>;
-
-// Promise& promise() const
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
-
-  // FIXME Add a runtime test
-  {
-    ASSERT_SAME_TYPE(decltype(H.promise()), Promise&);
-    LIBCPP_ASSERT_NOT_NOEXCEPT(H.promise());
-  }
-  {
-    auto const& CH = H;
-    ASSERT_SAME_TYPE(decltype(CH.promise()), Promise&);
-    LIBCPP_ASSERT_NOT_NOEXCEPT(CH.promise());
-  }
-}
-
-int main()
-{
-  do_test(coro::coroutine_handle<int>{});
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
deleted file mode 100644
index df3337c..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/destroy.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// void destroy()
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-template <class H>
-auto has_destroy_imp(H&& h, int) -> decltype(h.destroy(), std::true_type{});
-template <class H>
-auto has_destroy_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_destroy() {
-  return decltype(has_destroy_imp(std::declval<H>(), 0))::value;
-}
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
-  using HType = coro::coroutine_handle<Promise>;
-  // FIXME Add a runtime test
-  {
-    ASSERT_SAME_TYPE(decltype(H.destroy()), void);
-    LIBCPP_ASSERT_NOT_NOEXCEPT(H.destroy());
-    static_assert(has_destroy<HType&>(), "");
-    static_assert(has_destroy<HType&&>(), "");
-  }
-  {
-    static_assert(!has_destroy<HType const&>(), "");
-    static_assert(!has_destroy<HType const&&>(), "");
-  }
-}
-
-int main()
-{
-  do_test(coro::coroutine_handle<>{});
-  do_test(coro::coroutine_handle<int>{});
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
deleted file mode 100644
index 21c05e2..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/coroutine.handle.resumption/resume.pass.cpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// template <class Promise = void>
-// struct coroutine_handle;
-
-// void operator()()
-// void resume()
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <memory>
-#include <utility>
-#include <cstdint>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-
-template <class H>
-auto has_resume_imp(H&& h, int) -> decltype(h.resume(), std::true_type{});
-template <class H>
-auto has_resume_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_resume() {
-  return decltype(has_resume_imp(std::declval<H>(), 0))::value;
-}
-
-
-template <class H>
-auto has_call_operator_imp(H&& h, int) -> decltype(h(), std::true_type{});
-template <class H>
-auto has_call_operator_imp(H&&, long) -> std::false_type;
-
-template <class H>
-constexpr bool has_call_operator() {
-  return decltype(has_call_operator_imp(std::declval<H>(), 0))::value;
-}
-
-template <class Promise>
-void do_test(coro::coroutine_handle<Promise>&& H) {
-  using HType = coro::coroutine_handle<Promise>;
-  // FIXME Add a runtime test
-  {
-    ASSERT_SAME_TYPE(decltype(H.resume()), void);
-    ASSERT_SAME_TYPE(decltype(H()), void);
-    LIBCPP_ASSERT_NOT_NOEXCEPT(H.resume());
-    LIBCPP_ASSERT_NOT_NOEXCEPT(H());
-    static_assert(has_resume<HType&>(), "");
-    static_assert(has_resume<HType&&>(), "");
-    static_assert(has_call_operator<HType&>(), "");
-    static_assert(has_call_operator<HType&&>(), "");
-  }
-  {
-    static_assert(!has_resume<HType const&>(), "");
-    static_assert(!has_resume<HType const&&>(), "");
-    static_assert(!has_call_operator<HType const&>(), "");
-    static_assert(!has_call_operator<HType const&&>(), "");
-  }
-}
-
-int main()
-{
-  do_test(coro::coroutine_handle<>{});
-  do_test(coro::coroutine_handle<int>{});
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp
deleted file mode 100644
index 844d34c..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.handle/void_handle.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-
-namespace coro = std::experimental;
-
-struct A {
-  using promise_type = A*;
-};
-
-struct B {};
-struct C {};
-
-namespace std { namespace experimental {
-  template <>
-  struct coroutine_traits<::A, int> {
-    using promise_type = int*;
-  };
-  template <class ...Args>
-  struct coroutine_traits<::B, Args...> {
-    using promise_type = B*;
-  };
-  template <>
-  struct coroutine_traits<::C> {
-    using promise_type = void;
-  };
-}}
-
-template <class Expect, class T, class ...Args>
-void check_type() {
-  using P = typename coro::coroutine_traits<T, Args...>::promise_type ;
-  static_assert(std::is_same<P, Expect>::value, "");
-};
-
-int main()
-{
-  check_type<A*, A>();
-  check_type<int*, A, int>();
-  check_type<B*, B>();
-  check_type<void, C>();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp
deleted file mode 100644
index e26f333..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.traits/promise_type.pass.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-
-namespace coro = std::experimental;
-
-template <class T, class = typename T::promise_type>
-constexpr bool has_promise_type(int) { return true; }
-template <class>
-constexpr bool has_promise_type(long) { return false; }
-template <class T>
-constexpr bool has_promise_type() { return has_promise_type<T>(0); }
-
-struct A {
-  using promise_type = A*;
-};
-
-struct B {};
-struct C {};
-struct D {
-private:
-  using promise_type = void;
-};
-struct E {};
-
-namespace std { namespace experimental {
-  template <>
-  struct coroutine_traits<::A, int> {
-    using promise_type = int*;
-  };
-  template <class ...Args>
-  struct coroutine_traits<::B, Args...> {
-    using promise_type = B*;
-  };
-  template <>
-  struct coroutine_traits<::C> {
-    using promise_type = void;
-  };
-}}
-
-template <class Expect, class T, class ...Args>
-void check_type() {
-  using Traits = coro::coroutine_traits<T, Args...>;
-  static_assert(has_promise_type<Traits>(), "");
-  static_assert(std::is_same<typename Traits::promise_type, Expect>::value, "");
-}
-
-template <class T, class ...Args>
-void check_no_type() {
-  using Traits = coro::coroutine_traits<T, Args...>;
-  static_assert(!has_promise_type<Traits>(), "");
-}
-
-int main()
-{
-  {
-    check_type<A*, A>();
-    check_type<int*, A, int>();
-    check_type<B*, B>();
-    check_type<void, C>();
-  }
-  {
-    check_no_type<D>();
-    check_no_type<E>();
-    check_no_type<C, int>();
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
deleted file mode 100644
index b10e720..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_always.pass.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-using SuspendT = std::experimental::coroutines_v1::suspend_always;
-
-TEST_SAFE_STATIC SuspendT safe_sa;
-constexpr SuspendT constexpr_sa;
-
-constexpr bool check_suspend_constexpr() {
-  SuspendT s{};
-  const SuspendT scopy(s); ((void)scopy);
-  SuspendT smove(std::move(s)); ((void)smove);
-  s = scopy;
-  s = std::move(smove);
-  return true;
-}
-
-int main()
-{
-  using H = coro::coroutine_handle<>;
-  using S = SuspendT;
-  H h{};
-  S s{};
-  S const& cs = s;
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_ready()), "");
-    static_assert(std::is_same<decltype(s.await_ready()), bool>::value, "");
-    assert(s.await_ready() == false);
-    assert(cs.await_ready() == false);
-  }
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_suspend(h)), "");
-    static_assert(std::is_same<decltype(s.await_suspend(h)), void>::value, "");
-    s.await_suspend(h);
-    cs.await_suspend(h);
-  }
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_resume()), "");
-    static_assert(std::is_same<decltype(s.await_resume()), void>::value, "");
-    s.await_resume();
-    cs.await_resume();
-  }
-  {
-    static_assert(std::is_nothrow_default_constructible<S>::value, "");
-    static_assert(std::is_nothrow_copy_constructible<S>::value, "");
-    static_assert(std::is_nothrow_move_constructible<S>::value, "");
-    static_assert(std::is_nothrow_copy_assignable<S>::value, "");
-    static_assert(std::is_nothrow_move_assignable<S>::value, "");
-    static_assert(std::is_trivially_copyable<S>::value, "");
-    static_assert(check_suspend_constexpr(), "");
-  }
-  {
-    // suppress unused warnings for the global constexpr test variable
-    ((void)constexpr_sa);
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp b/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
deleted file mode 100644
index 9c2f392..0000000
--- a/test/std/experimental/language.support/support.coroutines/coroutine.trivial.awaitables/suspend_never.pass.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-namespace coro = std::experimental;
-
-// Test that the type is in the correct namespace
-using SuspendT = std::experimental::coroutines_v1::suspend_never;
-
-TEST_SAFE_STATIC SuspendT safe_sn;
-constexpr SuspendT constexpr_sn;
-
-constexpr bool check_suspend_constexpr() {
-  SuspendT s{};
-  const SuspendT scopy(s); ((void)scopy);
-  SuspendT smove(std::move(s)); ((void)smove);
-  s = scopy;
-  s = std::move(smove);
-  return true;
-}
-
-
-int main()
-{
-  using H = coro::coroutine_handle<>;
-  using S = SuspendT;
-  H h{};
-  S s{};
-  S const& cs = s;
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_ready()), "");
-    static_assert(std::is_same<decltype(s.await_ready()), bool>::value, "");
-    assert(s.await_ready() == true);
-    assert(cs.await_ready() == true);
-  }
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_suspend(h)), "");
-    static_assert(std::is_same<decltype(s.await_suspend(h)), void>::value, "");
-    s.await_suspend(h);
-    cs.await_suspend(h);
-  }
-  {
-    LIBCPP_STATIC_ASSERT(noexcept(s.await_resume()), "");
-    static_assert(std::is_same<decltype(s.await_resume()), void>::value, "");
-    s.await_resume();
-    cs.await_resume();
-  }
-  {
-    static_assert(std::is_nothrow_default_constructible<S>::value, "");
-    static_assert(std::is_nothrow_copy_constructible<S>::value, "");
-    static_assert(std::is_nothrow_move_constructible<S>::value, "");
-    static_assert(std::is_nothrow_copy_assignable<S>::value, "");
-    static_assert(std::is_nothrow_move_assignable<S>::value, "");
-    static_assert(std::is_trivially_copyable<S>::value, "");
-    static_assert(check_suspend_constexpr(), "");
-  }
-  {
-    // suppress unused warnings for the global constexpr test variable
-    ((void)constexpr_sn);
-  }
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
deleted file mode 100644
index b860631..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/await_result.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <cassert>
-
-using namespace std::experimental;
-
-struct coro_t {
-  struct promise_type {
-    coro_t get_return_object() {
-      coroutine_handle<promise_type>{};
-      return {};
-    }
-    suspend_never initial_suspend() { return {}; }
-    suspend_never final_suspend() { return {}; }
-    void return_void() {}
-    static void unhandled_exception() {}
-  };
-};
-
-struct B {
-  ~B() {}
-  bool await_ready() { return true; }
-  B await_resume() { return {}; }
-  template <typename F> void await_suspend(F) {}
-};
-
-
-struct A {
-  ~A() {}
-  bool await_ready() { return true; }
-  int await_resume() { return 42; }
-  template <typename F> void await_suspend(F) {}
-};
-
-int last_value = -1;
-void set_value(int x) {
-  last_value = x;
-}
-
-coro_t f(int n) {
-  if (n == 0) {
-    set_value(0);
-    co_return;
-  }
-  int val = co_await A{};
-  ((void)val);
-  set_value(42);
-}
-
-coro_t g() { B val = co_await B{}; }
-
-int main() {
-  last_value = -1;
-  f(0);
-  assert(last_value == 0);
-  f(1);
-  assert(last_value == 42);
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
deleted file mode 100644
index 12ab92f..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/bool_await_suspend.pass.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// See https://bugs.llvm.org/show_bug.cgi?id=33271
-// UNSUPPORTED: ubsan
-
-#include <experimental/coroutine>
-#include <cassert>
-
-using namespace std::experimental;
-
-struct coro_t {
-  struct promise_type {
-    coro_t get_return_object() {
-      return coroutine_handle<promise_type>::from_promise(*this);
-    }
-    suspend_never initial_suspend() { return {}; }
-    suspend_never final_suspend() { return {}; }
-    void return_void() {}
-    void unhandled_exception() {}
-  };
-  coro_t(coroutine_handle<promise_type> hh) : h(hh) {}
-  coroutine_handle<promise_type> h;
-};
-
-struct NoSuspend {
-  bool await_ready() { return false; }
-  void await_resume() {}
-  template <typename F> bool await_suspend(F) { return false; }
-};
-
-struct DoSuspend {
-  bool await_ready() { return false; }
-  void await_resume() {}
-  template <typename F> bool await_suspend(F) { return true; }
-};
-
-bool f_started, f_resumed = false;
-coro_t f() {
-  f_started = true;
-  co_await DoSuspend{};
-  f_resumed = true;
-}
-
-bool g_started, g_resumed = false;
-coro_t g() {
-  g_started = true;
-  co_await NoSuspend{};
-  g_resumed = true;
-}
-
-int main() {
-  assert(!f_started && !f_resumed && !g_started && !g_resumed);
-  auto fret = f();
-  assert(f_started && !f_resumed);
-  fret.h.destroy();
-  assert(f_started && !f_resumed);
-  g();
-  assert(g_started && g_resumed);
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
deleted file mode 100644
index 77070cc..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/expected.pass.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <cassert>
-using namespace std::experimental;
-
-struct error {};
-
-template <typename T, typename Error = int>
-struct expected {
-
-  struct Data {
-    T val;
-    Error error;
-  };
-  Data data;
-
-  struct DataPtr {
-    Data *p;
-    ~DataPtr() { delete p; }
-  };
-
-  expected() {}
-  expected(T val) : data{std::move(val),{}} {}
-  expected(struct error, Error error) : data{{}, std::move(error)} {}
-  expected(DataPtr & p) : data{std::move(p.p->val), std::move(p.p->error)} {}
-
-  struct promise_type {
-    Data* data;
-    DataPtr get_return_object() { data = new Data{}; return {data}; }
-    suspend_never initial_suspend() { return {}; }
-    suspend_never final_suspend() { return {}; }
-    void return_value(T v) { data->val = std::move(v); data->error = {};}
-    void unhandled_exception() {}
-  };
-
-  bool await_ready() { return !data.error; }
-  T await_resume() { return std::move(data.val); }
-  void await_suspend(coroutine_handle<promise_type> h) {
-    h.promise().data->error =std::move(data.error);
-    h.destroy();
-  }
-
-  T const& value() { return data.val; }
-  Error const& error() { return data.error; }
-};
-
-expected<int> g() { return {0}; }
-expected<int> h() { return {error{}, 42}; }
-
-extern "C" void print(int);
-
-bool f1_started, f1_resumed = false;
-expected<int> f1() {
-  f1_started = true;
-  (void)(co_await g());
-  f1_resumed = true;
-  co_return 100;
-}
-
-bool f2_started, f2_resumed = false;
-expected<int> f2() {
-  f2_started = true;
-  (void)(co_await h());
-  f2_resumed = true;
-  co_return 200;
-}
-
-int main() {
-  auto c1 = f1();
-  assert(f1_started && f1_resumed);
-  assert(c1.value() == 100);
-  assert(c1.error() == 0);
-
-  auto c2 = f2();
-  assert(f2_started && !f2_resumed);
-  assert(c2.value() == 0);
-  assert(c2.error() == 42);
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp
deleted file mode 100644
index 20bcf60..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/fullexpr-dtor.pass.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <cassert>
-
-#include "test_macros.h"
-
-using namespace std::experimental;
-
-int alive = 0;
-int ctor_called = 0;
-int dtor_called = 0;
-void reset() {
-  assert(alive == 0);
-  alive = 0;
-  ctor_called = 0;
-  dtor_called = 0;
-}
-struct Noisy {
-  Noisy() { ++alive; ++ctor_called; }
-  ~Noisy() { --alive; ++dtor_called; }
-#if TEST_STD_VER > 14
-  Noisy(Noisy const&) = delete;
-#else
-  // FIXME: This test depends on copy elision taking place in C++14
-  // (pre-c++17 guaranteed copy elision)
-  Noisy(Noisy const&);
-#endif
-};
-
-struct Bug {
-  bool await_ready() { return true; }
-  void await_suspend(std::experimental::coroutine_handle<>) {}
-  Noisy await_resume() { return {}; }
-};
-struct coro2 {
-  struct promise_type {
-    suspend_never initial_suspend() { return{}; }
-    suspend_never final_suspend() { return{}; }
-    coro2 get_return_object() { return{}; }
-    void return_void() {}
-    Bug yield_value(int) { return {}; }
-    void unhandled_exception() {}
-  };
-};
-
-// Checks that destructors are correctly invoked for the object returned by
-// coawait.
-coro2 a() {
-  reset();
-  {
-    auto x = co_await Bug{};
-    assert(alive == 1);
-    assert(ctor_called == 1);
-    assert(dtor_called == 0);
-    ((void)x);
-  }
-  assert(alive == 0);
-  assert(dtor_called == 1);
-}
-
-coro2 b() {
-  reset();
-  {
-    (void)(co_await Bug{});
-    assert(ctor_called == 1);
-    assert(dtor_called == 1);
-    assert(alive == 0);
-  }
-  assert(ctor_called == 1);
-  assert(dtor_called == 1);
-  assert(alive == 0);
-
-}
-
-coro2 c() {
-  reset();
-  {
-    auto x = co_yield 42;
-    assert(alive == 1);
-    assert(ctor_called == 1);
-    assert(dtor_called == 0);
-  }
-  assert(alive == 0);
-  assert(ctor_called == 1);
-  assert(dtor_called == 1);
-}
-
-coro2 d() {
-  reset();
-  {
-    (void)(co_yield 42);
-    assert(ctor_called == 1);
-    assert(dtor_called == 1);
-    assert(alive == 0);
-  }
-  assert(alive == 0);
-  assert(ctor_called == 1);
-  assert(dtor_called == 1);
-}
-
-int main() {
-  a();
-  b();
-  c();
-  d();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp
deleted file mode 100644
index c92e261..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/generator.pass.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// See https://bugs.llvm.org/show_bug.cgi?id=33271
-// UNSUPPORTED: ubsan
-
-#include <experimental/coroutine>
-#include <vector>
-#include <cassert>
-
-#include "coroutine_types.h"
-
-using namespace std::experimental;
-
-struct minig {
-  struct promise_type {
-    int current_value;
-    suspend_always yield_value(int value) {
-      this->current_value = value;
-      return {};
-    }
-    suspend_always initial_suspend() { return {}; }
-    suspend_always final_suspend() { return {}; }
-    minig get_return_object() { return minig{this}; };
-    void return_void() {}
-    void unhandled_exception() {}
-  };
-
-  bool move_next() {
-    p.resume();
-    return !p.done();
-  }
-  int current_value() { return p.promise().current_value; }
-
-  minig(minig &&rhs) : p(rhs.p) { rhs.p = nullptr; }
-
-  ~minig() {
-    if (p)
-      p.destroy();
-  }
-
-private:
-  explicit minig(promise_type *p)
-      : p(coroutine_handle<promise_type>::from_promise(*p)) {}
-
-  coroutine_handle<promise_type> p;
-};
-
-
-minig mini_count(int n) {
-  for (int i = 0; i < n; i++) {
-    co_yield i;
-  }
-}
-
-generator<int> count(int n) {
-  for (int i = 0; i < n; ++i)
-    co_yield i;
-}
-
-generator<int> range(int from, int n) {
-  for (int i = from; i < n; ++i)
-    co_yield i;
-}
-
-void test_count() {
-  const std::vector<int> expect = {0, 1, 2, 3, 4};
-  std::vector<int> got;
-  for (auto x : count(5))
-    got.push_back(x);
-  assert(expect == got);
-}
-
-void test_range() {
-  int sum = 0;
-   for (auto v: range(1, 20))
-      sum += v;
-   assert(sum == 190);
-}
-
-void test_mini_generator() {
-  int sum = 0;
-  auto g = mini_count(5);
-  while (g.move_next()) {
-     sum += g.current_value();
-  }
-  assert(sum == 10);
-}
-
-int main() {
-  test_count();
-  test_range();
-  test_mini_generator();
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp
deleted file mode 100644
index 1fdf2c8..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/go.pass.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <cassert>
-
-using namespace std::experimental;
-
-bool cancel = false;
-
-struct goroutine
-{
-  static int const N = 10;
-  static int count;
-  static coroutine_handle<> stack[N];
-
-  static void schedule(coroutine_handle<>& rh)
-  {
-    assert(count < N);
-    stack[count++] = rh;
-    rh = nullptr;
-  }
-
-  ~goroutine() {}
-
-  static void go(goroutine) {}
-
-  static void run_one()
-  {
-    assert(count > 0);
-    stack[--count]();
-  }
-
-  struct promise_type
-  {
-    suspend_never initial_suspend() {
-      return {};
-    }
-    suspend_never final_suspend() {
-      return {};
-    }
-    void return_void() {}
-    goroutine get_return_object() {
-      return{};
-    }
-    void unhandled_exception() {}
-  };
-};
-int goroutine::count;
-coroutine_handle<> goroutine::stack[N];
-
-coroutine_handle<goroutine::promise_type> workaround;
-
-class channel;
-
-struct push_awaiter {
-  channel* ch;
-  bool await_ready() {return false; }
-  void await_suspend(coroutine_handle<> rh);
-  void await_resume() {}
-};
-
-struct pull_awaiter {
-  channel * ch;
-
-  bool await_ready();
-  void await_suspend(coroutine_handle<> rh);
-  int await_resume();
-};
-
-class channel
-{
-  using T = int;
-
-  friend struct push_awaiter;
-  friend struct pull_awaiter;
-
-  T const* pvalue = nullptr;
-  coroutine_handle<> reader = nullptr;
-  coroutine_handle<> writer = nullptr;
-public:
-  push_awaiter push(T const& value)
-  {
-    assert(pvalue == nullptr);
-    assert(!writer);
-    pvalue = &value;
-
-    return { this };
-  }
-
-  pull_awaiter pull()
-  {
-    assert(!reader);
-
-    return { this };
-  }
-
-  void sync_push(T const& value)
-  {
-    assert(!pvalue);
-    pvalue = &value;
-    assert(reader);
-    reader();
-    assert(!pvalue);
-    reader = nullptr;
-  }
-
-  auto sync_pull()
-  {
-    while (!pvalue) goroutine::run_one();
-    auto result = *pvalue;
-    pvalue = nullptr;
-    if (writer)
-    {
-      auto wr = writer;
-      writer = nullptr;
-      wr();
-    }
-    return result;
-  }
-};
-
-void push_awaiter::await_suspend(coroutine_handle<> rh)
-{
-  ch->writer = rh;
-  if (ch->reader) goroutine::schedule(ch->reader);
-}
-
-
-bool pull_awaiter::await_ready() {
-  return !!ch->writer;
-}
-void pull_awaiter::await_suspend(coroutine_handle<> rh) {
-  ch->reader = rh;
-}
-int pull_awaiter::await_resume() {
-  auto result = *ch->pvalue;
-  ch->pvalue = nullptr;
-  if (ch->writer) {
-    //goroutine::schedule(ch->writer);
-    auto wr = ch->writer;
-    ch->writer = nullptr;
-    wr();
-  }
-  return result;
-}
-
-goroutine pusher(channel& left, channel& right)
-{
-  for (;;) {
-    auto val = co_await left.pull();
-    co_await right.push(val + 1);
-  }
-}
-
-const int N = 100;
-channel* c = new channel[N + 1];
-
-int main() {
-  for (int i = 0; i < N; ++i)
-    goroutine::go(pusher(c[i], c[i + 1]));
-
-  c[0].sync_push(0);
-  int result = c[N].sync_pull();
-
-  assert(result == 100);
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
deleted file mode 100644
index e3c9653..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/multishot_func.pass.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <cassert>
-
-using namespace std::experimental;
-
-// This file tests, multishot, movable std::function like thing using coroutine
-// for compile-time type erasure and unerasure.
-template <typename R> struct func {
-  struct Input {R a, b;};
-
-  struct promise_type {
-    Input* I;
-    R result;
-    func get_return_object() { return {this}; }
-    suspend_always initial_suspend() { return {}; }
-    suspend_never final_suspend() { return {}; }
-    void return_void() {}
-    template <typename F>
-    suspend_always yield_value(F&& f) {
-      result = f(I->a, I->b);
-      return {};
-    }
-    void unhandled_exception() {}
-  };
-
-  R operator()(Input I) {
-    h.promise().I = &I;
-    h.resume();
-    R result = h.promise().result;
-    return result;
-  };
-
-  func() {}
-  func(func &&rhs) : h(rhs.h) { rhs.h = nullptr; }
-  func(func const &) = delete;
-
-  func &operator=(func &&rhs) {
-    if (this != &rhs) {
-      if (h)
-        h.destroy();
-      h = rhs.h;
-      rhs.h = nullptr;
-    }
-    return *this;
-  }
-
-  template <typename F> static func Create(F f) {
-    for (;;) {
-      co_yield f;
-    }
-  }
-
-  template <typename F> func(F f) : func(Create(f)) {}
-
-  ~func() {
-    if (h)
-      h.destroy();
-  }
-
-private:
-  func(promise_type *promise)
-      : h(coroutine_handle<promise_type>::from_promise(*promise)) {}
-  coroutine_handle<promise_type> h;
-};
-
-int Do(int acc, int n, func<int> f) {
-  for (int i = 0; i < n; ++i)
-    acc = f({acc, i});
-  return acc;
-}
-
-int main() {
-  int result = Do(1, 10, [](int a, int b) {return a + b;});
-  assert(result == 46);
-}
diff --git a/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp b/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
deleted file mode 100644
index ae0a950..0000000
--- a/test/std/experimental/language.support/support.coroutines/end.to.end/oneshot_func.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-#include <experimental/coroutine>
-#include <vector>
-#include <cassert>
-
-using namespace std::experimental;
-
-// This file tests, one shot, movable std::function like thing using coroutine
-// for compile-time type erasure and unerasure.
-
-template <typename R> struct func {
-  struct promise_type {
-    R result;
-    func get_return_object() { return {this}; }
-    suspend_always initial_suspend() { return {}; }
-    suspend_always final_suspend() { return {}; }
-    void return_value(R v) { result = v; }
-    void unhandled_exception() {}
-  };
-
-  R operator()() {
-    h.resume();
-    R result = h.promise().result;
-    h.destroy();
-    h = nullptr;
-    return result;
-  };
-
-  func() {}
-  func(func &&rhs) : h(rhs.h) { rhs.h = nullptr; }
-  func(func const &) = delete;
-
-  func &operator=(func &&rhs) {
-    if (this != &rhs) {
-      if (h)
-        h.destroy();
-      h = rhs.h;
-      rhs.h = nullptr;
-    }
-    return *this;
-  }
-
-  template <typename F> static func Create(F f) { co_return f(); }
-
-  template <typename F> func(F f) : func(Create(f)) {}
-
-  ~func() {
-    if (h)
-      h.destroy();
-  }
-
-private:
-  func(promise_type *promise)
-      : h(coroutine_handle<promise_type>::from_promise(*promise)) {}
-  coroutine_handle<promise_type> h;
-};
-
-std::vector<int> yielded_values = {};
-int yield(int x) { yielded_values.push_back(x); return x + 1; }
-float fyield(int x) { yielded_values.push_back(x); return static_cast<float>(x + 2); }
-
-void Do1(func<int> f) { yield(f()); }
-void Do2(func<double> f) { yield(static_cast<int>(f())); }
-
-int main() {
-  Do1([] { return yield(43); });
-  assert((yielded_values == std::vector<int>{43, 44}));
-
-  yielded_values = {};
-  Do2([] { return fyield(44); });
-  assert((yielded_values == std::vector<int>{44, 46}));
-}
diff --git a/test/std/experimental/language.support/support.coroutines/includes.pass.cpp b/test/std/experimental/language.support/support.coroutines/includes.pass.cpp
deleted file mode 100644
index b30d8c7..0000000
--- a/test/std/experimental/language.support/support.coroutines/includes.pass.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11
-
-// <experimental/coroutine>
-
-// Test that <experimental/coroutine> includes <new>
-
-#include <experimental/coroutine>
-
-int main(){
-  // std::nothrow is not implicitly defined by the compiler when the include is
-  // missing, unlike other parts of <new>. Therefore we use std::nothrow to
-  // test for #include <new>
-  (void)std::nothrow;
-
-}
diff --git a/test/std/experimental/language.support/support.coroutines/lit.local.cfg b/test/std/experimental/language.support/support.coroutines/lit.local.cfg
deleted file mode 100644
index a0b3de8..0000000
--- a/test/std/experimental/language.support/support.coroutines/lit.local.cfg
+++ /dev/null
@@ -1,9 +0,0 @@
-# If the compiler doesn't support coroutines mark all of the tests under
-# this directory as unsupported. Otherwise add the required `-fcoroutines-ts`
-# flag.
-if 'fcoroutines-ts' not in config.available_features:
-  config.unsupported = True
-else:
-  import copy
-  config.test_format.cxx = copy.deepcopy(config.test_format.cxx)
-  config.test_format.cxx.compile_flags += ['-fcoroutines-ts']
diff --git a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
index f269149..c166bb7 100644
--- a/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
+++ b/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp
@@ -8,12 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
 
 // <optional>
 
diff --git a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp b/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
index a4af713..4630165 100644
--- a/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
+++ b/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp
@@ -8,12 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability_markup=macosx10.12
-// XFAIL: availability_markup=macosx10.11
-// XFAIL: availability_markup=macosx10.10
-// XFAIL: availability_markup=macosx10.9
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
 
 // <optional>
 
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
index 72d7790..c8f0711 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp
@@ -8,13 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
 // <optional>
 
 // T& optional<T>::value();
diff --git a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
index b3d6dfd..98ff16e 100644
--- a/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
+++ b/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp
@@ -8,13 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-// XFAIL: availability=macosx10.12
-// XFAIL: availability=macosx10.11
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.7
-
 // <optional>
 
 // constexpr const T& optional<T>::value() const;
diff --git a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp
index bfd385a..e267c68 100644
--- a/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp
+++ b/test/std/experimental/utilities/meta/meta.type.synop/meta.unary.prop.pass.cpp
@@ -8,12 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11
-
-// GCC returns true for __is_trivially_constructible(void, int)
-// See gcc.gnu.org/PR80682
-// NOTE: This has been fixed in trunk and will be backported soon.
-// XFAIL: gcc-7, gcc-6, gcc-5, gcc-4
-
 // <experimental/type_traits>
 
 #include <experimental/type_traits>
diff --git a/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp
similarity index 89%
rename from test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp
rename to test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp
index 31a3722..4d83296 100644
--- a/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp
+++ b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/fopen.fail.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// REQUIRES: libcpp-has-no-global-filesystem-namespace
-
 #include <cstdio>
 
 int main() {
diff --git a/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/lit.local.cfg b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/lit.local.cfg
new file mode 100644
index 0000000..4ea6709
--- /dev/null
+++ b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/lit.local.cfg
@@ -0,0 +1,2 @@
+if 'libcpp-has-no-global-filesystem-namespace' not in config.available_features:
+    config.unsupported = True
diff --git a/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp
similarity index 89%
rename from test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp
rename to test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp
index 248ab4d..deca9bf 100644
--- a/test/libcxx/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp
+++ b/test/std/input.output/file.streams/c.files/no.global.filesystem.namespace/rename.fail.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// REQUIRES: libcpp-has-no-global-filesystem-namespace
-
 #include <cstdio>
 
 int main() {
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
index 6640954..a92ec87 100644
--- a/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/filebuf.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::filebuf f;
@@ -53,4 +52,5 @@
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
index 96806fb..f13ee44 100644
--- a/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/filebuf.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::filebuf f;
@@ -51,4 +50,5 @@
         assert(f2.sgetc() == L'2');
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
index 949ea50..fcc86a1 100644
--- a/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/fstream.assign/member_swap.pass.cpp
@@ -15,33 +15,13 @@
 // void swap(basic_fstream& rhs);
 
 #include <fstream>
-#include <utility>
 #include <cassert>
 #include "platform_support.h"
 
-std::pair<std::string, std::string> get_temp_file_names() {
-  std::pair<std::string, std::string> names;
-  names.first = get_temp_file_name();
-
-  // Create the file so the next call to `get_temp_file_name()` doesn't
-  // return the same file.
-  std::FILE *fd1 = std::fopen(names.first.c_str(), "w");
-
-  names.second = get_temp_file_name();
-  assert(names.first != names.second);
-
-  std::fclose(fd1);
-  std::remove(names.first.c_str());
-
-  return names;
-}
-
 int main()
 {
-    std::pair<std::string, std::string> temp_files = get_temp_file_names();
-    std::string& temp1 = temp_files.first;
-    std::string& temp2 = temp_files.second;
-    assert(temp1 != temp2);
+    std::string temp1 = get_temp_file_name();
+    std::string temp2 = get_temp_file_name();
     {
         std::fstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
                                                   | std::ios_base::trunc);
diff --git a/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
index b143bd4..b5157e9 100644
--- a/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/fstream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::fstream fso(temp.c_str(), std::ios_base::in | std::ios_base::out
@@ -47,4 +46,5 @@
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
index 4ff84f2..0a4f724 100644
--- a/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/fstream.assign/nonmember_swap.pass.cpp
@@ -16,34 +16,13 @@
 //   void swap(basic_fstream<charT, traits>& x, basic_fstream<charT, traits>& y);
 
 #include <fstream>
-#include <utility>
 #include <cassert>
 #include "platform_support.h"
 
-
-std::pair<std::string, std::string> get_temp_file_names() {
-  std::pair<std::string, std::string> names;
-  names.first = get_temp_file_name();
-
-  // Create the file so the next call to `get_temp_file_name()` doesn't
-  // return the same file.
-  std::FILE *fd1 = std::fopen(names.first.c_str(), "w");
-
-  names.second = get_temp_file_name();
-  assert(names.first != names.second);
-
-  std::fclose(fd1);
-  std::remove(names.first.c_str());
-
-  return names;
-}
-
 int main()
 {
-    std::pair<std::string, std::string> temp_files = get_temp_file_names();
-    std::string& temp1 = temp_files.first;
-    std::string& temp2 = temp_files.second;
-    assert(temp1 != temp2);
+    std::string temp1 = get_temp_file_name();
+    std::string temp2 = get_temp_file_name();
     {
         std::fstream fs1(temp1.c_str(), std::ios_base::in | std::ios_base::out
                                                   | std::ios_base::trunc);
diff --git a/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
index 556cc85..d2ae302 100644
--- a/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/fstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::fstream fso(temp, std::ios_base::in | std::ios_base::out
@@ -45,4 +44,5 @@
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
index 36fa29a..9c2fcad 100644
--- a/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ifstream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::ifstream fso("test.dat");
         std::ifstream fs;
@@ -37,4 +36,5 @@
         fs >> x;
         assert(x == 3.25);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
index eeb06e0..aaac121 100644
--- a/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ifstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::ifstream fso("test.dat");
         std::ifstream fs = move(fso);
@@ -35,4 +34,5 @@
         fs >> x;
         assert(x == 3.25);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
index 9522477..519b84f 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.assign/member_swap.pass.cpp
@@ -15,33 +15,13 @@
 // void swap(basic_ofstream& rhs);
 
 #include <fstream>
-#include <utility>
 #include <cassert>
 #include "platform_support.h"
 
-std::pair<std::string, std::string> get_temp_file_names() {
-  std::pair<std::string, std::string> names;
-  names.first = get_temp_file_name();
-
-  // Create the file so the next call to `get_temp_file_name()` doesn't
-  // return the same file.
-  std::FILE *fd1 = std::fopen(names.first.c_str(), "w");
-
-  names.second = get_temp_file_name();
-  assert(names.first != names.second);
-
-  std::fclose(fd1);
-  std::remove(names.first.c_str());
-
-  return names;
-}
-
 int main()
 {
-    std::pair<std::string, std::string> temp_files = get_temp_file_names();
-    std::string& temp1 = temp_files.first;
-    std::string& temp2 = temp_files.second;
-    assert(temp1 != temp2);
+    std::string temp1 = get_temp_file_name();
+    std::string temp2 = get_temp_file_name();
     {
         std::ofstream fs1(temp1.c_str());
         std::ofstream fs2(temp2.c_str());
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
index 094f550..0f21eb8 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::ofstream fso(temp.c_str());
@@ -49,4 +48,5 @@
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
index 31f2153..d58f5f2 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.assign/nonmember_swap.pass.cpp
@@ -16,33 +16,13 @@
 //   void swap(basic_ofstream<charT, traits>& x, basic_ofstream<charT, traits>& y);
 
 #include <fstream>
-#include <utility>
 #include <cassert>
 #include "platform_support.h"
 
-std::pair<std::string, std::string> get_temp_file_names() {
-  std::pair<std::string, std::string> names;
-  names.first = get_temp_file_name();
-
-  // Create the file so the next call to `get_temp_file_name()` doesn't
-  // return the same file.
-  std::FILE *fd1 = std::fopen(names.first.c_str(), "w");
-
-  names.second = get_temp_file_name();
-  assert(names.first != names.second);
-
-  std::fclose(fd1);
-  std::remove(names.first.c_str());
-
-  return names;
-}
-
 int main()
 {
-    std::pair<std::string, std::string> temp_files = get_temp_file_names();
-    std::string& temp1 = temp_files.first;
-    std::string& temp2 = temp_files.second;
-    assert(temp1 != temp2);
+    std::string temp1 = get_temp_file_name();
+    std::string temp2 = get_temp_file_name();
     {
         std::ofstream fs1(temp1.c_str());
         std::ofstream fs2(temp2.c_str());
diff --git a/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp b/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
index fe885cf..8645358 100644
--- a/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
+++ b/test/std/input.output/file.streams/fstreams/ofstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <fstream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -22,6 +20,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::string temp = get_temp_file_name();
     {
         std::ofstream fso(temp.c_str());
@@ -47,4 +46,5 @@
         assert(x == 3.25);
     }
     std::remove(temp.c_str());
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
index cf6c8ae..2032e93 100644
--- a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <istream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -19,6 +17,7 @@
 #include <istream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 struct testbuf
@@ -38,9 +37,11 @@
         {base::operator=(std::move(s)); return *this;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb1;
         testbuf<char> sb2;
@@ -87,4 +88,5 @@
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
index e8fd00c..c0592e9 100644
--- a/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/iostreamclass/iostream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <istream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -19,6 +17,7 @@
 #include <istream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 struct testbuf
@@ -38,9 +37,11 @@
         : base(std::move(s)) {}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb;
         test_iostream<char> is1(&sb);
@@ -73,4 +74,5 @@
         assert(is.precision() == 6);
         assert(is.getloc().name() == "C");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
index eda490f..52b3566 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.formatted/istream.formatted.arithmetic/pointer.pass.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-
 // <istream>
 
 // template <class charT, class traits = char_traits<charT> >
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
index c7f16ca..0f356e2 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <istream>
 
 // int_type get();
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
index b3d3c69..cf06e34 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/get_chart.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <istream>
 
 // basic_istream<charT,traits>& get(char_type& c);
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
index 3a37cff..3095712 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore_0xff.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <istream>
 
 // basic_istream<charT,traits>&
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
index ceef0d2..20e70cf 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/read.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <istream>
 
 // basic_istream<charT,traits>& read(char_type* s, streamsize n);
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
index a0a8e2f..01eecb5 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/readsome.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <istream>
 
 // streamsize readsome(char_type* s, streamsize n);
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
index e370b4b..dc4e0ba 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg.pass.cpp
@@ -7,9 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <istream>
 
 // basic_istream<charT,traits>& seekg(pos_type pos);
diff --git a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
index cac1e39..818d42c 100644
--- a/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream.unformatted/seekg_off.pass.cpp
@@ -7,13 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <istream>
 
 // basic_istream<charT,traits>& seekg(off_type off, ios_base::seekdir dir);
diff --git a/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
index 18887b7..2876d76 100644
--- a/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/iostream.format/input.streams/istream/istream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <istream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -19,6 +17,7 @@
 #include <istream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 struct testbuf
@@ -38,9 +37,11 @@
         {base::operator=(std::move(s)); return *this;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb1;
         testbuf<char> sb2;
@@ -87,4 +88,5 @@
         assert(is2.precision() == 6);
         assert(is2.getloc().name() == "C");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
index 1b58a9a..40fe079 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.assign/move_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <ostream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -19,6 +17,7 @@
 #include <ostream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 struct testbuf
@@ -38,9 +37,11 @@
         {base::operator=(std::move(s)); return *this;}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb1;
         testbuf<char> sb2;
@@ -87,4 +88,5 @@
         assert(os2.precision() == 6);
         assert(os2.getloc().name() == "C");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
index 7d225d4..b3045b3 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <ostream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -19,6 +17,7 @@
 #include <ostream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 struct testbuf
@@ -38,9 +37,11 @@
         : base(std::move(s)) {}
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb;
         test_ostream<char> os1(&sb);
@@ -69,4 +70,5 @@
         assert(os.precision() == 6);
         assert(os.getloc().name() == "C");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp
deleted file mode 100644
index 956cd17..0000000
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minmax_showbase.pass.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <ostream>
-
-// template <class charT, class traits = char_traits<charT> >
-//   class basic_ostream;
-
-// operator<<(short n);
-// operator<<(unsigned short n);
-// operator<<(int n);
-// operator<<(unsigned int n);
-// operator<<(long n);
-// operator<<(unsigned long n);
-// operator<<(long long n);
-// operator<<(unsigned long long n);
-
-//  Testing to make sure that the max length values are correctly inserted when
-//  using std::showbase
-
-#include <cassert>
-#include <cstdint>
-#include <ios>
-#include <limits>
-#include <sstream>
-#include <type_traits>
-
-template <typename T>
-static void test(std::ios_base::fmtflags fmt, const char *expected)
-{
-    std::stringstream ss;
-    ss.setf(fmt, std::ios_base::basefield);
-    ss << std::showbase << (std::is_signed<T>::value ? std::numeric_limits<T>::min() : std::numeric_limits<T>::max());
-    assert(ss.str() == expected);
-}
-
-int main(void)
-{
-    const std::ios_base::fmtflags o = std::ios_base::oct;
-    const std::ios_base::fmtflags d = std::ios_base::dec;
-    const std::ios_base::fmtflags x = std::ios_base::hex;
-
-    test<short>(o, "0100000");
-    test<short>(d, "-32768");
-    test<short>(x, "0x8000");
-
-    test<unsigned short>(o, "0177777");
-    test<unsigned short>(d, "65535");
-    test<unsigned short>(x, "0xffff");
-
-    test<int>(o, "020000000000");
-    test<int>(d, "-2147483648");
-    test<int>(x, "0x80000000");
-
-    test<unsigned int>(o, "037777777777");
-    test<unsigned int>(d, "4294967295");
-    test<unsigned int>(x, "0xffffffff");
-
-    const bool long_is_32 = std::integral_constant<bool, sizeof(long) == sizeof(int32_t)>::value; // avoid compiler warnings
-    const bool long_is_64 = std::integral_constant<bool, sizeof(long) == sizeof(int64_t)>::value; // avoid compiler warnings
-    const bool long_long_is_64 = std::integral_constant<bool, sizeof(long long) == sizeof(int64_t)>::value; // avoid compiler warnings
-
-    if (long_is_32) {
-        test<long>(o, "020000000000");
-        test<long>(d, "-2147483648");
-        test<long>(x, "0x80000000");
-
-        test<unsigned long>(o, "037777777777");
-        test<unsigned long>(d, "4294967295");
-        test<unsigned long>(x, "0xffffffff");
-    } else if (long_is_64) {
-        test<long>(o, "01000000000000000000000");
-        test<long>(d, "-9223372036854775808");
-        test<long>(x, "0x8000000000000000");
-
-        test<unsigned long>(o, "01777777777777777777777");
-        test<unsigned long>(d, "18446744073709551615");
-        test<unsigned long>(x, "0xffffffffffffffff");
-    }
-    if (long_long_is_64) {
-        test<long long>(o, "01000000000000000000000");
-        test<long long>(d, "-9223372036854775808");
-        test<long long>(x, "0x8000000000000000");
-
-        test<unsigned long long>(o, "01777777777777777777777");
-        test<unsigned long long>(d, "18446744073709551615");
-        test<unsigned long long>(x, "0xffffffffffffffff");
-    }
-
-    return 0;
-}
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
index 54c8a28..e09c0ed 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/minus1.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-
 // <ostream>
 
 // template <class charT, class traits = char_traits<charT> >
diff --git a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
index 83210c0..8be0b51 100644
--- a/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
+++ b/test/std/input.output/iostream.format/output.streams/ostream.rvalue/CharT_pointer.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <ostream>
 
 // template <class charT, class traits = char_traits<charT> >
@@ -21,6 +19,7 @@
 #include <ostream>
 #include <cassert>
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class CharT>
 class testbuf
@@ -54,9 +53,11 @@
         }
 };
 
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         testbuf<char> sb;
         std::ostream(&sb) << "testing...";
@@ -67,4 +68,5 @@
         std::wostream(&sb) << L"123";
         assert(sb.str() == L"123");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
index 2a428c5..e57ad55 100644
--- a/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
+++ b/test/std/input.output/string.streams/istringstream/istringstream.assign/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::istringstream ss0(" 123 456");
         std::istringstream ss;
@@ -83,4 +82,5 @@
         s1 >> s;
         assert(s == L"Dddddddddddddddddd");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
index 0a45b79..adc46ab 100644
--- a/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
+++ b/test/std/input.output/string.streams/istringstream/istringstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::istringstream ss0(" 123 456");
         std::istringstream ss(std::move(ss0));
@@ -45,4 +44,5 @@
         ss >> i;
         assert(i == 456);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
index 8801001..a520685 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.assign/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::ostringstream ss0(" 123 456");
         std::ostringstream ss;
@@ -43,4 +42,5 @@
         ss << i << ' ' << 567;
         assert(ss.str() == L"234 5676");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
index 67bfc50..3d9e305 100644
--- a/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
+++ b/test/std/input.output/string.streams/ostringstream/ostringstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::ostringstream ss0(" 123 456");
         std::ostringstream ss(std::move(ss0));
@@ -41,4 +40,5 @@
         ss << i << ' ' << 567;
         assert(ss.str() == L"234 5676");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
index 436c76c..4ae3aa6 100644
--- a/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
+++ b/test/std/input.output/string.streams/stringstream.cons/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::stringstream ss0(" 123 456 ");
         std::stringstream ss(std::move(ss0));
@@ -49,4 +48,5 @@
         ss << i << ' ' << 123;
         assert(ss.str() == L"456 1236 ");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
index 94de616..78d682f 100644
--- a/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
+++ b/test/std/input.output/string.streams/stringstream.cons/move2.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     std::vector<std::istringstream> vecis;
     vecis.push_back(std::istringstream());
     vecis.back().str("hub started at [00 6b 8b 45 69]");
@@ -35,4 +34,5 @@
         vecis[n].seekg(0, std::ios_base::beg);
         assert(vecis[n].str().size() == 31);
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp b/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
index 3cce695..ccaf72d 100644
--- a/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
+++ b/test/std/input.output/string.streams/stringstream.cons/stringstream.assign/move.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <sstream>
 
 // template <class charT, class traits = char_traits<charT>, class Allocator = allocator<charT> >
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::stringstream ss0(" 123 456 ");
         std::stringstream ss;
@@ -51,4 +50,5 @@
         ss << i << ' ' << 123;
         assert(ss.str() == L"456 1236 ");
     }
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
index e5bd560..e395da2 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/advance.pass.cpp
@@ -9,16 +9,14 @@
 
 // <iterator>
 
-//   All of these became constexpr in C++17
-//
 // template <InputIterator Iter>
-//   constexpr void advance(Iter& i, Iter::difference_type n);
+//   void advance(Iter& i, Iter::difference_type n);
 //
 // template <BidirectionalIterator Iter>
-//   constexpr void advance(Iter& i, Iter::difference_type n);
+//   void advance(Iter& i, Iter::difference_type n);
 //
 // template <RandomAccessIterator Iter>
-//   constexpr void advance(Iter& i, Iter::difference_type n);
+//   void advance(Iter& i, Iter::difference_type n);
 
 #include <iterator>
 #include <cassert>
@@ -33,19 +31,8 @@
     assert(i == x);
 }
 
-#if TEST_STD_VER > 14
-template <class It>
-constexpr bool 
-constepxr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
-{
-    std::advance(i, n);
-    return i == x;
-}
-#endif
-
 int main()
 {
-    {
     const char* s = "1234567890";
     test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10));
     test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10));
@@ -55,18 +42,4 @@
     test(random_access_iterator<const char*>(s+5), -5, random_access_iterator<const char*>(s));
     test(s+5, 5, s+10);
     test(s+5, -5, s);
-    }
-#if TEST_STD_VER > 14
-    {
-    constexpr const char* s = "1234567890";
-    static_assert( constepxr_test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10)), "" );
-    static_assert( constepxr_test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10)), "" );
-    static_assert( constepxr_test(bidirectional_iterator<const char*>(s+5), 5, bidirectional_iterator<const char*>(s+10)), "" );
-    static_assert( constepxr_test(bidirectional_iterator<const char*>(s+5), -5, bidirectional_iterator<const char*>(s)), "" );
-    static_assert( constepxr_test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10)), "" );
-    static_assert( constepxr_test(random_access_iterator<const char*>(s+5), -5, random_access_iterator<const char*>(s)), "" );
-    static_assert( constepxr_test(s+5, 5, s+10), "" );
-    static_assert( constepxr_test(s+5, -5, s), "" );
-    }
-#endif
 }
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp
index 2f16fcb..7fef635 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/distance.pass.cpp
@@ -29,33 +29,12 @@
     assert(std::distance(first, last) == x);
 }
 
-#if TEST_STD_VER > 14
-template <class It>
-constexpr bool
-constexpr_test(It first, It last, typename std::iterator_traits<It>::difference_type x)
-{
-    return std::distance(first, last) == x;
-}
-#endif
-
 int main()
 {
-    {
     const char* s = "1234567890";
     test(input_iterator<const char*>(s), input_iterator<const char*>(s+10), 10);
     test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+10), 10);
     test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+10), 10);
     test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+10), 10);
     test(s, s+10, 10);
-    }
-#if TEST_STD_VER > 14
-    {
-    constexpr const char* s = "1234567890";
-    static_assert( constexpr_test(input_iterator<const char*>(s), input_iterator<const char*>(s+10), 10), "");
-    static_assert( constexpr_test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+10), 10), "");
-    static_assert( constexpr_test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+10), 10), "");
-    static_assert( constexpr_test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+10), 10), "");
-    static_assert( constexpr_test(s, s+10, 10), "");
-    }
-#endif
 }
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
index e257b3e..0952588 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/next.pass.cpp
@@ -33,25 +33,8 @@
     assert(std::next(i) == x);
 }
 
-#if TEST_STD_VER > 14
-template <class It>
-constexpr bool
-constexpr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
-{
-    return std::next(i, n) == x;
-}
-
-template <class It>
-constexpr bool
-constexpr_test(It i, It x)
-{
-    return std::next(i) == x;
-}
-#endif
-
 int main()
 {
-    {
     const char* s = "1234567890";
     test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10));
     test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10));
@@ -64,21 +47,4 @@
     test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1));
     test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1));
     test(s, s+1);
-    }
-#if TEST_STD_VER > 14
-    {
-    constexpr const char* s = "1234567890";
-    static_assert( constexpr_test(input_iterator<const char*>(s), 10, input_iterator<const char*>(s+10)), "" );
-    static_assert( constexpr_test(forward_iterator<const char*>(s), 10, forward_iterator<const char*>(s+10)), "" );
-    static_assert( constexpr_test(bidirectional_iterator<const char*>(s), 10, bidirectional_iterator<const char*>(s+10)), "" );
-    static_assert( constexpr_test(random_access_iterator<const char*>(s), 10, random_access_iterator<const char*>(s+10)), "" );
-    static_assert( constexpr_test(s, 10, s+10), "" );
-
-    static_assert( constexpr_test(input_iterator<const char*>(s), input_iterator<const char*>(s+1)), "" );
-    static_assert( constexpr_test(forward_iterator<const char*>(s), forward_iterator<const char*>(s+1)), "" );
-    static_assert( constexpr_test(bidirectional_iterator<const char*>(s), bidirectional_iterator<const char*>(s+1)), "" );
-    static_assert( constexpr_test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1)), "" );
-    static_assert( constexpr_test(s, s+1), "" );
-    }
-#endif
 }
diff --git a/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp b/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
index 465cda1..0641706 100644
--- a/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
+++ b/test/std/iterators/iterator.primitives/iterator.operations/prev.pass.cpp
@@ -31,25 +31,8 @@
     assert(std::prev(i) == x);
 }
 
-#if TEST_STD_VER > 14
-template <class It>
-constexpr bool
-constexpr_test(It i, typename std::iterator_traits<It>::difference_type n, It x)
-{
-    return std::prev(i, n) == x;
-}
-
-template <class It>
-constexpr bool
-constexpr_test(It i, It x)
-{
-    return std::prev(i) == x;
-}
-#endif
-
 int main()
 {
-    {
     const char* s = "1234567890";
     test(bidirectional_iterator<const char*>(s+10), 10, bidirectional_iterator<const char*>(s));
     test(random_access_iterator<const char*>(s+10), 10, random_access_iterator<const char*>(s));
@@ -58,18 +41,4 @@
     test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
     test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
     test(s+1, s);
-    }
-#if TEST_STD_VER > 14
-    {
-    constexpr const char* s = "1234567890";
-    static_assert( constexpr_test(bidirectional_iterator<const char*>(s+10), 10, bidirectional_iterator<const char*>(s)), "" );
-    static_assert( constexpr_test(random_access_iterator<const char*>(s+10), 10, random_access_iterator<const char*>(s)), "" );
-    static_assert( constexpr_test(s+10, 10, s), "" );
-
-    static_assert( constexpr_test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s)), "" );
-    static_assert( constexpr_test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s)), "" );
-    static_assert( constexpr_test(s+1, s), "" );
-    }
-#endif
-    
 }
diff --git a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
index 3046ced..a680aa3 100644
--- a/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
+++ b/test/std/iterators/stream.iterators/istream.iterator/types.pass.cpp
@@ -40,22 +40,12 @@
 #include <type_traits>
 #include <string>
 
-#include "test_macros.h"
-
 int main()
 {
     typedef std::istream_iterator<double> I1; // double is trivially destructible
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I1,
         std::iterator<std::input_iterator_tag, double, std::ptrdiff_t,
         const double*, const double&> >::value), "");
-#else
-    static_assert((std::is_same<I1::iterator_category, std::input_iterator_tag>::value), "");
-    static_assert((std::is_same<I1::value_type, double>::value), "");
-    static_assert((std::is_same<I1::difference_type, std::ptrdiff_t>::value), "");
-    static_assert((std::is_same<I1::pointer, const double*>::value), "");
-    static_assert((std::is_same<I1::reference, const double&>::value), "");
-#endif
     static_assert((std::is_same<I1::char_type, char>::value), "");
     static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
     static_assert((std::is_same<I1::istream_type, std::istream>::value), "");
@@ -63,17 +53,9 @@
     static_assert( std::is_trivially_destructible<I1>::value, "");
 
     typedef std::istream_iterator<unsigned, wchar_t> I2; // unsigned is trivially destructible
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I2,
         std::iterator<std::input_iterator_tag, unsigned, std::ptrdiff_t,
         const unsigned*, const unsigned&> >::value), "");
-#else
-    static_assert((std::is_same<I2::iterator_category, std::input_iterator_tag>::value), "");
-    static_assert((std::is_same<I2::value_type, unsigned>::value), "");
-    static_assert((std::is_same<I2::difference_type, std::ptrdiff_t>::value), "");
-    static_assert((std::is_same<I2::pointer, const unsigned*>::value), "");
-    static_assert((std::is_same<I2::reference, const unsigned&>::value), "");
-#endif
     static_assert((std::is_same<I2::char_type, wchar_t>::value), "");
     static_assert((std::is_same<I2::traits_type, std::char_traits<wchar_t> >::value), "");
     static_assert((std::is_same<I2::istream_type, std::wistream>::value), "");
diff --git a/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/arrow.pass.cpp b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/arrow.pass.cpp
new file mode 100644
index 0000000..e3bf5e2
--- /dev/null
+++ b/test/std/iterators/stream.iterators/istreambuf.iterator/istreambuf.iterator_op_astrk/arrow.pass.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <iterator>
+
+// istreambuf_iterator
+
+// pointer operator->() const;
+
+#include <iostream>
+#include <sstream>
+#include <streambuf>
+
+typedef char C;
+int main ()
+{
+   std::istringstream s("filename");
+   std::istreambuf_iterator<char> i(s);
+
+   (*i).~C();  // This is well-formed...
+   i->~C();  // ... so this should be supported!
+}
diff --git a/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp b/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
index 8d043e1..460da64 100644
--- a/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostream.iterator/types.pass.cpp
@@ -23,35 +23,17 @@
 #include <iterator>
 #include <type_traits>
 
-#include "test_macros.h"
-
 int main()
 {
     typedef std::ostream_iterator<double> I1;
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I1,
         std::iterator<std::output_iterator_tag, void, void, void, void> >::value), "");
-#else
-    static_assert((std::is_same<I1::iterator_category, std::output_iterator_tag>::value), "");
-    static_assert((std::is_same<I1::value_type, void>::value), "");
-    static_assert((std::is_same<I1::difference_type, void>::value), "");
-    static_assert((std::is_same<I1::pointer, void>::value), "");
-    static_assert((std::is_same<I1::reference, void>::value), "");
-#endif
     static_assert((std::is_same<I1::char_type, char>::value), "");
     static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
     static_assert((std::is_same<I1::ostream_type, std::ostream>::value), "");
     typedef std::ostream_iterator<unsigned, wchar_t> I2;
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I2,
         std::iterator<std::output_iterator_tag, void, void, void, void> >::value), "");
-#else
-    static_assert((std::is_same<I2::iterator_category, std::output_iterator_tag>::value), "");
-    static_assert((std::is_same<I2::value_type, void>::value), "");
-    static_assert((std::is_same<I2::difference_type, void>::value), "");
-    static_assert((std::is_same<I2::pointer, void>::value), "");
-    static_assert((std::is_same<I2::reference, void>::value), "");
-#endif
     static_assert((std::is_same<I2::char_type, wchar_t>::value), "");
     static_assert((std::is_same<I2::traits_type, std::char_traits<wchar_t> >::value), "");
     static_assert((std::is_same<I2::ostream_type, std::wostream>::value), "");
diff --git a/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp b/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
index cdf7484..a699b24 100644
--- a/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
+++ b/test/std/iterators/stream.iterators/ostreambuf.iterator/types.pass.cpp
@@ -24,37 +24,19 @@
 #include <string>
 #include <type_traits>
 
-#include "test_macros.h"
-
 int main()
 {
     typedef std::ostreambuf_iterator<char> I1;
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I1,
         std::iterator<std::output_iterator_tag, void, void, void, void> >::value), "");
-#else
-    static_assert((std::is_same<I1::iterator_category, std::output_iterator_tag>::value), "");
-    static_assert((std::is_same<I1::value_type, void>::value), "");
-    static_assert((std::is_same<I1::difference_type, void>::value), "");
-    static_assert((std::is_same<I1::pointer, void>::value), "");
-    static_assert((std::is_same<I1::reference, void>::value), "");
-#endif
     static_assert((std::is_same<I1::char_type, char>::value), "");
     static_assert((std::is_same<I1::traits_type, std::char_traits<char> >::value), "");
     static_assert((std::is_same<I1::streambuf_type, std::streambuf>::value), "");
     static_assert((std::is_same<I1::ostream_type, std::ostream>::value), "");
 
     typedef std::ostreambuf_iterator<wchar_t> I2;
-#if TEST_STD_VER <= 14
     static_assert((std::is_convertible<I2,
         std::iterator<std::output_iterator_tag, void, void, void, void> >::value), "");
-#else
-    static_assert((std::is_same<I2::iterator_category, std::output_iterator_tag>::value), "");
-    static_assert((std::is_same<I2::value_type, void>::value), "");
-    static_assert((std::is_same<I2::difference_type, void>::value), "");
-    static_assert((std::is_same<I2::pointer, void>::value), "");
-    static_assert((std::is_same<I2::reference, void>::value), "");
-#endif
     static_assert((std::is_same<I2::char_type, wchar_t>::value), "");
     static_assert((std::is_same<I2::traits_type, std::char_traits<wchar_t> >::value), "");
     static_assert((std::is_same<I2::streambuf_type, std::wstreambuf>::value), "");
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
index 36f815a..c88e5b0 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/delete_align_val_t_replace.pass.cpp
@@ -12,22 +12,10 @@
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
 
 // Older Clang versions do not support this
-// XFAIL: clang-3, apple-clang-7, apple-clang-8
+// XFAIL: clang-3, apple-clang
 
 // None of the current GCC compilers support this.
-// XFAIL: gcc-5, gcc-6
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to compile/link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: gcc
 
 #include <new>
 #include <cstddef>
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
index 69f5ac8..55c26fa 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t.pass.cpp
@@ -13,20 +13,7 @@
 // UNSUPPORTED: sanitizer-new-delete
 
 // FIXME change this to XFAIL.
-// UNSUPPORTED: no-aligned-allocation && !gcc
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// UNSUPPORTED: no-aligned-allocation
 
 // test operator new
 
@@ -42,7 +29,7 @@
 
 int new_handler_called = 0;
 
-void my_new_handler()
+void new_handler()
 {
     ++new_handler_called;
     std::set_new_handler(0);
@@ -58,7 +45,7 @@
 
 void test_throw_max_size() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
-    std::set_new_handler(my_new_handler);
+    std::set_new_handler(new_handler);
     try
     {
         void* vp = operator new[] (std::numeric_limits<std::size_t>::max(),
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
index 3645328..ec5d0a4 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow.pass.cpp
@@ -13,19 +13,7 @@
 // UNSUPPORTED: sanitizer-new-delete
 
 // FIXME turn this into an XFAIL
-// UNSUPPORTED: no-aligned-allocation && !gcc
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to compile/link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// UNSUPPORTED: no-aligned-allocation
 
 // test operator new (nothrow)
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
index 228d176..03e490e 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_nothrow_replace.pass.cpp
@@ -10,19 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-// XFAIL: no-aligned-allocation && !gcc
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: no-aligned-allocation
 
 // test operator new nothrow by replacing only operator new
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
index 15bebcb..131deb3 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_align_val_t_replace.pass.cpp
@@ -10,8 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 
-// NOTE: GCC doesn't provide the -faligned-allocation flag to test for
-// XFAIL: no-aligned-allocation && !gcc
+// XFAIL: no-aligned-allocation
 
 // test operator new replacement
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
index f71cf19..5b93540 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.array/sized_delete_array_fsizeddeallocation.sh.cpp
@@ -13,12 +13,6 @@
 // when sized deallocation is not supported, e.g., prior to C++14.
 
 // UNSUPPORTED: sanitizer-new-delete
-// XFAIL: availability_markup=macosx10.11
-// XFAIL: availability_markup=macosx10.10
-// XFAIL: availability_markup=macosx10.9
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
-
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: fsized-deallocation
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
index b0e932c..a5d4df3 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/delete_align_val_t_replace.pass.cpp
@@ -10,23 +10,13 @@
 // test aligned operator delete replacement.
 
 // UNSUPPORTED: sanitizer-new-delete, c++98, c++03, c++11, c++14
+
 // Older Clang versions do not support this
-// XFAIL: clang-3, apple-clang-7, apple-clang-8
+// XFAIL: clang-3, apple-clang
 
 // None of the current GCC compilers support this.
-// XFAIL: gcc-5, gcc-6
+// XFAIL: gcc
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to compile/link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
 
 #include <new>
 #include <cstddef>
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
index 22ea5e2..5ebbc8a 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t.pass.cpp
@@ -9,23 +9,11 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // asan and msan will not call the new handler.
 // UNSUPPORTED: sanitizer-new-delete
 
 // FIXME turn this into an XFAIL
-// UNSUPPORTED: no-aligned-allocation && !gcc
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to compile/link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// UNSUPPORTED: no-aligned-allocation
 
 // test operator new
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
index 2c5c0f8..6e2eca3 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow.pass.cpp
@@ -9,23 +9,11 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // asan and msan will not call the new handler.
 // UNSUPPORTED: sanitizer-new-delete
 
 // FIXME turn this into an XFAIL
-// UNSUPPORTED: no-aligned-allocation && !gcc
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails to compile/link.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// UNSUPPORTED: no-aligned-allocation
 
 // test operator new (nothrow)
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
index b50f49d..9f64c97 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_nothrow_replace.pass.cpp
@@ -10,20 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
-// NOTE: gcc doesn't provide -faligned-allocation flag to test for
-// XFAIL: no-aligned-allocation && !gcc
-
-// On Windows libc++ doesn't provide its own definitions for new/delete
-// but instead depends on the ones in VCRuntime. However VCRuntime does not
-// yet provide aligned new/delete definitions so this test fails.
-// XFAIL: LIBCXX-WINDOWS-FIXME
+// XFAIL: no-aligned-allocation
 
 // test operator new nothrow by replacing only operator new
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
index 66bb613..df3e4c1 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_align_val_t_replace.pass.cpp
@@ -10,8 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // UNSUPPORTED: sanitizer-new-delete
 
-// NOTE: GCC doesn't provide a -faligned-allocation flag
-// XFAIL: no-aligned-allocation && !gcc
+// XFAIL: no-aligned-allocation
 
 // test operator new replacement
 
diff --git a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
index 40de3a0..61fca5f 100644
--- a/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
+++ b/test/std/language.support/support.dynamic/new.delete/new.delete.single/sized_delete_fsizeddeallocation.sh.cpp
@@ -13,11 +13,6 @@
 // when sized deallocation is not supported, e.g., prior to C++14.
 
 // UNSUPPORTED: sanitizer-new-delete
-// XFAIL: availability_markup=macosx10.11
-// XFAIL: availability_markup=macosx10.10
-// XFAIL: availability_markup=macosx10.9
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
 
 // NOTE: Only clang-3.7 and GCC 5.1 and greater support -fsized-deallocation.
 // REQUIRES: fsized-deallocation
diff --git a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
index 88e2253..68cd850 100644
--- a/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp
@@ -8,10 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-no-exceptions
-
-// This test fails due to a stack overflow
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // <exception>
 
 // class nested_exception;
@@ -47,7 +43,7 @@
 {
 public:
 	virtual ~C() {}
-	C * operator&() const { assert(false); return nullptr; } // should not be called
+	C * operator&() const { assert(false); } // should not be called
 };
 
 class D : private std::nested_exception {};
diff --git a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
index 6a9f25c..a86d8bc 100644
--- a/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
+++ b/test/std/language.support/support.exception/except.nested/throw_with_nested.pass.cpp
@@ -107,16 +107,6 @@
             assert(i == 7);
         }
     }
-    {
-        try
-        {
-            std::throw_with_nested("String literal");
-            assert(false);
-        }
-        catch (const char *)
-        {
-        }
-    }
 #if TEST_STD_VER > 11
     {
         try
diff --git a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
index c33d64d..661f789 100644
--- a/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/current_exception.pass.cpp
@@ -7,10 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// This test needs to be rewritten for the Windows exception_ptr semantics
-// which copy the exception each time the exception_ptr is copied.
-// XFAIL: LIBCXX-WINDOWS-FIXME
-
 // UNSUPPORTED: libcpp-no-exceptions
 // <exception>
 
diff --git a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
index 35821d9..36feda7 100644
--- a/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/make_exception_ptr.pass.cpp
@@ -38,12 +38,7 @@
         }
         catch (const A& a)
         {
-#ifndef _LIBCPP_ABI_MICROSOFT
             assert(A::constructed == 1);
-#else
-            // On Windows exception_ptr copies the exception
-            assert(A::constructed == 2);
-#endif
             assert(p != nullptr);
             p = nullptr;
             assert(p == nullptr);
@@ -52,5 +47,4 @@
         }
         assert(A::constructed == 0);
     }
-    assert(A::constructed == 0);
 }
diff --git a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
index 37ffb5b..565166c 100644
--- a/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
+++ b/test/std/language.support/support.exception/propagation/rethrow_exception.pass.cpp
@@ -46,12 +46,7 @@
         }
         catch (const A& a)
         {
-#ifndef _LIBCPP_ABI_MICROSOFT
             assert(A::constructed == 1);
-#else
-            // On Windows the exception_ptr copies the exception
-            assert(A::constructed == 2);
-#endif
             assert(p != nullptr);
             p = nullptr;
             assert(p == nullptr);
@@ -60,5 +55,4 @@
         }
         assert(A::constructed == 0);
     }
-    assert(A::constructed == 0);
 }
diff --git a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
index e35e7af..b926715 100644
--- a/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
+++ b/test/std/language.support/support.exception/uncaught/uncaught_exceptions.pass.cpp
@@ -8,14 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-no-exceptions
-// XFAIL: libcpp-no-exceptions
-
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
-// XFAIL: availability=macosx10.9
-// XFAIL: availability=macosx10.10
-// XFAIL: availability=macosx10.11
-
 // test uncaught_exceptions
 
 #include <exception>
diff --git a/test/std/language.support/support.initlist/include_cxx03.pass.cpp b/test/std/language.support/support.initlist/include_cxx03.pass.cpp
deleted file mode 100644
index 8710ddc..0000000
--- a/test/std/language.support/support.initlist/include_cxx03.pass.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <initializer_list>
-
-// Test that the file can be included in C++03
-
-#include <initializer_list>
-
-int main()
-{
-}
diff --git a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
index f6fd556..e51ef7b 100644
--- a/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.access/access.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // template<class E> class initializer_list;
 
 // const E* begin() const;
@@ -21,6 +19,8 @@
 
 #include "test_macros.h"
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 struct A
 {
     A(std::initializer_list<int> il)
@@ -52,9 +52,13 @@
 
 #endif  // TEST_STD_VER > 11
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     A test1 = {3, 2, 1};
+#endif
 #if TEST_STD_VER > 11
     constexpr B test2 = {3, 2, 1};
 #endif  // TEST_STD_VER > 11
diff --git a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
index 2d831c9..e091834 100644
--- a/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.cons/default.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // template<class E> class initializer_list;
 
 // initializer_list();
@@ -22,9 +20,10 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     std::initializer_list<A> il;
     assert(il.size() == 0);
-
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 #if TEST_STD_VER > 11
     constexpr std::initializer_list<A> il2;
     static_assert(il2.size() == 0, "");
diff --git a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
index 102ed64..938025d 100644
--- a/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
+++ b/test/std/language.support/support.initlist/support.initlist.range/begin_end.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <initializer_list>
 
 // template<class E> const E* begin(initializer_list<E> il);
@@ -19,6 +17,8 @@
 
 #include "test_macros.h"
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
+
 struct A
 {
     A(std::initializer_list<int> il)
@@ -49,10 +49,13 @@
 };
 
 #endif  // TEST_STD_VER > 11
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     A test1 = {3, 2, 1};
+#endif
 #if TEST_STD_VER > 11
     constexpr B test2 = {3, 2, 1};
 #endif  // TEST_STD_VER > 11
diff --git a/test/std/language.support/support.initlist/types.pass.cpp b/test/std/language.support/support.initlist/types.pass.cpp
index a301ef9..8358300 100644
--- a/test/std/language.support/support.initlist/types.pass.cpp
+++ b/test/std/language.support/support.initlist/types.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // template<class E>
 // class initializer_list
 // {
@@ -28,10 +26,12 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     static_assert((std::is_same<std::initializer_list<A>::value_type, A>::value), "");
     static_assert((std::is_same<std::initializer_list<A>::reference, const A&>::value), "");
     static_assert((std::is_same<std::initializer_list<A>::const_reference, const A&>::value), "");
     static_assert((std::is_same<std::initializer_list<A>::size_type, std::size_t>::value), "");
     static_assert((std::is_same<std::initializer_list<A>::iterator, const A*>::value), "");
     static_assert((std::is_same<std::initializer_list<A>::const_iterator, const A*>::value), "");
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/language.support/support.types/byte.pass.cpp b/test/std/language.support/support.types/byte.pass.cpp
deleted file mode 100644
index 66b2a55..0000000
--- a/test/std/language.support/support.types/byte.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <type_traits>
-#include <test_macros.h>
-
-// XFAIL: c++98, c++03, c++11, c++14
-
-// std::byte is not an integer type, nor a character type.
-// It is a distinct type for accessing the bits that ultimately make up object storage.
-
-static_assert( std::is_pod<std::byte>::value, "" );
-static_assert(!std::is_arithmetic<std::byte>::value, "" );
-static_assert(!std::is_integral<std::byte>::value, "" );
-
-static_assert(!std::is_same<std::byte,          char>::value, "" );
-static_assert(!std::is_same<std::byte,   signed char>::value, "" );
-static_assert(!std::is_same<std::byte, unsigned char>::value, "" );
-
-// The standard doesn't outright say this, but it's pretty clear that it has to be true.
-static_assert(sizeof(std::byte) == 1, "" );
-
-int main () {}
diff --git a/test/std/language.support/support.types/byteops/and.assign.pass.cpp b/test/std/language.support/support.types/byteops/and.assign.pass.cpp
deleted file mode 100644
index ec1c380..0000000
--- a/test/std/language.support/support.types/byteops/and.assign.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte& operator &=(byte l, byte r) noexcept;
-
-
-constexpr std::byte test(std::byte b1, std::byte b2) {
-	std::byte bret = b1;
-	return bret &= b2;
-	}
-
-
-int main () {
-	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-	constexpr std::byte b9{static_cast<std::byte>(9)};
-
-	static_assert(noexcept(b &= b), "" );
-
-	static_assert(std::to_integer<int>(test(b1, b8)) == 0, "");
-	static_assert(std::to_integer<int>(test(b1, b9)) == 1, "");
-	static_assert(std::to_integer<int>(test(b8, b9)) == 8, "");
-
-	static_assert(std::to_integer<int>(test(b8, b1)) == 0, "");
-	static_assert(std::to_integer<int>(test(b9, b1)) == 1, "");
-	static_assert(std::to_integer<int>(test(b9, b8)) == 8, "");
-}
diff --git a/test/std/language.support/support.types/byteops/and.pass.cpp b/test/std/language.support/support.types/byteops/and.pass.cpp
deleted file mode 100644
index 6c5419c..0000000
--- a/test/std/language.support/support.types/byteops/and.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte operator&(byte l, byte r) noexcept;
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-	constexpr std::byte b9{static_cast<std::byte>(9)};
-
-	static_assert(noexcept(b1 & b8), "" );
-
-	static_assert(std::to_integer<int>(b1 & b8) ==  0, "");
-	static_assert(std::to_integer<int>(b1 & b9) ==  1, "");
-	static_assert(std::to_integer<int>(b8 & b9) ==  8, "");
-
-	static_assert(std::to_integer<int>(b8 & b1) ==  0, "");
-	static_assert(std::to_integer<int>(b9 & b1) ==  1, "");
-	static_assert(std::to_integer<int>(b9 & b8) ==  8, "");
-}
diff --git a/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp b/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp
deleted file mode 100644
index 1576261..0000000
--- a/test/std/language.support/support.types/byteops/enum_direct_init.pass.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0
-
-int main () {
-  constexpr std::byte b{42};
-  static_assert(std::to_integer<int>(b) == 42, "");
-}
diff --git a/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp b/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp
deleted file mode 100644
index 8f68229..0000000
--- a/test/std/language.support/support.types/byteops/lshift.assign.fail.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
-
-// template <class IntegerType>
-//   constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-
-constexpr std::byte test(std::byte b) {
-	return b <<= 2.0;
-	}
-
-
-int main () {
-	constexpr std::byte b1 = test(std::byte{1});
-}
diff --git a/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp b/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
deleted file mode 100644
index abfeebf..0000000
--- a/test/std/language.support/support.types/byteops/lshift.assign.pass.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//   constexpr byte& operator<<=(byte& b, IntegerType shift) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-
-constexpr std::byte test(std::byte b) {
-	return b <<= 2;
-	}
-
-
-int main () {
-	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b2{static_cast<std::byte>(2)};
-	constexpr std::byte b3{static_cast<std::byte>(3)};
-
-	static_assert(noexcept(b <<= 2), "" );
-
-	static_assert(std::to_integer<int>(test(b2)) ==  8, "" );
-	static_assert(std::to_integer<int>(test(b3)) == 12, "" );
-
-}
diff --git a/test/std/language.support/support.types/byteops/lshift.fail.cpp b/test/std/language.support/support.types/byteops/lshift.fail.cpp
deleted file mode 100644
index 707258c..0000000
--- a/test/std/language.support/support.types/byteops/lshift.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr byte operator <<(byte b, IntegerType shift) noexcept;
-// These functions shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b2 = b1 << 2.0f;
-}
diff --git a/test/std/language.support/support.types/byteops/lshift.pass.cpp b/test/std/language.support/support.types/byteops/lshift.pass.cpp
deleted file mode 100644
index 15ad796..0000000
--- a/test/std/language.support/support.types/byteops/lshift.pass.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr byte operator <<(byte b, IntegerType shift) noexcept;
-// These functions shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b3{static_cast<std::byte>(3)};
-
-	static_assert(noexcept(b3 << 2), "" );
-
-	static_assert(std::to_integer<int>(b1 << 1) ==   2, "");
-	static_assert(std::to_integer<int>(b1 << 2) ==   4, "");
-	static_assert(std::to_integer<int>(b3 << 4) ==  48, "");
-	static_assert(std::to_integer<int>(b3 << 6) == 192, "");
-}
diff --git a/test/std/language.support/support.types/byteops/not.pass.cpp b/test/std/language.support/support.types/byteops/not.pass.cpp
deleted file mode 100644
index 53f1d91..0000000
--- a/test/std/language.support/support.types/byteops/not.pass.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte operator~(byte b) noexcept;
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b2{static_cast<std::byte>(2)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-
-	static_assert(noexcept(~b1), "" );
-
-	static_assert(std::to_integer<int>(~b1) == 254, "");
-	static_assert(std::to_integer<int>(~b2) == 253, "");
-	static_assert(std::to_integer<int>(~b8) == 247, "");
-}
diff --git a/test/std/language.support/support.types/byteops/or.assign.pass.cpp b/test/std/language.support/support.types/byteops/or.assign.pass.cpp
deleted file mode 100644
index bb4a84e..0000000
--- a/test/std/language.support/support.types/byteops/or.assign.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte& operator |=(byte l, byte r) noexcept;
-
-
-constexpr std::byte test(std::byte b1, std::byte b2) {
-	std::byte bret = b1;
-	return bret |= b2;
-	}
-
-
-int main () {
-	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b2{static_cast<std::byte>(2)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-
-	static_assert(noexcept(b |= b), "" );
-
-	static_assert(std::to_integer<int>(test(b1, b2)) ==  3, "");
-	static_assert(std::to_integer<int>(test(b1, b8)) ==  9, "");
-	static_assert(std::to_integer<int>(test(b2, b8)) == 10, "");
-
-	static_assert(std::to_integer<int>(test(b2, b1)) ==  3, "");
-	static_assert(std::to_integer<int>(test(b8, b1)) ==  9, "");
-	static_assert(std::to_integer<int>(test(b8, b2)) == 10, "");
-
-}
diff --git a/test/std/language.support/support.types/byteops/or.pass.cpp b/test/std/language.support/support.types/byteops/or.pass.cpp
deleted file mode 100644
index e2b7349..0000000
--- a/test/std/language.support/support.types/byteops/or.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte operator|(byte l, byte r) noexcept;
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b2{static_cast<std::byte>(2)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-
-	static_assert(noexcept(b1 | b2), "" );
-
-	static_assert(std::to_integer<int>(b1 | b2) ==  3, "");
-	static_assert(std::to_integer<int>(b1 | b8) ==  9, "");
-	static_assert(std::to_integer<int>(b2 | b8) == 10, "");
-
-	static_assert(std::to_integer<int>(b2 | b1) ==  3, "");
-	static_assert(std::to_integer<int>(b8 | b1) ==  9, "");
-	static_assert(std::to_integer<int>(b8 | b2) == 10, "");
-}
diff --git a/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp b/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp
deleted file mode 100644
index 44992fa..0000000
--- a/test/std/language.support/support.types/byteops/rshift.assign.fail.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// The following compilers don't like "std::byte b1{1}"
-// UNSUPPORTED: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// UNSUPPORTED: apple-clang-6, apple-clang-7, apple-clang-8.0
-
-// template <class IntegerType>
-//   constexpr byte operator>>(byte& b, IntegerType shift) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-
-constexpr std::byte test(std::byte b) {
-	return b >>= 2.0;
-	}
-
-
-int main () {
-	constexpr std::byte b1 = test(std::byte{1});
-}
diff --git a/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp b/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
deleted file mode 100644
index 82c611c..0000000
--- a/test/std/language.support/support.types/byteops/rshift.assign.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//   constexpr byte& operator>>=(byte& b, IntegerType shift) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-
-constexpr std::byte test(std::byte b) {
-	return b >>= 2;
-	}
-
-
-int main () {
-	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b16{static_cast<std::byte>(16)};
-	constexpr std::byte b192{static_cast<std::byte>(192)};
-
-	static_assert(noexcept(b >>= 2), "" );
-
-	static_assert(std::to_integer<int>(test(b16))  ==  4, "" );
-	static_assert(std::to_integer<int>(test(b192)) == 48, "" );
-}
diff --git a/test/std/language.support/support.types/byteops/rshift.fail.cpp b/test/std/language.support/support.types/byteops/rshift.fail.cpp
deleted file mode 100644
index 8e142dd..0000000
--- a/test/std/language.support/support.types/byteops/rshift.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr byte operator >>(byte b, IntegerType shift) noexcept;
-// These functions shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b2 = b1 >> 2.0f;
-}
diff --git a/test/std/language.support/support.types/byteops/rshift.pass.cpp b/test/std/language.support/support.types/byteops/rshift.pass.cpp
deleted file mode 100644
index 22d3991..0000000
--- a/test/std/language.support/support.types/byteops/rshift.pass.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr byte operator <<(byte b, IntegerType shift) noexcept;
-// These functions shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-
-constexpr std::byte test(std::byte b) {
-	return b <<= 2;
-	}
-
-
-int main () {
-	constexpr std::byte b100{static_cast<std::byte>(100)};
-	constexpr std::byte b115{static_cast<std::byte>(115)};
-
-	static_assert(noexcept(b100 << 2), "" );
-
-	static_assert(std::to_integer<int>(b100 >> 1) ==  50, "");
-	static_assert(std::to_integer<int>(b100 >> 2) ==  25, "");
-	static_assert(std::to_integer<int>(b115 >> 3) ==  14, "");
-	static_assert(std::to_integer<int>(b115 >> 6) ==   1, "");
-
-}
diff --git a/test/std/language.support/support.types/byteops/to_integer.fail.cpp b/test/std/language.support/support.types/byteops/to_integer.fail.cpp
deleted file mode 100644
index fb49289..0000000
--- a/test/std/language.support/support.types/byteops/to_integer.fail.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr IntegerType to_integer(byte b) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	auto f = std::to_integer<float>(b1);
-}
diff --git a/test/std/language.support/support.types/byteops/to_integer.pass.cpp b/test/std/language.support/support.types/byteops/to_integer.pass.cpp
deleted file mode 100644
index 4f34363..0000000
--- a/test/std/language.support/support.types/byteops/to_integer.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// template <class IntegerType>
-//    constexpr IntegerType to_integer(byte b) noexcept;
-// This function shall not participate in overload resolution unless
-//   is_integral_v<IntegerType> is true.
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b3{static_cast<std::byte>(3)};
-
-	static_assert(noexcept(std::to_integer<int>(b1)), "" );
-	static_assert(std::is_same<int, decltype(std::to_integer<int>(b1))>::value, "" );
-	static_assert(std::is_same<long, decltype(std::to_integer<long>(b1))>::value, "" );
-	static_assert(std::is_same<unsigned short, decltype(std::to_integer<unsigned short>(b1))>::value, "" );
-
-	static_assert(std::to_integer<int>(b1) == 1, "");
-	static_assert(std::to_integer<int>(b3) == 3, "");
-}
diff --git a/test/std/language.support/support.types/byteops/xor.assign.pass.cpp b/test/std/language.support/support.types/byteops/xor.assign.pass.cpp
deleted file mode 100644
index 6a526da..0000000
--- a/test/std/language.support/support.types/byteops/xor.assign.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte& operator ^=(byte l, byte r) noexcept;
-
-
-constexpr std::byte test(std::byte b1, std::byte b2) {
-	std::byte bret = b1;
-	return bret ^= b2;
-	}
-
-
-int main () {
-	std::byte b;  // not constexpr, just used in noexcept check
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-	constexpr std::byte b9{static_cast<std::byte>(9)};
-
-	static_assert(noexcept(b ^= b), "" );
-
-	static_assert(std::to_integer<int>(test(b1, b8)) == 9, "");
-	static_assert(std::to_integer<int>(test(b1, b9)) == 8, "");
-	static_assert(std::to_integer<int>(test(b8, b9)) == 1, "");
-
-	static_assert(std::to_integer<int>(test(b8, b1)) == 9, "");
-	static_assert(std::to_integer<int>(test(b9, b1)) == 8, "");
-	static_assert(std::to_integer<int>(test(b9, b8)) == 1, "");
-}
diff --git a/test/std/language.support/support.types/byteops/xor.pass.cpp b/test/std/language.support/support.types/byteops/xor.pass.cpp
deleted file mode 100644
index e8c3b98..0000000
--- a/test/std/language.support/support.types/byteops/xor.pass.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include <cstddef>
-#include <test_macros.h>
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// constexpr byte operator^(byte l, byte r) noexcept;
-
-int main () {
-	constexpr std::byte b1{static_cast<std::byte>(1)};
-	constexpr std::byte b8{static_cast<std::byte>(8)};
-	constexpr std::byte b9{static_cast<std::byte>(9)};
-
-	static_assert(noexcept(b1 ^ b8), "" );
-
-	static_assert(std::to_integer<int>(b1 ^ b8) == 9, "");
-	static_assert(std::to_integer<int>(b1 ^ b9) == 8, "");
-	static_assert(std::to_integer<int>(b8 ^ b9) == 1, "");
-
-	static_assert(std::to_integer<int>(b8 ^ b1) == 9, "");
-	static_assert(std::to_integer<int>(b9 ^ b1) == 8, "");
-	static_assert(std::to_integer<int>(b9 ^ b8) == 1, "");
-}
diff --git a/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp b/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
index 06c171f..044ba2b 100644
--- a/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/ctype_base.pass.cpp
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <locale>
 
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
index a9a8720..4488e9c 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_1.pass.cpp
@@ -15,6 +15,9 @@
 
 // charT tolower(charT) const;
 
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 #include <locale>
 #include <cassert>
 
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
index 67fe449..0c224e3 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/tolower_many.pass.cpp
@@ -15,6 +15,9 @@
 
 // const charT* tolower(charT* low, const charT* high) const;
 
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 #include <locale>
 #include <string>
 #include <cassert>
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
index 271ae2c..0985de5 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_1.pass.cpp
@@ -15,6 +15,9 @@
 
 // charT toupper(charT) const;
 
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 
 #include <locale>
 #include <cassert>
diff --git a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
index 6507135..ba04775 100644
--- a/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
+++ b/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/toupper_many.pass.cpp
@@ -15,6 +15,9 @@
 
 // const charT* toupper(charT* low, const charT* high) const;
 
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 #include <locale>
 #include <string>
 #include <cassert>
diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
index 7776c67..ec563fe 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp
@@ -7,8 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This test is passing in an uncontrolled manner in some Apple environment.
-// UNSUPPORTED: apple-darwin
+// XFAIL: apple-darwin
 
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // and U002E as mon_decimal_point.
diff --git a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
index 4d805b0..54bfcfb 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.money.put/locale.money.put.members/put_long_double_ru_RU.pass.cpp
@@ -7,8 +7,7 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This test is passing in an uncontrolled manner in some Apple environment.
-// UNSUPPORTED: apple-darwin
+// XFAIL: apple-darwin
 
 // Failure related to GLIBC's use of U00A0 as mon_thousands_sep
 // and U002E as mon_decimal_point.
diff --git a/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp b/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
index 323d856..32e7249 100644
--- a/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
+++ b/test/std/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <locale>
 
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
index e3367b2..6d7f506 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
@@ -7,10 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR11871
-// XFAIL: with_system_cxx_lib=macosx10.7
-// PR15445
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <locale>
 
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
index 174312d..d01f63d 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
@@ -6,9 +6,6 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
-//
-// PR11871
-// XFAIL: with_system_cxx_lib=macosx10.7
 
 // <locale>
 
@@ -197,16 +194,4 @@
         assert(v == -HUGE_VALF);
 
     }
-    {
-        v = -1;
-        const char str[] = "2-";
-        std::ios_base::iostate err = ios.goodbit;
-        input_iterator<const char*> iter =
-            f.get(input_iterator<const char*>(str),
-                  input_iterator<const char*>(str+sizeof(str)),
-                  ios, err, v);
-        assert(iter.base() == str+1);
-        assert(err == ios.goodbit);
-        assert(v == 2);
-    }
 }
diff --git a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
index cf671b0..b79650b 100644
--- a/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
+++ b/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
@@ -6,9 +6,6 @@
 // Source Licenses. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
-//
-// PR11871
-// XFAIL: with_system_cxx_lib=macosx10.7
 
 // <locale>
 
@@ -256,16 +253,4 @@
         assert(err == ios.failbit);
         assert(v == -HUGE_VALL);
     }
-    {
-        v = -1;
-        const char str[] = "2-";
-        std::ios_base::iostate err = ios.goodbit;
-        input_iterator<const char*> iter =
-            f.get(input_iterator<const char*>(str),
-                  input_iterator<const char*>(str+sizeof(str)),
-                  ios, err, v);
-        assert(iter.base() == str+1);
-        assert(err == ios.goodbit);
-        assert(v == 2);
-    }
 }
diff --git a/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp b/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
index b90c41e..2eb6978 100644
--- a/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
+++ b/test/std/localization/locale.stdcvt/codecvt_utf16_out.pass.cpp
@@ -25,329 +25,307 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
+int main()
+{
+    {
+        typedef std::codecvt_utf16<wchar_t> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xD8));
+        assert(n[1] == char(0xC0));
+        assert(n[2] == char(0xDC));
+        assert(n[3] == char(0x03));
 
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  // Nothing to do, the conversion in unsupported
-}
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0x10));
+        assert(n[1] == char(0x05));
+        assert(n[2] == char(0xDC));
+        assert(n[3] == char(0x03));
 
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  {
-    typedef std::codecvt_utf16<CharT> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xD8));
-    assert(n[1] == char(0xC0));
-    assert(n[2] == char(0xDC));
-    assert(n[3] == char(0x03));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0x04));
+        assert(n[1] == char(0x53));
+        assert(n[2] == char(0xDC));
+        assert(n[3] == char(0x03));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0x10));
-    assert(n[1] == char(0x05));
-    assert(n[2] == char(0xDC));
-    assert(n[3] == char(0x03));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0x00));
+        assert(n[1] == char(0x56));
+        assert(n[2] == char(0xDC));
+        assert(n[3] == char(0x03));
+    }
+    {
+        typedef std::codecvt_utf16<wchar_t, 0x1000> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0x04));
-    assert(n[1] == char(0x53));
-    assert(n[2] == char(0xDC));
-    assert(n[3] == char(0x03));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0x00));
-    assert(n[1] == char(0x56));
-    assert(n[2] == char(0xDC));
-    assert(n[3] == char(0x03));
-  }
-  {
-    typedef std::codecvt_utf16<CharT, 0x1000> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[0] == char(0));
-    assert(n[1] == char(0));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0x04));
+        assert(n[1] == char(0x53));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[0] == char(0));
-    assert(n[1] == char(0));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0x00));
+        assert(n[1] == char(0x56));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+    }
+    {
+        typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::generate_header> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[6] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xFE));
+        assert(n[1] == char(0xFF));
+        assert(n[2] == char(0xD8));
+        assert(n[3] == char(0xC0));
+        assert(n[4] == char(0xDC));
+        assert(n[5] == char(0x03));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0x04));
-    assert(n[1] == char(0x53));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xFE));
+        assert(n[1] == char(0xFF));
+        assert(n[2] == char(0x10));
+        assert(n[3] == char(0x05));
+        assert(n[4] == char(0xDC));
+        assert(n[5] == char(0x03));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0x00));
-    assert(n[1] == char(0x56));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
-  }
-  {
-    typedef std::codecvt_utf16<CharT, 0x10ffff, std::generate_header> C;
-    C c;
-    CharT w = 0x40003;
-    char n[6] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 6);
-    assert(n[0] == char(0xFE));
-    assert(n[1] == char(0xFF));
-    assert(n[2] == char(0xD8));
-    assert(n[3] == char(0xC0));
-    assert(n[4] == char(0xDC));
-    assert(n[5] == char(0x03));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xFE));
+        assert(n[1] == char(0xFF));
+        assert(n[2] == char(0x04));
+        assert(n[3] == char(0x53));
+        assert(n[4] == char(0xDC));
+        assert(n[5] == char(0x03));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xFE));
-    assert(n[1] == char(0xFF));
-    assert(n[2] == char(0x10));
-    assert(n[3] == char(0x05));
-    assert(n[4] == char(0xDC));
-    assert(n[5] == char(0x03));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xFE));
+        assert(n[1] == char(0xFF));
+        assert(n[2] == char(0x00));
+        assert(n[3] == char(0x56));
+        assert(n[4] == char(0xDC));
+        assert(n[5] == char(0x03));
+    }
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xFE));
-    assert(n[1] == char(0xFF));
-    assert(n[2] == char(0x04));
-    assert(n[3] == char(0x53));
-    assert(n[4] == char(0xDC));
-    assert(n[5] == char(0x03));
+    {
+        typedef std::codecvt_utf16<wchar_t, 0x10FFFF, std::little_endian> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[1] == char(0xD8));
+        assert(n[0] == char(0xC0));
+        assert(n[3] == char(0xDC));
+        assert(n[2] == char(0x03));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xFE));
-    assert(n[1] == char(0xFF));
-    assert(n[2] == char(0x00));
-    assert(n[3] == char(0x56));
-    assert(n[4] == char(0xDC));
-    assert(n[5] == char(0x03));
-  }
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[1] == char(0x10));
+        assert(n[0] == char(0x05));
+        assert(n[3] == char(0xDC));
+        assert(n[2] == char(0x03));
 
-  {
-    typedef std::codecvt_utf16<CharT, 0x10FFFF, std::little_endian> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[1] == char(0xD8));
-    assert(n[0] == char(0xC0));
-    assert(n[3] == char(0xDC));
-    assert(n[2] == char(0x03));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[1] == char(0x04));
+        assert(n[0] == char(0x53));
+        assert(n[3] == char(0xDC));
+        assert(n[2] == char(0x03));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[1] == char(0x10));
-    assert(n[0] == char(0x05));
-    assert(n[3] == char(0xDC));
-    assert(n[2] == char(0x03));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[1] == char(0x00));
+        assert(n[0] == char(0x56));
+        assert(n[3] == char(0xDC));
+        assert(n[2] == char(0x03));
+    }
+    {
+        typedef std::codecvt_utf16<wchar_t, 0x1000, std::little_endian> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[1] == char(0));
+        assert(n[0] == char(0));
+        assert(n[3] == char(0));
+        assert(n[2] == char(0));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[1] == char(0x04));
-    assert(n[0] == char(0x53));
-    assert(n[3] == char(0xDC));
-    assert(n[2] == char(0x03));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[1] == char(0));
+        assert(n[0] == char(0));
+        assert(n[3] == char(0));
+        assert(n[2] == char(0));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[1] == char(0x00));
-    assert(n[0] == char(0x56));
-    assert(n[3] == char(0xDC));
-    assert(n[2] == char(0x03));
-  }
-  {
-    typedef std::codecvt_utf16<CharT, 0x1000, std::little_endian> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[1] == char(0));
-    assert(n[0] == char(0));
-    assert(n[3] == char(0));
-    assert(n[2] == char(0));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[1] == char(0x04));
+        assert(n[0] == char(0x53));
+        assert(n[3] == char(0));
+        assert(n[2] == char(0));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[1] == char(0));
-    assert(n[0] == char(0));
-    assert(n[3] == char(0));
-    assert(n[2] == char(0));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[1] == char(0x00));
+        assert(n[0] == char(0x56));
+        assert(n[3] == char(0));
+        assert(n[2] == char(0));
+    }
+    {
+        typedef std::codecvt_utf16<wchar_t, 0x10ffff, std::codecvt_mode(
+                                                         std::generate_header |
+                                                         std::little_endian)> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[6] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+6);
+        assert(n[1] == char(0xFE));
+        assert(n[0] == char(0xFF));
+        assert(n[3] == char(0xD8));
+        assert(n[2] == char(0xC0));
+        assert(n[5] == char(0xDC));
+        assert(n[4] == char(0x03));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[1] == char(0x04));
-    assert(n[0] == char(0x53));
-    assert(n[3] == char(0));
-    assert(n[2] == char(0));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[1] == char(0xFE));
+        assert(n[0] == char(0xFF));
+        assert(n[3] == char(0x10));
+        assert(n[2] == char(0x05));
+        assert(n[5] == char(0xDC));
+        assert(n[4] == char(0x03));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[1] == char(0x00));
-    assert(n[0] == char(0x56));
-    assert(n[3] == char(0));
-    assert(n[2] == char(0));
-  }
-  {
-    typedef std::codecvt_utf16<CharT, 0x10ffff,
-                               std::codecvt_mode(std::generate_header |
-                                                 std::little_endian)>
-        C;
-    C c;
-    CharT w = 0x40003;
-    char n[6] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 6);
-    assert(n[1] == char(0xFE));
-    assert(n[0] == char(0xFF));
-    assert(n[3] == char(0xD8));
-    assert(n[2] == char(0xC0));
-    assert(n[5] == char(0xDC));
-    assert(n[4] == char(0x03));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[1] == char(0xFE));
+        assert(n[0] == char(0xFF));
+        assert(n[3] == char(0x04));
+        assert(n[2] == char(0x53));
+        assert(n[5] == char(0xDC));
+        assert(n[4] == char(0x03));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[1] == char(0xFE));
-    assert(n[0] == char(0xFF));
-    assert(n[3] == char(0x10));
-    assert(n[2] == char(0x05));
-    assert(n[5] == char(0xDC));
-    assert(n[4] == char(0x03));
-
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[1] == char(0xFE));
-    assert(n[0] == char(0xFF));
-    assert(n[3] == char(0x04));
-    assert(n[2] == char(0x53));
-    assert(n[5] == char(0xDC));
-    assert(n[4] == char(0x03));
-
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 6, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[1] == char(0xFE));
-    assert(n[0] == char(0xFF));
-    assert(n[3] == char(0x00));
-    assert(n[2] == char(0x56));
-    assert(n[5] == char(0xDC));
-    assert(n[4] == char(0x03));
-  }
-}
-
-int main() {
-  TestHelper<char32_t>::test();
-  TestHelper<wchar_t>::test();
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+6, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[1] == char(0xFE));
+        assert(n[0] == char(0xFF));
+        assert(n[3] == char(0x00));
+        assert(n[2] == char(0x56));
+        assert(n[5] == char(0xDC));
+        assert(n[4] == char(0x03));
+    }
 }
diff --git a/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp b/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
index 886fc44..02cf7cf 100644
--- a/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
+++ b/test/std/localization/locale.stdcvt/codecvt_utf8_out.pass.cpp
@@ -25,302 +25,432 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
+int main()
+{
+    {
+        typedef std::codecvt_utf8<wchar_t> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xF1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x80));
+        assert(n[3] == char(0x83));
 
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
 
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
 
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  {
-    typedef std::codecvt_utf8<CharT> C;
-    C c;
-    CharT w = 0x1005;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 3);
-    assert(n[0] == char(0xE1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
+    }
+    {
+        typedef std::codecvt_utf8<wchar_t, 0x1000> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0));
-  }
-  {
-    typedef std::codecvt_utf8<CharT, 0x1000> C;
-    C c;
-    CharT w = 0x1005;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[0] == char(0));
-    assert(n[1] == char(0));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+    }
+    {
+        typedef std::codecvt_utf8<wchar_t, 0xFFFFFFFF, std::generate_header> C;
+        C c;
+        wchar_t w = 0x40003;
+        char n[7] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+7);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xF1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x80));
+        assert(n[6] == char(0x83));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
-  }
-  {
-    typedef std::codecvt_utf8<CharT, 0xFFFFFFFF, std::generate_header> C;
-    C c;
-    CharT w = 0x1005;
-    char n[7] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 6);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xE1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 5);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xD1));
-    assert(n[4] == char(0x93));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0x56));
-    assert(n[4] == char(0x93));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0));
-  }
-}
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
+    }
+    {
+        typedef std::codecvt_utf8<char32_t> C;
+        C c;
+        char32_t w = 0x40003;
+        char n[4] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xF1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x80));
+        assert(n[3] == char(0x83));
 
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  {
-    typedef std::codecvt_utf8<CharT> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xF1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x80));
-    assert(n[3] == char(0x83));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 3);
-    assert(n[0] == char(0xE1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0x83));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0x83));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0x83));
+    }
+    {
+        typedef std::codecvt_utf8<char32_t, 0x1000> C;
+        C c;
+        char32_t w = 0x40003;
+        char n[4] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0x85));
-    assert(n[3] == char(0x83));
-  }
-  {
-    typedef std::codecvt_utf8<CharT, 0x1000> C;
-    C c;
-    CharT w = 0x40003;
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[0] == char(0));
-    assert(n[1] == char(0));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == &w);
-    assert(np == n);
-    assert(n[0] == char(0));
-    assert(n[1] == char(0));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+    }
+    {
+        typedef std::codecvt_utf8<char32_t, 0xFFFFFFFF, std::generate_header> C;
+        C c;
+        char32_t w = 0x40003;
+        char n[7] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+7);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xF1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x80));
+        assert(n[6] == char(0x83));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-    assert(n[1] == char(0x93));
-    assert(n[2] == char(0));
-    assert(n[3] == char(0));
-  }
-  {
-    typedef std::codecvt_utf8<CharT, 0xFFFFFFFF, std::generate_header> C;
-    C c;
-    CharT w = 0x40003;
-    char n[7] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 7);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xF1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x80));
-    assert(n[6] == char(0x83));
+        w = 0x1005;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
 
-    w = 0x1005;
-    r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 6);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xE1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0x83));
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
 
-    w = 0x453;
-    r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 5);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xD1));
-    assert(n[4] == char(0x93));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0x83));
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0x83));
+    }
+    {
+        typedef std::codecvt_utf8<char16_t> C;
+        C c;
+        char16_t w = 0x1005;
+        char n[4] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0));
 
-    w = 0x56;
-    r = c.out(m, &w, &w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == &w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0x56));
-    assert(n[4] == char(0x93));
-    assert(n[5] == char(0x85));
-    assert(n[6] == char(0x83));
-  }
-}
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0));
 
-int main() {
-  TestHelper<wchar_t>::test();
-  TestHelper<char32_t>::test();
-  TestHelper<char16_t>::test();
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0x85));
+        assert(n[3] == char(0));
+    }
+    {
+        typedef std::codecvt_utf8<char16_t, 0x1000> C;
+        C c;
+        char16_t w = 0x1005;
+        char n[4] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == &w);
+        assert(np == n);
+        assert(n[0] == char(0));
+        assert(n[1] == char(0));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+        assert(n[1] == char(0x93));
+        assert(n[2] == char(0));
+        assert(n[3] == char(0));
+    }
+    {
+        typedef std::codecvt_utf8<char16_t, 0xFFFFFFFF, std::generate_header> C;
+        C c;
+        char16_t w = 0x1005;
+        char n[7] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0));
+
+        w = 0x453;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0));
+
+        w = 0x56;
+        r = c.out(m, &w, &w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == &w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+        assert(n[4] == char(0x93));
+        assert(n[5] == char(0x85));
+        assert(n[6] == char(0));
+    }
 }
diff --git a/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp b/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
index 392d66f..0cd9417 100644
--- a/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
+++ b/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_in.pass.cpp
@@ -25,220 +25,348 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
+int main()
+{
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t> C;
+        C c;
+        wchar_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
 
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x1000> C;
-    C c;
-    CharT w[2] = {0};
-    char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
-    CharT* wp = nullptr;
-    std::mbstate_t m;
-    const char* np = nullptr;
-    std::codecvt_base::result r = c.in(m, n, n + 4, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
 
-    n[0] = char(0xE1);
-    n[1] = char(0x80);
-    n[2] = char(0x85);
-    r = c.in(m, n, n + 3, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-    n[0] = char(0xD1);
-    n[1] = char(0x93);
-    r = c.in(m, n, n + 2, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(w[0] == 0x0453);
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t, 0x1000> C;
+        C c;
+        wchar_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    n[0] = char(0x56);
-    r = c.in(m, n, n + 1, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(w[0] == 0x0056);
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x10ffff, std::consume_header> C;
-    C c;
-    CharT w[2] = {0};
-    char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1),
-                 char(0x80), char(0x80), char(0x83)};
-    CharT* wp = nullptr;
-    std::mbstate_t m;
-    const char* np = nullptr;
-    std::codecvt_base::result r = c.in(m, n, n + 7, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 7);
-    assert(w[0] == 0xD8C0);
-    assert(w[1] == 0xDC03);
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    n[0] = char(0xE1);
-    n[1] = char(0x80);
-    n[2] = char(0x85);
-    r = c.in(m, n, n + 3, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 3);
-    assert(w[0] == 0x1005);
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-    n[0] = char(0xD1);
-    n[1] = char(0x93);
-    r = c.in(m, n, n + 2, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(w[0] == 0x0453);
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t, 0x10ffff, std::consume_header> C;
+        C c;
+        wchar_t w[2] = {0};
+        char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
+        wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+7, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
 
-    n[0] = char(0x56);
-    r = c.in(m, n, n + 1, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(w[0] == 0x0056);
-  }
-}
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
 
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  {
-    typedef std::codecvt_utf8_utf16<CharT> C;
-    C c;
-    CharT w[2] = {0};
-    char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
-    CharT* wp = nullptr;
-    std::mbstate_t m;
-    const char* np = nullptr;
-    std::codecvt_base::result r = c.in(m, n, n + 4, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 4);
-    assert(w[0] == 0xD8C0);
-    assert(w[1] == 0xDC03);
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-    n[0] = char(0xE1);
-    n[1] = char(0x80);
-    n[2] = char(0x85);
-    r = c.in(m, n, n + 3, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 3);
-    assert(w[0] == 0x1005);
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t> C;
+        C c;
+        char32_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char32_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
 
-    n[0] = char(0xD1);
-    n[1] = char(0x93);
-    r = c.in(m, n, n + 2, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(w[0] == 0x0453);
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
 
-    n[0] = char(0x56);
-    r = c.in(m, n, n + 1, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(w[0] == 0x0056);
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x1000> C;
-    C c;
-    CharT w[2] = {0};
-    char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
-    CharT* wp = nullptr;
-    std::mbstate_t m;
-    const char* np = nullptr;
-    std::codecvt_base::result r = c.in(m, n, n + 4, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-    n[0] = char(0xE1);
-    n[1] = char(0x80);
-    n[2] = char(0x85);
-    r = c.in(m, n, n + 3, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t, 0x1000> C;
+        C c;
+        char32_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char32_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    n[0] = char(0xD1);
-    n[1] = char(0x93);
-    r = c.in(m, n, n + 2, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(w[0] == 0x0453);
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    n[0] = char(0x56);
-    r = c.in(m, n, n + 1, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(w[0] == 0x0056);
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x10ffff, std::consume_header> C;
-    C c;
-    CharT w[2] = {0};
-    char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1),
-                 char(0x80), char(0x80), char(0x83)};
-    CharT* wp = nullptr;
-    std::mbstate_t m;
-    const char* np = nullptr;
-    std::codecvt_base::result r = c.in(m, n, n + 7, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 7);
-    assert(w[0] == 0xD8C0);
-    assert(w[1] == 0xDC03);
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-    n[0] = char(0xE1);
-    n[1] = char(0x80);
-    n[2] = char(0x85);
-    r = c.in(m, n, n + 3, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 3);
-    assert(w[0] == 0x1005);
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t, 0x10ffff, std::consume_header> C;
+        C c;
+        char32_t w[2] = {0};
+        char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char32_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+7, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
 
-    n[0] = char(0xD1);
-    n[1] = char(0x93);
-    r = c.in(m, n, n + 2, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(w[0] == 0x0453);
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
 
-    n[0] = char(0x56);
-    r = c.in(m, n, n + 1, np, w, w + 2, wp);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(w[0] == 0x0056);
-  }
-}
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
 
-int main() {
-#ifndef _WIN32
-  TestHelper<wchar_t>::test();
-#endif
-  TestHelper<char32_t>::test();
-  TestHelper<char16_t>::test();
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char16_t> C;
+        C c;
+        char16_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char16_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
+
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
+
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
+
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char16_t, 0x1000> C;
+        C c;
+        char16_t w[2] = {0};
+        char n[4] = {char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char16_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+4, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
+
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
+
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
+
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char16_t, 0x10ffff, std::consume_header> C;
+        C c;
+        char16_t w[2] = {0};
+        char n[7] = {char(0xEF), char(0xBB), char(0xBF), char(0xF1), char(0x80), char(0x80), char(0x83)};
+        char16_t* wp = nullptr;
+        std::mbstate_t m;
+        const char* np = nullptr;
+        std::codecvt_base::result r = c.in(m, n, n+7, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(w[0] == 0xD8C0);
+        assert(w[1] == 0xDC03);
+
+        n[0] = char(0xE1);
+        n[1] = char(0x80);
+        n[2] = char(0x85);
+        r = c.in(m, n, n+3, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(w[0] == 0x1005);
+
+        n[0] = char(0xD1);
+        n[1] = char(0x93);
+        r = c.in(m, n, n+2, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(w[0] == 0x0453);
+
+        n[0] = char(0x56);
+        r = c.in(m, n, n+1, np, w, w+2, wp);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(w[0] == 0x0056);
+    }
 }
diff --git a/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp b/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
index ced2a36..29c5342 100644
--- a/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
+++ b/test/std/localization/locale.stdcvt/codecvt_utf8_utf16_out.pass.cpp
@@ -25,285 +25,391 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
+int main()
+{
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t> C;
+        C c;
+        wchar_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(n[0] == char(0xF1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x80));
+        assert(n[3] == char(0x83));
 
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  {
-    typedef std::codecvt_utf8_utf16<CharT> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 4);
-    assert(n[0] == char(0xF1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x80));
-    assert(n[3] == char(0x83));
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 3);
-    assert(n[0] == char(0xE1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x85));
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t, 0x1000> C;
+        C c;
+        wchar_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x1000> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<wchar_t, 0x10ffff, std::generate_header> C;
+        C c;
+        wchar_t w[2] = {0xD8C0, 0xDC03};
+        char n[7] = {0};
+        const wchar_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xF1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x80));
+        assert(n[6] == char(0x83));
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x10ffff, std::generate_header> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[7] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 7);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xF1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x80));
-    assert(n[6] == char(0x83));
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 6);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xE1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x85));
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 5);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xD1));
-    assert(n[4] == char(0x93));
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t> C;
+        C c;
+        char32_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(n[0] == char(0xF1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x80));
+        assert(n[3] == char(0x83));
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0x56));
-  }
-}
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
 
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  {
-    typedef std::codecvt_utf8_utf16<CharT> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 4);
-    assert(n[0] == char(0xF1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x80));
-    assert(n[3] == char(0x83));
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 3);
-    assert(n[0] == char(0xE1));
-    assert(n[1] == char(0x80));
-    assert(n[2] == char(0x85));
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t, 0x1000> C;
+        C c;
+        char32_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x1000> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[4] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::error);
-    assert(wp == w);
-    assert(np == n);
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char32_t, 0x10ffff, std::generate_header> C;
+        C c;
+        char32_t w[2] = {0xD8C0, 0xDC03};
+        char n[7] = {0};
+        const char32_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xF1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x80));
+        assert(n[6] == char(0x83));
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 2);
-    assert(n[0] == char(0xD1));
-    assert(n[1] == char(0x93));
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 4, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 1);
-    assert(n[0] == char(0x56));
-  }
-  {
-    typedef std::codecvt_utf8_utf16<CharT, 0x10ffff, std::generate_header> C;
-    C c;
-    CharT w[2] = {0xD8C0, 0xDC03};
-    char n[7] = {0};
-    const CharT* wp = nullptr;
-    std::mbstate_t m;
-    char* np = nullptr;
-    std::codecvt_base::result r = c.out(m, w, w + 2, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 2);
-    assert(np == n + 7);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xF1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x80));
-    assert(n[6] == char(0x83));
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
 
-    w[0] = 0x1005;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 6);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xE1));
-    assert(n[4] == char(0x80));
-    assert(n[5] == char(0x85));
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+    }
 
-    w[0] = 0x453;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 5);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0xD1));
-    assert(n[4] == char(0x93));
+    {
+        typedef std::codecvt_utf8_utf16<char16_t> C;
+        C c;
+        char16_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+4);
+        assert(n[0] == char(0xF1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x80));
+        assert(n[3] == char(0x83));
 
-    w[0] = 0x56;
-    r = c.out(m, w, w + 1, wp, n, n + 7, np);
-    assert(r == std::codecvt_base::ok);
-    assert(wp == w + 1);
-    assert(np == n + 4);
-    assert(n[0] == char(0xEF));
-    assert(n[1] == char(0xBB));
-    assert(n[2] == char(0xBF));
-    assert(n[3] == char(0x56));
-  }
-}
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+3);
+        assert(n[0] == char(0xE1));
+        assert(n[1] == char(0x80));
+        assert(n[2] == char(0x85));
 
-int main() {
-#ifndef _WIN32
-  TestHelper<wchar_t>::test();
-#endif
-  TestHelper<char32_t>::test();
-  TestHelper<char16_t>::test();
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char16_t, 0x1000> C;
+        C c;
+        char16_t w[2] = {0xD8C0, 0xDC03};
+        char n[4] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
+
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::error);
+        assert(wp == w);
+        assert(np == n);
+
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+2);
+        assert(n[0] == char(0xD1));
+        assert(n[1] == char(0x93));
+
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+4, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+1);
+        assert(n[0] == char(0x56));
+    }
+    {
+        typedef std::codecvt_utf8_utf16<char16_t, 0x10ffff, std::generate_header> C;
+        C c;
+        char16_t w[2] = {0xD8C0, 0xDC03};
+        char n[7] = {0};
+        const char16_t* wp = nullptr;
+        std::mbstate_t m;
+        char* np = nullptr;
+        std::codecvt_base::result r = c.out(m, w, w+2, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+2);
+        assert(np == n+7);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xF1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x80));
+        assert(n[6] == char(0x83));
+
+        w[0] = 0x1005;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+6);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xE1));
+        assert(n[4] == char(0x80));
+        assert(n[5] == char(0x85));
+
+        w[0] = 0x453;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+5);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0xD1));
+        assert(n[4] == char(0x93));
+
+        w[0] = 0x56;
+        r = c.out(m, w, w+1, wp, n, n+7, np);
+        assert(r == std::codecvt_base::ok);
+        assert(wp == w+1);
+        assert(np == n+4);
+        assert(n[0] == char(0xEF));
+        assert(n[1] == char(0xBB));
+        assert(n[2] == char(0xBF));
+        assert(n[3] == char(0x56));
+    }
 }
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
index 480628f..06df185 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/converted.pass.cpp
@@ -17,39 +17,9 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
-
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    typedef std::codecvt_utf8<CharT> Codecvt;
-    typedef std::wstring_convert<Codecvt> Myconv;
-    Myconv myconv;
-    assert(myconv.converted() == 0);
-    std::string bs = myconv.to_bytes(L"\x1005");
-    assert(myconv.converted() == 1);
-    bs = myconv.to_bytes(L"\x1005\x65");
-    assert(myconv.converted() == 2);
-    std::wstring ws = myconv.from_bytes("\xE1\x80\x85");
-    assert(myconv.converted() == 3);
-  }
-}
-
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    typedef std::codecvt_utf8<CharT> Codecvt;
+int main()
+{
+    typedef std::codecvt_utf8<wchar_t> Codecvt;
     typedef std::wstring_convert<Codecvt> Myconv;
     Myconv myconv;
     assert(myconv.converted() == 0);
@@ -59,7 +29,4 @@
     assert(myconv.converted() == 2);
     std::wstring ws = myconv.from_bytes("\xF1\x80\x80\x83");
     assert(myconv.converted() == 4);
-  }
 }
-
-int main() { TestHelper<wchar_t>::test(); }
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
index 2e627b7..8705a5f 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/from_bytes.pass.cpp
@@ -20,53 +20,20 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
-
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    std::wstring_convert<std::codecvt_utf8<CharT> > myconv;
-    std::string bs("\xE1\x80\x85\x00");
-    std::wstring ws = myconv.from_bytes('a');
-    assert(ws == L"a");
-    ws = myconv.from_bytes(bs.c_str());
-    assert(ws == L"\x1005");
-    ws = myconv.from_bytes(bs);
-    assert(ws == L"\x1005");
-    ws = myconv.from_bytes(bs.data(), bs.data() + bs.size());
-    assert(ws == L"\x1005");
-    ws = myconv.from_bytes("");
-    assert(ws.size() == 0);
-  }
+int main()
+{
+    {
+        std::wstring_convert<std::codecvt_utf8<wchar_t> > myconv;
+        std::string bs("\xF1\x80\x80\x83");
+        std::wstring ws = myconv.from_bytes('a');
+        assert(ws == L"a");
+        ws = myconv.from_bytes(bs.c_str());
+        assert(ws == L"\x40003");
+        ws = myconv.from_bytes(bs);
+        assert(ws == L"\x40003");
+        ws = myconv.from_bytes(bs.data(), bs.data() + bs.size());
+        assert(ws == L"\x40003");
+        ws = myconv.from_bytes("");
+        assert(ws.size() == 0);
+    }
 }
-
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    std::wstring_convert<std::codecvt_utf8<CharT> > myconv;
-    std::string bs("\xF1\x80\x80\x83");
-    std::wstring ws = myconv.from_bytes('a');
-    assert(ws == L"a");
-    ws = myconv.from_bytes(bs.c_str());
-    assert(ws == L"\x40003");
-    ws = myconv.from_bytes(bs);
-    assert(ws == L"\x40003");
-    ws = myconv.from_bytes(bs.data(), bs.data() + bs.size());
-    assert(ws == L"\x40003");
-    ws = myconv.from_bytes("");
-    assert(ws.size() == 0);
-  }
-}
-
-int main() { TestHelper<wchar_t>::test(); }
diff --git a/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp b/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
index 0a6cab7..7253a18 100644
--- a/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
+++ b/test/std/localization/locales/locale.convenience/conversions/conversions.string/to_bytes.pass.cpp
@@ -20,53 +20,20 @@
 #include <codecvt>
 #include <cassert>
 
-template <class CharT, size_t = sizeof(CharT)>
-struct TestHelper;
-template <class CharT>
-struct TestHelper<CharT, 2> {
-  static void test();
-};
-template <class CharT>
-struct TestHelper<CharT, 4> {
-  static void test();
-};
-
-template <class CharT>
-void TestHelper<CharT, 2>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    std::wstring_convert<std::codecvt_utf8<CharT> > myconv;
-    std::wstring ws(1, CharT(0x1005));
-    std::string bs = myconv.to_bytes(ws[0]);
-    assert(bs == "\xE1\x80\x85\x00");
-    bs = myconv.to_bytes(ws.c_str());
-    assert(bs == "\xE1\x80\x85\x00");
-    bs = myconv.to_bytes(ws);
-    assert(bs == "\xE1\x80\x85\x00");
-    bs = myconv.to_bytes(ws.data(), ws.data() + ws.size());
-    assert(bs == "\xE1\x80\x85\x00");
-    bs = myconv.to_bytes(L"");
-    assert(bs.size() == 0);
-  }
+int main()
+{
+    {
+        std::wstring_convert<std::codecvt_utf8<wchar_t> > myconv;
+        std::wstring ws(1, L'\x40003');
+        std::string bs = myconv.to_bytes(ws[0]);
+        assert(bs == "\xF1\x80\x80\x83");
+        bs = myconv.to_bytes(ws.c_str());
+        assert(bs == "\xF1\x80\x80\x83");
+        bs = myconv.to_bytes(ws);
+        assert(bs == "\xF1\x80\x80\x83");
+        bs = myconv.to_bytes(ws.data(), ws.data() + ws.size());
+        assert(bs == "\xF1\x80\x80\x83");
+        bs = myconv.to_bytes(L"");
+        assert(bs.size() == 0);
+    }
 }
-
-template <class CharT>
-void TestHelper<CharT, 4>::test() {
-  static_assert((std::is_same<CharT, wchar_t>::value), "");
-  {
-    std::wstring_convert<std::codecvt_utf8<CharT> > myconv;
-    std::wstring ws(1, CharT(0x40003));
-    std::string bs = myconv.to_bytes(ws[0]);
-    assert(bs == "\xF1\x80\x80\x83");
-    bs = myconv.to_bytes(ws.c_str());
-    assert(bs == "\xF1\x80\x80\x83");
-    bs = myconv.to_bytes(ws);
-    assert(bs == "\xF1\x80\x80\x83");
-    bs = myconv.to_bytes(ws.data(), ws.data() + ws.size());
-    assert(bs == "\xF1\x80\x80\x83");
-    bs = myconv.to_bytes(L"");
-    assert(bs.size() == 0);
-  }
-}
-
-int main() { TestHelper<wchar_t>::test(); }
diff --git a/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp b/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
index e25fe38..eb381f9 100644
--- a/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
+++ b/test/std/localization/locales/locale/locale.cons/locale_char_pointer_cat.pass.cpp
@@ -9,10 +9,6 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8
-// UNSUPPORTED: sanitizer-new-delete
-
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
 
 // <locale>
 
diff --git a/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp b/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
index 72d47a3..f1afff6 100644
--- a/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
+++ b/test/std/localization/locales/locale/locale.cons/locale_locale_cat.pass.cpp
@@ -9,10 +9,6 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8
-// UNSUPPORTED: sanitizer-new-delete
-
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
 
 // <locale>
 
diff --git a/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp b/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
index 26ddfa6..eb63cd0 100644
--- a/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
+++ b/test/std/localization/locales/locale/locale.cons/locale_string_cat.pass.cpp
@@ -9,10 +9,6 @@
 
 // REQUIRES: locale.en_US.UTF-8
 // REQUIRES: locale.ru_RU.UTF-8
-// UNSUPPORTED: sanitizer-new-delete
-
-// XFAIL: availability_markup=macosx10.8
-// XFAIL: availability_markup=macosx10.7
 
 // <locale>
 
diff --git a/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp b/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
index 8fc311a..0087f19 100644
--- a/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
+++ b/test/std/localization/locales/locale/locale.types/locale.category/category.pass.cpp
@@ -9,8 +9,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <locale>
 
diff --git a/test/std/numerics/c.math/cmath.pass.cpp b/test/std/numerics/c.math/cmath.pass.cpp
index b5f5864..7161bd3 100644
--- a/test/std/numerics/c.math/cmath.pass.cpp
+++ b/test/std/numerics/c.math/cmath.pass.cpp
@@ -10,7 +10,6 @@
 // <cmath>
 
 #include <cmath>
-#include <limits>
 #include <type_traits>
 #include <cassert>
 
@@ -552,13 +551,6 @@
     static_assert((std::is_same<decltype(std::signbit((long double)0)), bool>::value), "");
     static_assert((std::is_same<decltype(signbit(Ambiguous())), Ambiguous>::value), "");
     assert(std::signbit(-1.0) == true);
-    assert(std::signbit(0u) == false);
-    assert(std::signbit(std::numeric_limits<unsigned>::max()) == false);
-    assert(std::signbit(0) == false);
-    assert(std::signbit(1) == false);
-    assert(std::signbit(-1) == true);
-    assert(std::signbit(std::numeric_limits<int>::max()) == false);
-    assert(std::signbit(std::numeric_limits<int>::min()) == true);
 }
 
 void test_fpclassify()
@@ -572,11 +564,6 @@
     static_assert((std::is_same<decltype(std::fpclassify((long double)0)), int>::value), "");
     static_assert((std::is_same<decltype(fpclassify(Ambiguous())), Ambiguous>::value), "");
     assert(std::fpclassify(-1.0) == FP_NORMAL);
-    assert(std::fpclassify(0) == FP_ZERO);
-    assert(std::fpclassify(1) == FP_NORMAL);
-    assert(std::fpclassify(-1) == FP_NORMAL);
-    assert(std::fpclassify(std::numeric_limits<int>::max()) == FP_NORMAL);
-    assert(std::fpclassify(std::numeric_limits<int>::min()) == FP_NORMAL);
 }
 
 void test_isfinite()
@@ -590,11 +577,6 @@
     static_assert((std::is_same<decltype(std::isfinite((long double)0)), bool>::value), "");
     static_assert((std::is_same<decltype(isfinite(Ambiguous())), Ambiguous>::value), "");
     assert(std::isfinite(-1.0) == true);
-    assert(std::isfinite(0) == true);
-    assert(std::isfinite(1) == true);
-    assert(std::isfinite(-1) == true);
-    assert(std::isfinite(std::numeric_limits<int>::max()) == true);
-    assert(std::isfinite(std::numeric_limits<int>::min()) == true);
 }
 
 void test_isnormal()
@@ -608,11 +590,6 @@
     static_assert((std::is_same<decltype(std::isnormal((long double)0)), bool>::value), "");
     static_assert((std::is_same<decltype(isnormal(Ambiguous())), Ambiguous>::value), "");
     assert(std::isnormal(-1.0) == true);
-    assert(std::isnormal(0) == false);
-    assert(std::isnormal(1) == true);
-    assert(std::isnormal(-1) == true);
-    assert(std::isnormal(std::numeric_limits<int>::max()) == true);
-    assert(std::isnormal(std::numeric_limits<int>::min()) == true);
 }
 
 void test_isgreater()
@@ -674,11 +651,6 @@
     static_assert((std::is_same<decltype(std::isinf(0)), bool>::value), "");
     static_assert((std::is_same<decltype(std::isinf((long double)0)), bool>::value), "");
     assert(std::isinf(-1.0) == false);
-    assert(std::isinf(0) == false);
-    assert(std::isinf(1) == false);
-    assert(std::isinf(-1) == false);
-    assert(std::isinf(std::numeric_limits<int>::max()) == false);
-    assert(std::isinf(std::numeric_limits<int>::min()) == false);
 }
 
 void test_isless()
@@ -759,11 +731,6 @@
     static_assert((std::is_same<decltype(std::isnan(0)), bool>::value), "");
     static_assert((std::is_same<decltype(std::isnan((long double)0)), bool>::value), "");
     assert(std::isnan(-1.0) == false);
-    assert(std::isnan(0) == false);
-    assert(std::isnan(1) == false);
-    assert(std::isnan(-1) == false);
-    assert(std::isnan(std::numeric_limits<int>::max()) == false);
-    assert(std::isnan(std::numeric_limits<int>::min()) == false);
 }
 
 void test_isunordered()
diff --git a/test/std/numerics/complex.number/complex.literals/literals.pass.cpp b/test/std/numerics/complex.number/complex.literals/literals.pass.cpp
index 8831ca1..a2e5362 100644
--- a/test/std/numerics/complex.number/complex.literals/literals.pass.cpp
+++ b/test/std/numerics/complex.number/complex.literals/literals.pass.cpp
@@ -14,8 +14,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     using namespace std::literals::complex_literals;
diff --git a/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp b/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp
index 6cc911d..67e0fa1 100644
--- a/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp
+++ b/test/std/numerics/complex.number/complex.literals/literals1.fail.cpp
@@ -12,8 +12,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     std::complex<float> foo  = 1.0if;  // should fail w/conversion operator not found
diff --git a/test/std/numerics/complex.number/complex.members/construct.pass.cpp b/test/std/numerics/complex.number/complex.members/construct.pass.cpp
index 25b9ce6..b4d870f 100644
--- a/test/std/numerics/complex.number/complex.members/construct.pass.cpp
+++ b/test/std/numerics/complex.number/complex.members/construct.pass.cpp
@@ -14,8 +14,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class T>
 void
 test()
@@ -40,7 +38,7 @@
     assert(c.real() == 10.5);
     assert(c.imag() == -9.5);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<T> c;
     static_assert(c.real() == 0, "");
diff --git a/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp b/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
index 4d866ac..24644e3 100644
--- a/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
+++ b/test/std/numerics/complex.number/complex.ops/stream_input.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <complex>
 
 // template<class T, class charT, class traits>
diff --git a/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp
index ac26e3c..e8d07ce 100644
--- a/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/double_float_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<float> cd(2.5, 3.5);
     constexpr std::complex<double> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp
index 3bb01ac..298aaa3 100644
--- a/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/double_float_implicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<float> cd(2.5, 3.5);
     constexpr std::complex<double> cf = cd;
diff --git a/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp
index 97c2580..6ff74a2 100644
--- a/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/double_long_double_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<long double> cd(2.5, 3.5);
     constexpr std::complex<double> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
index 3027d4c..77ca9d7 100644
--- a/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/float_double_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<double> cd(2.5, 3.5);
     constexpr std::complex<float> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp
index 515e83d..4fb11b4 100644
--- a/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/float_long_double_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<long double> cd(2.5, 3.5);
     constexpr std::complex<float> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp
index 4f24a1c..dd10c80 100644
--- a/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/long_double_double_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<double> cd(2.5, 3.5);
     constexpr std::complex<long double> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp
index 8cbd7a8..aab5394 100644
--- a/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/long_double_double_implicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<double> cd(2.5, 3.5);
     constexpr std::complex<long double> cf = cd;
diff --git a/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp
index 7930548..a5f5101 100644
--- a/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/long_double_float_explicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<float> cd(2.5, 3.5);
     constexpr std::complex<long double> cf(cd);
diff --git a/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp b/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp
index 22b9fd0..25b9382 100644
--- a/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp
+++ b/test/std/numerics/complex.number/complex.special/long_double_float_implicit.pass.cpp
@@ -18,8 +18,6 @@
 #include <complex>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     assert(cf.real() == cd.real());
     assert(cf.imag() == cd.imag());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::complex<float> cd(2.5, 3.5);
     constexpr std::complex<long double> cf = cd;
diff --git a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
index 5122f44..7a671a7 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.assign/initializer_list_assign.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <valarray>
 
 // template<class T> class valarray;
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         T a[] = {1, 2, 3, 4, 5};
@@ -55,4 +54,5 @@
                 assert(v2[i][j] == a[i][j]);
         }
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
index ce385e6..4dfbe11 100644
--- a/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
+++ b/test/std/numerics/numarray/template.valarray/valarray.cons/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <valarray>
 
 // template<class T> class valarray;
@@ -20,6 +18,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef int T;
         T a[] = {1, 2, 3, 4, 5};
@@ -38,4 +37,5 @@
         for (unsigned i = 0; i < N; ++i)
             assert(v[i] == a[i]);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
index 517a62a..961b515 100644
--- a/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
+++ b/test/std/numerics/numeric.ops/numeric.ops.gcd/gcd.pass.cpp
@@ -16,10 +16,8 @@
 
 #include <numeric>
 #include <cassert>
-#include <climits>
-#include <cstdint>
 #include <cstdlib>    // for rand()
-#include <type_traits>
+#include <iostream>
 
 constexpr struct {
   int x;
@@ -38,24 +36,21 @@
 
 
 template <typename Input1, typename Input2, typename Output>
-constexpr bool test0(int in1, int in2, int out)
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
 {
-    auto value1 = static_cast<Input1>(in1);
-    auto value2 = static_cast<Input2>(in2);
-    static_assert(std::is_same_v<Output, decltype(std::gcd(value1, value2))>, "");
-    static_assert(std::is_same_v<Output, decltype(std::gcd(value2, value1))>, "");
-    assert(static_cast<Output>(out) == std::gcd(value1, value2));
-    return true;
+    static_assert((std::is_same<Output, decltype(std::gcd(in1, in2))>::value), "" );
+    static_assert((std::is_same<Output, decltype(std::gcd(in2, in1))>::value), "" );
+    return out == std::gcd(in1, in2) ? true : (std::abort(), false);
 }
 
 
 template <typename Input1, typename Input2 = Input1>
 constexpr bool do_test(int = 0)
 {
-    using S1 = std::make_signed_t<Input1>;
-    using S2 = std::make_signed_t<Input2>;
-    using U1 = std::make_unsigned_t<Input1>;
-    using U2 = std::make_unsigned_t<Input2>;
+    using S1 = typename std::make_signed<Input1>::type;
+    using S2 = typename std::make_signed<Input2>::type;
+    using U1 = typename std::make_unsigned<Input1>::type;
+    using U2 = typename std::make_unsigned<Input2>::type;
     bool accumulate = true;
     for (auto TC : Cases) {
         { // Test with two signed types
@@ -108,15 +103,15 @@
     assert(do_test<long>(non_cce));
     assert(do_test<long long>(non_cce));
 
-    static_assert(do_test<std::int8_t>(), "");
-    static_assert(do_test<std::int16_t>(), "");
-    static_assert(do_test<std::int32_t>(), "");
-    static_assert(do_test<std::int64_t>(), "");
+    static_assert(do_test< int8_t>(), "");
+    static_assert(do_test<int16_t>(), "");
+    static_assert(do_test<int32_t>(), "");
+    static_assert(do_test<int64_t>(), "");
 
-    assert(do_test<std::int8_t>(non_cce));
-    assert(do_test<std::int16_t>(non_cce));
-    assert(do_test<std::int32_t>(non_cce));
-    assert(do_test<std::int64_t>(non_cce));
+    assert(do_test< int8_t>(non_cce));
+    assert(do_test<int16_t>(non_cce));
+    assert(do_test<int32_t>(non_cce));
+    assert(do_test<int64_t>(non_cce));
 
     static_assert(do_test<signed char, int>(), "");
     static_assert(do_test<int, signed char>(), "");
@@ -138,8 +133,8 @@
 
 //  LWG#2837
     {
-    auto res = std::gcd(static_cast<std::int64_t>(1234), INT32_MIN);
-    static_assert(std::is_same_v<decltype(res), std::int64_t>, "");
-    assert(res == 2);
+        auto res = std::gcd((int64_t)1234, (int32_t)-2147483648);
+        static_assert( std::is_same<decltype(res), std::common_type<int64_t, int32_t>::type>::value, "");
+        assert(res == 2);
     }
 }
diff --git a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
index 6bd8a4f..90d4839 100644
--- a/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
+++ b/test/std/numerics/numeric.ops/numeric.ops.lcm/lcm.pass.cpp
@@ -11,14 +11,12 @@
 // <numeric>
 
 // template<class _M, class _N>
-// constexpr common_type_t<_M,_N> lcm(_M __m, _N __n)
+// constexpr common_type_t<_M,_N> gcd(_M __m, _N __n)
 
 #include <numeric>
 #include <cassert>
-#include <climits>
-#include <cstdint>
 #include <cstdlib>
-#include <type_traits>
+#include <iostream>
 
 constexpr struct {
   int x;
@@ -36,24 +34,21 @@
 };
 
 template <typename Input1, typename Input2, typename Output>
-constexpr bool test0(int in1, int in2, int out)
+constexpr bool test0(Input1 in1, Input2 in2, Output out)
 {
-    auto value1 = static_cast<Input1>(in1);
-    auto value2 = static_cast<Input2>(in2);
-    static_assert(std::is_same_v<Output, decltype(std::lcm(value1, value2))>, "");
-    static_assert(std::is_same_v<Output, decltype(std::lcm(value2, value1))>, "");
-    assert(static_cast<Output>(out) == std::lcm(value1, value2));
-    return true;
+    static_assert((std::is_same<Output, decltype(std::lcm(Input1(0), Input2(0)))>::value), "" );
+    static_assert((std::is_same<Output, decltype(std::lcm(Input2(0), Input1(0)))>::value), "" );
+    return out == std::lcm(in1, in2) ? true : (std::abort(), false);
 }
 
 
 template <typename Input1, typename Input2 = Input1>
 constexpr bool do_test(int = 0)
 {
-    using S1 = std::make_signed_t<Input1>;
-    using S2 = std::make_signed_t<Input2>;
-    using U1 = std::make_unsigned_t<Input1>;
-    using U2 = std::make_unsigned_t<Input2>;
+    using S1 = typename std::make_signed<Input1>::type;
+    using S2 = typename std::make_signed<Input2>::type;
+    using U1 = typename std::make_unsigned<Input1>::type;
+    using U2 = typename std::make_unsigned<Input2>::type;
     bool accumulate = true;
     for (auto TC : Cases) {
         { // Test with two signed types
@@ -106,15 +101,15 @@
     assert(do_test<long>(non_cce));
     assert(do_test<long long>(non_cce));
 
-    static_assert(do_test<std::int8_t>(), "");
-    static_assert(do_test<std::int16_t>(), "");
-    static_assert(do_test<std::int32_t>(), "");
-    static_assert(do_test<std::int64_t>(), "");
+    static_assert(do_test< int8_t>(), "");
+    static_assert(do_test<int16_t>(), "");
+    static_assert(do_test<int32_t>(), "");
+    static_assert(do_test<int64_t>(), "");
 
-    assert(do_test<std::int8_t>(non_cce));
-    assert(do_test<std::int16_t>(non_cce));
-    assert(do_test<std::int32_t>(non_cce));
-    assert(do_test<std::int64_t>(non_cce));
+    assert(do_test< int8_t>(non_cce));
+    assert(do_test<int16_t>(non_cce));
+    assert(do_test<int32_t>(non_cce));
+    assert(do_test<int64_t>(non_cce));
 
     static_assert(do_test<signed char, int>(), "");
     static_assert(do_test<int, signed char>(), "");
@@ -136,9 +131,9 @@
 
 //  LWG#2837
     {
-    auto res1 = std::lcm(static_cast<std::int64_t>(1234), INT32_MIN);
-    (void)std::lcm(INT_MIN, 2UL);	// this used to trigger UBSAN
-    static_assert(std::is_same_v<decltype(res1), std::int64_t>, "");
-    assert(res1 == 1324997410816LL);
+    auto res1 = std::lcm((int64_t)1234, (int32_t)-2147483648);
+    (void) std::lcm<int, unsigned long>(INT_MIN, 2);	// this used to trigger UBSAN
+    static_assert( std::is_same<decltype(res1), std::common_type<int64_t, int32_t>::type>::value, "");
+	assert(res1 == 1324997410816LL);
     }
 }
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
index 8cc523e..f819f48 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp
@@ -26,8 +26,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class _Tp>
 void where(const _Tp &) {}
 
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
index 6076f93..187a71e 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.ibits/values.pass.cpp
@@ -24,8 +24,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 void
 test1()
 {
diff --git a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
index c592b6d..be5b4a9 100644
--- a/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
+++ b/test/std/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp
@@ -25,8 +25,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class _Tp>
 void where(const _Tp &) {}
 
diff --git a/test/std/numerics/rand/rand.device/ctor.pass.cpp b/test/std/numerics/rand/rand.device/ctor.pass.cpp
index 5d72e47..7305768 100644
--- a/test/std/numerics/rand/rand.device/ctor.pass.cpp
+++ b/test/std/numerics/rand/rand.device/ctor.pass.cpp
@@ -7,14 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// See bugs.llvm.org/PR20183
-//
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <random>
 
 // class random_device;
diff --git a/test/std/numerics/rand/rand.device/eval.pass.cpp b/test/std/numerics/rand/rand.device/eval.pass.cpp
index b34e40c..890f4ca 100644
--- a/test/std/numerics/rand/rand.device/eval.pass.cpp
+++ b/test/std/numerics/rand/rand.device/eval.pass.cpp
@@ -7,14 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// See bugs.llvm.org/PR20183
-//
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <random>
 
 // class random_device;
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp
index 0318393..bc4494b 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/ctor_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class IntType = int>
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::discrete_distribution<> D;
         D d = {};
@@ -78,4 +77,5 @@
         assert(p[1] == 0);
         assert(p[2] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp
index bd2a8c8..1071305 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_default.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class IntType = int>
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::discrete_distribution<> D;
         typedef D::param_type P;
@@ -29,4 +28,5 @@
         assert(p.size() == 1);
         assert(p[0] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp
index 1144bfe..79d8a0b 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.discrete/param_ctor_init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class IntType = int>
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::discrete_distribution<> D;
         typedef D::param_type P;
@@ -85,4 +84,5 @@
         assert(p[1] == 0);
         assert(p[2] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp
index e901afc..d4f339f 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_default.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_constant_distribution<> D;
         D d;
@@ -32,4 +31,5 @@
         assert(dn.size() == 1);
         assert(dn[0] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp
index ecc3c89..5708e45 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/ctor_init_func.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -29,6 +27,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_constant_distribution<> D;
         D d({}, f);
@@ -75,4 +74,5 @@
         assert(dn[0] == 0.203125);
         assert(dn[1] == 0.1484375);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp
index c037338..fa65309 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.pconst/param_ctor_init_func.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_constant_distribution<> D;
         typedef D::param_type P;
@@ -76,4 +75,5 @@
         assert(dn[0] == 0.203125);
         assert(dn[1] == 0.1484375);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp
index 99b0f5f..745bd6b 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_default.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_linear_distribution<> D;
         D d;
@@ -33,4 +32,5 @@
         assert(dn[0] == 1);
         assert(dn[1] == 1);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp
index 77371de..44c76f0 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/ctor_init_func.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -29,6 +27,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_linear_distribution<> D;
         D d({}, f);
@@ -79,4 +78,5 @@
         assert(dn[1] == 0.125);
         assert(dn[2] == 0.175);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp
index 518a4f2..cfa4164 100644
--- a/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp
+++ b/test/std/numerics/rand/rand.dis/rand.dist.samp/rand.dist.samp.plinear/param_ctor_init_func.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // template<class RealType = double>
@@ -26,6 +24,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         typedef std::piecewise_linear_distribution<> D;
         typedef D::param_type P;
@@ -80,4 +79,5 @@
         assert(dn[1] == 0.125);
         assert(dn[2] == 0.175);
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
index 2080ac5..cd496fd 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp
@@ -25,8 +25,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class _Tp>
 void where(const _Tp &) {}
 
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
index f7834af..3a16d62 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp
@@ -40,8 +40,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class _Tp>
 void where(const _Tp &) {}
 
diff --git a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
index 6b8b4ee..b3f12e7 100644
--- a/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
+++ b/test/std/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp
@@ -28,8 +28,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class _Tp>
 void where(const _Tp &) {}
 
diff --git a/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp b/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp
index c0921d9..d4ee9c1 100644
--- a/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp
+++ b/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <random>
 
 // class seed_seq;
@@ -21,6 +19,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     std::seed_seq s= {5, 4, 3, 2, 1};
     assert(s.size() == 5);
     unsigned b[5] = {0};
@@ -30,4 +29,5 @@
     assert(b[2] == 3);
     assert(b[3] == 2);
     assert(b[4] == 1);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/re/re.alg/re.alg.match/awk.pass.cpp b/test/std/re/re.alg/re.alg.match/awk.pass.cpp
index 4fc1ea7..f866929 100644
--- a/test/std/re/re.alg/re.alg.match/awk.pass.cpp
+++ b/test/std/re/re.alg/re.alg.match/awk.pass.cpp
@@ -26,8 +26,7 @@
 
 int main()
 {
-#if 0
-    {
+/*    {
         std::cmatch m;
         const char s[] = "a";
         assert(std::regex_match(s, m, std::regex("a", std::regex_constants::awk)));
@@ -264,7 +263,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -279,7 +278,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -294,7 +293,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -327,7 +326,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -342,7 +341,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -357,7 +356,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -379,7 +378,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -395,7 +394,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -411,7 +410,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -435,7 +434,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -520,7 +519,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -543,7 +542,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -573,7 +572,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -589,7 +588,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -605,7 +604,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -617,23 +616,24 @@
         assert(m.size() == 0);
     }
     std::locale::global(std::locale(LOCALE_cs_CZ_ISO8859_2));
-    {
+*/    {
+    /*
         std::cmatch m;
         const char s[] = "m";
-        assert(std::regex_match(s, m,
-                      std::regex("[a[=M=]z]", std::regex_constants::awk)));
-        assert(m.size() == 1);
+        assert(std::regex_match(s, m, std::regex("[a[=M=]z]",
+                                                 std::regex_constants::awk);
+       assert(m.size() == 1);
         assert(!m.prefix().matched);
         assert(m.prefix().first == s);
         assert(m.prefix().second == m[0].first);
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
-    }
-    {
+*/    }
+/*    {
         std::cmatch m;
         const char s[] = "Ch";
         assert(std::regex_match(s, m, std::regex("[a[.ch.]z]",
@@ -645,7 +645,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -688,7 +688,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == 4);
+        assert(m.length(0) == 4);
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -704,7 +704,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<char>::length(s));
-        assert((size_t)m.length(0) == std::char_traits<char>::length(s));
+        assert(m.length(0) == std::char_traits<char>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -720,7 +720,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s+1);
-        assert((size_t)m.length(0) == 1);
+        assert(m.length(0) == 1);
         assert(m.position(0) == 0);
         assert(m.str(0) == L"a");
     }
@@ -735,7 +735,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s+2);
-        assert((size_t)m.length(0) == 2);
+        assert(m.length(0) == 2);
         assert(m.position(0) == 0);
         assert(m.str(0) == L"ab");
     }
@@ -945,7 +945,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -960,7 +960,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -975,7 +975,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1008,7 +1008,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1023,7 +1023,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1038,7 +1038,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1060,7 +1060,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1076,7 +1076,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1092,7 +1092,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
         assert(m.length(1) == 4);
@@ -1116,7 +1116,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1201,7 +1201,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1224,7 +1224,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1254,7 +1254,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1270,7 +1270,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1286,7 +1286,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1310,7 +1310,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1326,7 +1326,7 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == m[0].second);
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
@@ -1385,9 +1385,8 @@
         assert(!m.suffix().matched);
         assert(m.suffix().first == m[0].second);
         assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
-        assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
+        assert(m.length(0) == std::char_traits<wchar_t>::length(s));
         assert(m.position(0) == 0);
         assert(m.str(0) == s);
     }
-#endif
-}
+*/}
diff --git a/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp b/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
index 849ec4a..6cffc0d 100644
--- a/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
+++ b/test/std/re/re.iter/re.tokiter/re.tokiter.cnstr/init.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <regex>
 
 // class regex_token_iterator<BidirectionalIterator, charT, traits>
@@ -25,6 +23,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         std::regex phone_numbers("\\d{3}-(\\d{4})");
         const char phone_book[] = "start 555-1234, 555-2345, 555-3456 end";
@@ -62,4 +61,5 @@
         ++i;
         assert(i == std::cregex_token_iterator());
     }
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp b/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp
index fcaee8c..39c3a22 100644
--- a/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp
+++ b/test/std/re/re.regex/re.regex.assign/assign.il.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     std::regex r2;
     r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'});
     assert(r2.flags() == std::regex::ECMAScript);
@@ -31,4 +30,5 @@
     r2.assign({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex::extended);
     assert(r2.flags() == std::regex::extended);
     assert(r2.mark_count() == 2);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/re/re.regex/re.regex.assign/il.pass.cpp b/test/std/re/re.regex/re.regex.assign/il.pass.cpp
index a74d9cf..022170f 100644
--- a/test/std/re/re.regex/re.regex.assign/il.pass.cpp
+++ b/test/std/re/re.regex/re.regex.assign/il.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -21,8 +19,10 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     std::regex r2;
     r2 = {'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'};
     assert(r2.flags() == std::regex::ECMAScript);
     assert(r2.mark_count() == 2);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp b/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp
index 87dcc85..c1554d6 100644
--- a/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp
+++ b/test/std/re/re.regex/re.regex.construct/il_flg.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <regex>
 
 // template <class charT, class traits = regex_traits<charT>> class basic_regex;
@@ -20,6 +18,7 @@
 #include <cassert>
 #include "test_macros.h"
 
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 void
 test(std::initializer_list<char> il, std::regex_constants::syntax_option_type f, unsigned mc)
@@ -29,9 +28,11 @@
     assert(r.mark_count() == mc);
 }
 
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     std::string s1("\\(a\\)");
     std::string s2("\\(a[bc]\\)");
     std::string s3("\\(a\\([bc]\\)\\)");
@@ -66,4 +67,5 @@
     test({'\\', '(', 'a', '[', 'b', 'c', ']', '\\', ')'}, std::regex_constants::egrep, 0);
     test({'\\', '(', 'a', '\\', '(', '[', 'b', 'c', ']', '\\', ')', '\\', ')'}, std::regex_constants::egrep, 0);
     test({'(', 'a', '(', '[', 'b', 'c', ']', ')', ')'}, std::regex_constants::egrep, 2);
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/re/re.traits/lookup_classname.pass.cpp b/test/std/re/re.traits/lookup_classname.pass.cpp
index b61f772..2215b90 100644
--- a/test/std/re/re.traits/lookup_classname.pass.cpp
+++ b/test/std/re/re.traits/lookup_classname.pass.cpp
@@ -27,61 +27,39 @@
      typename std::regex_traits<char_type>::char_class_type expected,
      bool icase = false)
 {
-    typedef typename std::regex_traits<char_type>::char_class_type char_class_type;
     std::regex_traits<char_type> t;
     typedef forward_iterator<const char_type*> F;
-    char_class_type result = t.lookup_classname(F(A), F(A + t.length(A)), icase);
-    assert(result == expected);
-}
-
-template <class char_type>
-void
-test_w(const char_type* A,
-       typename std::regex_traits<char_type>::char_class_type expected,
-        bool icase = false)
-{
-    typedef typename std::regex_traits<char_type>::char_class_type char_class_type;
-    std::regex_traits<char_type> t;
-    typedef forward_iterator<const char_type*> F;
-    char_class_type result = t.lookup_classname(F(A), F(A + t.length(A)), icase);
-    assert((result & expected) == expected);
-    LIBCPP_ASSERT((expected | std::regex_traits<char_type>::__regex_word) == result);
-
-    const bool matches_underscore = t.isctype('_', result);
-    if (result != expected)
-      assert(matches_underscore && "expected to match underscore");
-    else
-      assert(!matches_underscore && "should not match underscore");
+    assert(t.lookup_classname(F(A), F(A + t.length(A)), icase) == expected);
 }
 
 int main()
 {
 //  if __regex_word is not distinct from all the classes, bad things happen
 //  See https://bugs.llvm.org/show_bug.cgi?id=26476 for an example.
-    LIBCPP_ASSERT((std::ctype_base::space  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::print  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::cntrl  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::upper  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::lower  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::alpha  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::digit  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::punct  & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::xdigit & std::regex_traits<char>::__regex_word) == 0);
-    LIBCPP_ASSERT((std::ctype_base::blank  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::space  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::print  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::cntrl  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::upper  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::lower  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::alpha  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::digit  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::punct  & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::xdigit & std::regex_traits<char>::__regex_word) == 0);
+    assert((std::ctype_base::blank  & std::regex_traits<char>::__regex_word) == 0);
 
     test("d", std::ctype_base::digit);
     test("D", std::ctype_base::digit);
     test("d", std::ctype_base::digit, true);
     test("D", std::ctype_base::digit, true);
 
-    test_w("w", std::ctype_base::alnum
-              | std::ctype_base::upper | std::ctype_base::lower);
-    test_w("W", std::ctype_base::alnum
-              | std::ctype_base::upper | std::ctype_base::lower);
-    test_w("w", std::ctype_base::alnum
-              | std::ctype_base::upper | std::ctype_base::lower, true);
-    test_w("W", std::ctype_base::alnum
-              | std::ctype_base::upper | std::ctype_base::lower, true);
+    test("w", std::regex_traits<char>::__regex_word | std::ctype_base::alnum
+                      | std::ctype_base::upper | std::ctype_base::lower);
+    test("W", std::regex_traits<char>::__regex_word | std::ctype_base::alnum
+                      | std::ctype_base::upper | std::ctype_base::lower);
+    test("w", std::regex_traits<char>::__regex_word | std::ctype_base::alnum
+                      | std::ctype_base::upper | std::ctype_base::lower, true);
+    test("W", std::regex_traits<char>::__regex_word | std::ctype_base::alnum
+                      | std::ctype_base::upper | std::ctype_base::lower, true);
 
     test("s", std::ctype_base::space);
     test("S", std::ctype_base::space);
@@ -162,13 +140,13 @@
     test(L"d", std::ctype_base::digit, true);
     test(L"D", std::ctype_base::digit, true);
 
-    test_w(L"w", std::ctype_base::alnum
+    test(L"w", std::regex_traits<wchar_t>::__regex_word | std::ctype_base::alnum
                       | std::ctype_base::upper | std::ctype_base::lower);
-    test_w(L"W", std::ctype_base::alnum
+    test(L"W", std::regex_traits<wchar_t>::__regex_word | std::ctype_base::alnum
                       | std::ctype_base::upper | std::ctype_base::lower);
-    test_w(L"w", std::ctype_base::alnum
+    test(L"w", std::regex_traits<wchar_t>::__regex_word | std::ctype_base::alnum
                       | std::ctype_base::upper | std::ctype_base::lower, true);
-    test_w(L"W", std::ctype_base::alnum
+    test(L"W", std::regex_traits<wchar_t>::__regex_word | std::ctype_base::alnum
                       | std::ctype_base::upper | std::ctype_base::lower, true);
 
     test(L"s", std::ctype_base::space);
diff --git a/test/std/re/re.traits/translate_nocase.pass.cpp b/test/std/re/re.traits/translate_nocase.pass.cpp
index 33d365a..bf79629 100644
--- a/test/std/re/re.traits/translate_nocase.pass.cpp
+++ b/test/std/re/re.traits/translate_nocase.pass.cpp
@@ -16,8 +16,8 @@
 
 // REQUIRES: locale.en_US.UTF-8
 
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // TODO: investigation needed
 // XFAIL: linux-gnu
diff --git a/test/std/strings/basic.string.hash/strings.pass.cpp b/test/std/strings/basic.string.hash/strings.pass.cpp
index d74e485..5fc32c0 100644
--- a/test/std/strings/basic.string.hash/strings.pass.cpp
+++ b/test/std/strings/basic.string.hash/strings.pass.cpp
@@ -22,8 +22,6 @@
 #include <cassert>
 #include <type_traits>
 
-#include "test_macros.h"
-
 template <class T>
 void
 test()
@@ -31,8 +29,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
-
     H h;
     std::string g1 = "1234567890";
     std::string g2 = "1234567891";
diff --git a/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index f36f53e..59267f2 100644
--- a/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -8,12 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-no-exceptions
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <string>
 
 // size_type max_size() const;
diff --git a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
index 67ac434..312e4d2 100644
--- a/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.cons/T_size_size.pass.cpp
@@ -27,17 +27,16 @@
 
 template <class S, class SV>
 void
-test(SV sv, std::size_t pos, std::size_t n)
+test(SV sv, unsigned pos, unsigned n)
 {
     typedef typename S::traits_type T;
     typedef typename S::allocator_type A;
-    typedef typename S::size_type Size;
     if (pos <= sv.size())
     {
-        S s2(sv, static_cast<Size>(pos), static_cast<Size>(n));
+        S s2(sv, pos, n);
         LIBCPP_ASSERT(s2.__invariants());
         assert(pos <= sv.size());
-        std::size_t rlen = std::min(sv.size() - pos, n);
+        unsigned rlen = std::min<unsigned>(sv.size() - pos, n);
         assert(s2.size() == rlen);
         assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0);
         assert(s2.get_allocator() == A());
@@ -48,7 +47,7 @@
     {
         try
         {
-            S s2(sv, static_cast<Size>(pos), static_cast<Size>(n));
+            S s2(sv, pos, n);
             assert(false);
         }
         catch (std::out_of_range&)
@@ -61,16 +60,16 @@
 
 template <class S, class SV>
 void
-test(SV sv, std::size_t pos, std::size_t n, const typename S::allocator_type& a)
+test(SV sv, unsigned pos, unsigned n, const typename S::allocator_type& a)
 {
     typedef typename S::traits_type T;
-    typedef typename S::size_type Size;
+    typedef typename S::allocator_type A;
     if (pos <= sv.size())
     {
-        S s2(sv, static_cast<Size>(pos), static_cast<Size>(n), a);
+        S s2(sv, pos, n, a);
         LIBCPP_ASSERT(s2.__invariants());
         assert(pos <= sv.size());
-        std::size_t rlen = std::min(sv.size() - pos, n);
+        unsigned rlen = std::min<unsigned>(sv.size() - pos, n);
         assert(s2.size() == rlen);
         assert(T::compare(s2.data(), sv.data() + pos, rlen) == 0);
         assert(s2.get_allocator() == a);
@@ -81,7 +80,7 @@
     {
         try
         {
-            S s2(sv, static_cast<Size>(pos), static_cast<Size>(n), a);
+            S s2(sv, pos, n, a);
             assert(false);
         }
         catch (std::out_of_range&)
diff --git a/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
index b464291..dac8860 100644
--- a/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_append/iterator.pass.cpp
@@ -204,20 +204,4 @@
 	assert(s == "ABCD");
 	}
 
-  { // test with a move iterator that returns char&&
-    typedef forward_iterator<const char*> It;
-    typedef std::move_iterator<It> MoveIt;
-    const char p[] = "ABCD";
-    std::string s;
-    s.append(MoveIt(It(std::begin(p))), MoveIt(It(std::end(p) - 1)));
-    assert(s == "ABCD");
-  }
-  { // test with a move iterator that returns char&&
-    typedef const char* It;
-    typedef std::move_iterator<It> MoveIt;
-    const char p[] = "ABCD";
-    std::string s;
-    s.append(MoveIt(It(std::begin(p))), MoveIt(It(std::end(p) - 1)));
-    assert(s == "ABCD");
-  }
 }
diff --git a/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp
index 31add9d..8de5fc7 100644
--- a/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_erase/iter.pass.cpp
@@ -24,7 +24,6 @@
     typename S::const_iterator p = s.begin() + pos;
     typename S::iterator i = s.erase(p);
     LIBCPP_ASSERT(s.__invariants());
-    assert(s[s.size()] == typename S::value_type());
     assert(s == expected);
     assert(i - s.begin() == pos);
 }
diff --git a/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp
index 858d375..e4fe2cd 100644
--- a/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_erase/iter_iter.pass.cpp
@@ -25,7 +25,6 @@
     typename S::const_iterator last = s.cbegin() + pos + n;
     typename S::iterator i = s.erase(first, last);
     LIBCPP_ASSERT(s.__invariants());
-    assert(s[s.size()] == typename S::value_type());
     assert(s == expected);
     assert(i - s.begin() == pos);
 }
diff --git a/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp
index 8424b54..64f8e50 100644
--- a/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_erase/pop_back.pass.cpp
@@ -23,7 +23,6 @@
 {
     s.pop_back();
     LIBCPP_ASSERT(s.__invariants());
-    assert(s[s.size()] == typename S::value_type());
     assert(s == expected);
 }
 
diff --git a/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
index 2c900bb..eb6be20 100644
--- a/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_erase/size_size.pass.cpp
@@ -29,7 +29,6 @@
     {
         s.erase(pos, n);
         LIBCPP_ASSERT(s.__invariants());
-        assert(s[s.size()] == typename S::value_type());
         assert(s == expected);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
@@ -59,7 +58,6 @@
     {
         s.erase(pos);
         LIBCPP_ASSERT(s.__invariants());
-        assert(s[s.size()] == typename S::value_type());
         assert(s == expected);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
@@ -85,7 +83,6 @@
 {
     s.erase();
     LIBCPP_ASSERT(s.__invariants());
-    assert(s[s.size()] == typename S::value_type());
     assert(s == expected);
 }
 
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp
index c5b7cbf..2adf846 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/iter_initializer_list.pass.cpp
@@ -7,12 +7,13 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <string>
 
 // iterator insert(const_iterator p, initializer_list<charT> il);
 
+#if _LIBCPP_DEBUG >= 1
+#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
+#endif
 
 #include <string>
 #include <cassert>
@@ -21,12 +22,14 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         std::string s("123456");
         std::string::iterator i = s.insert(s.begin() + 3, {'a', 'b', 'c'});
         assert(i - s.begin() == 3);
         assert(s == "123abc456");
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
         S s("123456");
@@ -34,4 +37,14 @@
         assert(i - s.begin() == 3);
         assert(s == "123abc456");
     }
+#endif
+#if _LIBCPP_DEBUG >= 1
+    {
+        std::string s;
+        std::string s2;
+        s.insert(s2.begin(), {'a', 'b', 'c'});
+        assert(false);
+    }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
index 2c8b6e4..e5ce8e5 100644
--- a/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_insert/iter_iter_iter.pass.cpp
@@ -188,35 +188,10 @@
 
 	{ // test assigning a different type
     typedef std::string S;
-    const uint8_t p[] = "ABCD";
+	const uint8_t p[] = "ABCD";
 
-    S s;
-    s.insert(s.begin(), p, p + 4);
-    assert(s == "ABCD");
+	S s;
+	s.insert(s.begin(), p, p + 4);
+	assert(s == "ABCD");
 	}
-
-  { // test with a move iterator that returns char&&
-    typedef input_iterator<const char*> It;
-    typedef std::move_iterator<It> MoveIt;
-    const char p[] = "ABCD";
-    std::string s;
-    s.insert(s.begin(), MoveIt(It(std::begin(p))), MoveIt(It(std::end(p) - 1)));
-    assert(s == "ABCD");
-  }
-  { // test with a move iterator that returns char&&
-    typedef forward_iterator<const char*> It;
-    typedef std::move_iterator<It> MoveIt;
-    const char p[] = "ABCD";
-    std::string s;
-    s.insert(s.begin(), MoveIt(It(std::begin(p))), MoveIt(It(std::end(p) - 1)));
-    assert(s == "ABCD");
-  }
-  { // test with a move iterator that returns char&&
-    typedef const char* It;
-    typedef std::move_iterator<It> MoveIt;
-    const char p[] = "ABCD";
-    std::string s;
-    s.insert(s.begin(), MoveIt(It(std::begin(p))), MoveIt(It(std::end(p) - 1)));
-    assert(s == "ABCD");
-  }
 }
diff --git a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp
index 2a705eb..b60a58c 100644
--- a/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp
+++ b/test/std/strings/basic.string/string.modifiers/string_replace/iter_iter_initializer_list.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <string>
 
 // basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<charT> il);
@@ -20,15 +18,19 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     {
         std::string s("123def456");
         s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'});
         assert(s == "123abc456");
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
         S s("123def456");
         s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'});
         assert(s == "123abc456");
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
index 5dbfe9d..48d1854 100644
--- a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_delim_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <string>
 
 // template<class charT, class traits, class Allocator>
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::string s("initial text");
         getline(std::istringstream(" abc*  def*   ghij"), s, '*');
@@ -34,6 +33,7 @@
         getline(std::wistringstream(L" abc*  def*   ghij"), s, L'*');
         assert(s == L" abc");
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
         S s("initial text");
@@ -46,4 +46,6 @@
         getline(std::wistringstream(L" abc*  def*   ghij"), s, L'*');
         assert(s == L" abc");
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
index 0c1fa82..18c22f9 100644
--- a/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string.io/get_line_rv.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <string>
 
 // template<class charT, class traits, class Allocator>
@@ -24,6 +22,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     {
         std::string s("initial text");
         getline(std::istringstream(" abc\n  def\n   ghij"), s);
@@ -34,6 +33,7 @@
         getline(std::wistringstream(L" abc\n  def\n   ghij"), s);
         assert(s == L" abc");
     }
+#if TEST_STD_VER >= 11
     {
         typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
         S s("initial text");
@@ -46,4 +46,6 @@
         getline(std::wistringstream(L" abc\n  def\n   ghij"), s);
         assert(s == L" abc");
     }
+#endif
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
index 7bf7da8..9a8213e 100644
--- a/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string_op+/char_string.pass.cpp
@@ -21,50 +21,60 @@
 #include <utility>
 #include <cassert>
 
-#include "test_macros.h"
 #include "min_allocator.h"
 
 template <class S>
-void test0(typename S::value_type lhs, const S& rhs, const S& x) {
-  assert(lhs + rhs == x);
+void
+test0(typename S::value_type lhs, const S& rhs, const S& x)
+{
+    assert(lhs + rhs == x);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class S>
-void test1(typename S::value_type lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
+void
+test1(typename S::value_type lhs, S&& rhs, const S& x)
+{
+    assert(lhs + move(rhs) == x);
 }
-#endif
 
-int main() {
-  {
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+int main()
+{
+    {
     typedef std::string S;
     test0('a', S(""), S("a"));
     test0('a', S("12345"), S("a12345"));
     test0('a', S("1234567890"), S("a1234567890"));
     test0('a', S("12345678901234567890"), S("a12345678901234567890"));
-  }
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    test1('a', S(""), S("a"));
+    test1('a', S("12345"), S("a12345"));
+    test1('a', S("1234567890"), S("a1234567890"));
+    test1('a', S("12345678901234567890"), S("a12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #if TEST_STD_VER >= 11
-  {
-    typedef std::string S;
-    test1('a', S(""), S("a"));
-    test1('a', S("12345"), S("a12345"));
-    test1('a', S("1234567890"), S("a1234567890"));
-    test1('a', S("12345678901234567890"), S("a12345678901234567890"));
-  }
-  {
-    typedef std::basic_string<char, std::char_traits<char>,
-                              min_allocator<char> >
-        S;
+    {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
     test0('a', S(""), S("a"));
     test0('a', S("12345"), S("a12345"));
     test0('a', S("1234567890"), S("a1234567890"));
     test0('a', S("12345678901234567890"), S("a12345678901234567890"));
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1('a', S(""), S("a"));
     test1('a', S("12345"), S("a12345"));
     test1('a', S("1234567890"), S("a1234567890"));
     test1('a', S("12345678901234567890"), S("a12345678901234567890"));
-  }
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #endif
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
index 090707f..88fa678 100644
--- a/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string_op+/pointer_string.pass.cpp
@@ -21,23 +21,29 @@
 #include <utility>
 #include <cassert>
 
-#include "test_macros.h"
 #include "min_allocator.h"
 
 template <class S>
-void test0(const typename S::value_type* lhs, const S& rhs, const S& x) {
-  assert(lhs + rhs == x);
+void
+test0(const typename S::value_type* lhs, const S& rhs, const S& x)
+{
+    assert(lhs + rhs == x);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class S>
-void test1(const typename S::value_type* lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
+void
+test1(const typename S::value_type* lhs, S&& rhs, const S& x)
+{
+    assert(lhs + move(rhs) == x);
 }
-#endif
 
-int main() {
-  {
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+int main()
+{
+    {
     typedef std::string S;
     test0("", S(""), S(""));
     test0("", S("12345"), S("12345"));
@@ -50,43 +56,36 @@
     test0("abcdefghij", S(""), S("abcdefghij"));
     test0("abcdefghij", S("12345"), S("abcdefghij12345"));
     test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890"));
-    test0("abcdefghij", S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
+    test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890"));
     test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst"));
     test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345"));
-    test0("abcdefghijklmnopqrst", S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test0("abcdefghijklmnopqrst", S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
+    test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    test1("", S(""), S(""));
+    test1("", S("12345"), S("12345"));
+    test1("", S("1234567890"), S("1234567890"));
+    test1("", S("12345678901234567890"), S("12345678901234567890"));
+    test1("abcde", S(""), S("abcde"));
+    test1("abcde", S("12345"), S("abcde12345"));
+    test1("abcde", S("1234567890"), S("abcde1234567890"));
+    test1("abcde", S("12345678901234567890"), S("abcde12345678901234567890"));
+    test1("abcdefghij", S(""), S("abcdefghij"));
+    test1("abcdefghij", S("12345"), S("abcdefghij12345"));
+    test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890"));
+    test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst"));
+    test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345"));
+    test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #if TEST_STD_VER >= 11
-  {
-    typedef std::string S;
-    test1("", S(""), S(""));
-    test1("", S("12345"), S("12345"));
-    test1("", S("1234567890"), S("1234567890"));
-    test1("", S("12345678901234567890"), S("12345678901234567890"));
-    test1("abcde", S(""), S("abcde"));
-    test1("abcde", S("12345"), S("abcde12345"));
-    test1("abcde", S("1234567890"), S("abcde1234567890"));
-    test1("abcde", S("12345678901234567890"), S("abcde12345678901234567890"));
-    test1("abcdefghij", S(""), S("abcdefghij"));
-    test1("abcdefghij", S("12345"), S("abcdefghij12345"));
-    test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890"));
-    test1("abcdefghij", S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst"));
-    test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345"));
-    test1("abcdefghijklmnopqrst", S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test1("abcdefghijklmnopqrst", S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
-  {
-    typedef std::basic_string<char, std::char_traits<char>,
-                              min_allocator<char> >
-        S;
+    {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
     test0("", S(""), S(""));
     test0("", S("12345"), S("12345"));
     test0("", S("1234567890"), S("1234567890"));
@@ -98,14 +97,13 @@
     test0("abcdefghij", S(""), S("abcdefghij"));
     test0("abcdefghij", S("12345"), S("abcdefghij12345"));
     test0("abcdefghij", S("1234567890"), S("abcdefghij1234567890"));
-    test0("abcdefghij", S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
+    test0("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890"));
     test0("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst"));
     test0("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345"));
-    test0("abcdefghijklmnopqrst", S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test0("abcdefghijklmnopqrst", S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
+    test0("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test0("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     test1("", S(""), S(""));
     test1("", S("12345"), S("12345"));
@@ -118,14 +116,13 @@
     test1("abcdefghij", S(""), S("abcdefghij"));
     test1("abcdefghij", S("12345"), S("abcdefghij12345"));
     test1("abcdefghij", S("1234567890"), S("abcdefghij1234567890"));
-    test1("abcdefghij", S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
+    test1("abcdefghij", S("12345678901234567890"), S("abcdefghij12345678901234567890"));
     test1("abcdefghijklmnopqrst", S(""), S("abcdefghijklmnopqrst"));
     test1("abcdefghijklmnopqrst", S("12345"), S("abcdefghijklmnopqrst12345"));
-    test1("abcdefghijklmnopqrst", S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test1("abcdefghijklmnopqrst", S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
+    test1("abcdefghijklmnopqrst", S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test1("abcdefghijklmnopqrst", S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #endif
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
index 9bc3a4d..b4c2c97 100644
--- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_char.pass.cpp
@@ -21,50 +21,60 @@
 #include <utility>
 #include <cassert>
 
-#include "test_macros.h"
 #include "min_allocator.h"
 
 template <class S>
-void test0(const S& lhs, typename S::value_type rhs, const S& x) {
-  assert(lhs + rhs == x);
+void
+test0(const S& lhs, typename S::value_type rhs, const S& x)
+{
+    assert(lhs + rhs == x);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class S>
-void test1(S&& lhs, typename S::value_type rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
+void
+test1(S&& lhs, typename S::value_type rhs, const S& x)
+{
+    assert(move(lhs) + rhs == x);
 }
-#endif
 
-int main() {
-  {
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+int main()
+{
+    {
     typedef std::string S;
     test0(S(""), '1', S("1"));
     test0(S("abcde"), '1', S("abcde1"));
     test0(S("abcdefghij"), '1', S("abcdefghij1"));
     test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1"));
-  }
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    test1(S(""), '1', S("1"));
+    test1(S("abcde"), '1', S("abcde1"));
+    test1(S("abcdefghij"), '1', S("abcdefghij1"));
+    test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #if TEST_STD_VER >= 11
-  {
-    typedef std::string S;
-    test1(S(""), '1', S("1"));
-    test1(S("abcde"), '1', S("abcde1"));
-    test1(S("abcdefghij"), '1', S("abcdefghij1"));
-    test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1"));
-  }
-  {
-    typedef std::basic_string<char, std::char_traits<char>,
-                              min_allocator<char> >
-        S;
+    {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
     test0(S(""), '1', S("1"));
     test0(S("abcde"), '1', S("abcde1"));
     test0(S("abcdefghij"), '1', S("abcdefghij1"));
     test0(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1"));
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
     test1(S(""), '1', S("1"));
     test1(S("abcde"), '1', S("abcde1"));
     test1(S("abcdefghij"), '1', S("abcdefghij1"));
     test1(S("abcdefghijklmnopqrst"), '1', S("abcdefghijklmnopqrst1"));
-  }
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #endif
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
index a9aa92f..3b669e7 100644
--- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_pointer.pass.cpp
@@ -21,23 +21,29 @@
 #include <utility>
 #include <cassert>
 
-#include "test_macros.h"
 #include "min_allocator.h"
 
 template <class S>
-void test0(const S& lhs, const typename S::value_type* rhs, const S& x) {
-  assert(lhs + rhs == x);
+void
+test0(const S& lhs, const typename S::value_type* rhs, const S& x)
+{
+    assert(lhs + rhs == x);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
 template <class S>
-void test1(S&& lhs, const typename S::value_type* rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
+void
+test1(S&& lhs, const typename S::value_type* rhs, const S& x)
+{
+    assert(move(lhs) + rhs == x);
 }
-#endif
 
-int main() {
-  {
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+int main()
+{
+    {
     typedef std::string S;
     test0(S(""), "", S(""));
     test0(S(""), "12345", S("12345"));
@@ -50,42 +56,36 @@
     test0(S("abcdefghij"), "", S("abcdefghij"));
     test0(S("abcdefghij"), "12345", S("abcdefghij12345"));
     test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890"));
-    test0(S("abcdefghij"), "12345678901234567890",
-          S("abcdefghij12345678901234567890"));
+    test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890"));
     test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst"));
     test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345"));
-    test0(S("abcdefghijklmnopqrst"), "1234567890",
-          S("abcdefghijklmnopqrst1234567890"));
-    test0(S("abcdefghijklmnopqrst"), "12345678901234567890",
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
+    test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890"));
+    test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890"));
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    test1(S(""), "", S(""));
+    test1(S(""), "12345", S("12345"));
+    test1(S(""), "1234567890", S("1234567890"));
+    test1(S(""), "12345678901234567890", S("12345678901234567890"));
+    test1(S("abcde"), "", S("abcde"));
+    test1(S("abcde"), "12345", S("abcde12345"));
+    test1(S("abcde"), "1234567890", S("abcde1234567890"));
+    test1(S("abcde"), "12345678901234567890", S("abcde12345678901234567890"));
+    test1(S("abcdefghij"), "", S("abcdefghij"));
+    test1(S("abcdefghij"), "12345", S("abcdefghij12345"));
+    test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890"));
+    test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890"));
+    test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst"));
+    test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345"));
+    test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890"));
+    test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #if TEST_STD_VER >= 11
-  {
-    typedef std::string S;
-    test1(S(""), "", S(""));
-    test1(S(""), "12345", S("12345"));
-    test1(S(""), "1234567890", S("1234567890"));
-    test1(S(""), "12345678901234567890", S("12345678901234567890"));
-    test1(S("abcde"), "", S("abcde"));
-    test1(S("abcde"), "12345", S("abcde12345"));
-    test1(S("abcde"), "1234567890", S("abcde1234567890"));
-    test1(S("abcde"), "12345678901234567890", S("abcde12345678901234567890"));
-    test1(S("abcdefghij"), "", S("abcdefghij"));
-    test1(S("abcdefghij"), "12345", S("abcdefghij12345"));
-    test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890"));
-    test1(S("abcdefghij"), "12345678901234567890",
-          S("abcdefghij12345678901234567890"));
-    test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst"));
-    test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345"));
-    test1(S("abcdefghijklmnopqrst"), "1234567890",
-          S("abcdefghijklmnopqrst1234567890"));
-    test1(S("abcdefghijklmnopqrst"), "12345678901234567890",
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
-  {
-    typedef std::basic_string<char, std::char_traits<char>,
-                              min_allocator<char> >
-        S;
+    {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
     test0(S(""), "", S(""));
     test0(S(""), "12345", S("12345"));
     test0(S(""), "1234567890", S("1234567890"));
@@ -97,14 +97,13 @@
     test0(S("abcdefghij"), "", S("abcdefghij"));
     test0(S("abcdefghij"), "12345", S("abcdefghij12345"));
     test0(S("abcdefghij"), "1234567890", S("abcdefghij1234567890"));
-    test0(S("abcdefghij"), "12345678901234567890",
-          S("abcdefghij12345678901234567890"));
+    test0(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890"));
     test0(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst"));
     test0(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345"));
-    test0(S("abcdefghijklmnopqrst"), "1234567890",
-          S("abcdefghijklmnopqrst1234567890"));
-    test0(S("abcdefghijklmnopqrst"), "12345678901234567890",
-          S("abcdefghijklmnopqrst12345678901234567890"));
+    test0(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890"));
+    test0(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890"));
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
     test1(S(""), "", S(""));
     test1(S(""), "12345", S("12345"));
@@ -117,14 +116,13 @@
     test1(S("abcdefghij"), "", S("abcdefghij"));
     test1(S("abcdefghij"), "12345", S("abcdefghij12345"));
     test1(S("abcdefghij"), "1234567890", S("abcdefghij1234567890"));
-    test1(S("abcdefghij"), "12345678901234567890",
-          S("abcdefghij12345678901234567890"));
+    test1(S("abcdefghij"), "12345678901234567890", S("abcdefghij12345678901234567890"));
     test1(S("abcdefghijklmnopqrst"), "", S("abcdefghijklmnopqrst"));
     test1(S("abcdefghijklmnopqrst"), "12345", S("abcdefghijklmnopqrst12345"));
-    test1(S("abcdefghijklmnopqrst"), "1234567890",
-          S("abcdefghijklmnopqrst1234567890"));
-    test1(S("abcdefghijklmnopqrst"), "12345678901234567890",
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
+    test1(S("abcdefghijklmnopqrst"), "1234567890", S("abcdefghijklmnopqrst1234567890"));
+    test1(S("abcdefghijklmnopqrst"), "12345678901234567890", S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #endif
 }
diff --git a/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp b/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
index fbef646..1977b6f 100644
--- a/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
+++ b/test/std/strings/basic.string/string.nonmembers/string_op+/string_string.pass.cpp
@@ -33,217 +33,190 @@
 #include <utility>
 #include <cassert>
 
-#include "test_macros.h"
 #include "min_allocator.h"
 
 template <class S>
-void test0(const S& lhs, const S& rhs, const S& x) {
-  assert(lhs + rhs == x);
+void
+test0(const S& lhs, const S& rhs, const S& x)
+{
+    assert(lhs + rhs == x);
 }
 
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+template <class S>
+void
+test1(S&& lhs, const S& rhs, const S& x)
+{
+    assert(move(lhs) + rhs == x);
+}
+
+template <class S>
+void
+test2(const S& lhs, S&& rhs, const S& x)
+{
+    assert(lhs + move(rhs) == x);
+}
+
+template <class S>
+void
+test3(S&& lhs, S&& rhs, const S& x)
+{
+    assert(move(lhs) + move(rhs) == x);
+}
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+int main()
+{
+    {
+    typedef std::string S;
+    test0(S(""), S(""), S(""));
+    test0(S(""), S("12345"), S("12345"));
+    test0(S(""), S("1234567890"), S("1234567890"));
+    test0(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test0(S("abcde"), S(""), S("abcde"));
+    test0(S("abcde"), S("12345"), S("abcde12345"));
+    test0(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test0(S("abcdefghij"), S(""), S("abcdefghij"));
+    test0(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+
+    test1(S(""), S(""), S(""));
+    test1(S(""), S("12345"), S("12345"));
+    test1(S(""), S("1234567890"), S("1234567890"));
+    test1(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test1(S("abcde"), S(""), S("abcde"));
+    test1(S("abcde"), S("12345"), S("abcde12345"));
+    test1(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test1(S("abcdefghij"), S(""), S("abcdefghij"));
+    test1(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+    test2(S(""), S(""), S(""));
+    test2(S(""), S("12345"), S("12345"));
+    test2(S(""), S("1234567890"), S("1234567890"));
+    test2(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test2(S("abcde"), S(""), S("abcde"));
+    test2(S("abcde"), S("12345"), S("abcde12345"));
+    test2(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test2(S("abcdefghij"), S(""), S("abcdefghij"));
+    test2(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+    test3(S(""), S(""), S(""));
+    test3(S(""), S("12345"), S("12345"));
+    test3(S(""), S("1234567890"), S("1234567890"));
+    test3(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test3(S("abcde"), S(""), S("abcde"));
+    test3(S("abcde"), S("12345"), S("abcde12345"));
+    test3(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test3(S("abcdefghij"), S(""), S("abcdefghij"));
+    test3(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #if TEST_STD_VER >= 11
-template <class S>
-void test1(S&& lhs, const S& rhs, const S& x) {
-  assert(move(lhs) + rhs == x);
-}
+    {
+    typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S;
+    test0(S(""), S(""), S(""));
+    test0(S(""), S("12345"), S("12345"));
+    test0(S(""), S("1234567890"), S("1234567890"));
+    test0(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test0(S("abcde"), S(""), S("abcde"));
+    test0(S("abcde"), S("12345"), S("abcde12345"));
+    test0(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test0(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test0(S("abcdefghij"), S(""), S("abcdefghij"));
+    test0(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test0(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test0(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test0(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
 
-template <class S>
-void test2(const S& lhs, S&& rhs, const S& x) {
-  assert(lhs + move(rhs) == x);
-}
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
-template <class S>
-void test3(S&& lhs, S&& rhs, const S& x) {
-  assert(move(lhs) + move(rhs) == x);
-}
+    test1(S(""), S(""), S(""));
+    test1(S(""), S("12345"), S("12345"));
+    test1(S(""), S("1234567890"), S("1234567890"));
+    test1(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test1(S("abcde"), S(""), S("abcde"));
+    test1(S("abcde"), S("12345"), S("abcde12345"));
+    test1(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test1(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test1(S("abcdefghij"), S(""), S("abcdefghij"));
+    test1(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test1(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test1(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test1(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
 
+    test2(S(""), S(""), S(""));
+    test2(S(""), S("12345"), S("12345"));
+    test2(S(""), S("1234567890"), S("1234567890"));
+    test2(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test2(S("abcde"), S(""), S("abcde"));
+    test2(S("abcde"), S("12345"), S("abcde12345"));
+    test2(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test2(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test2(S("abcdefghij"), S(""), S("abcdefghij"));
+    test2(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test2(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test2(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test2(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+    test3(S(""), S(""), S(""));
+    test3(S(""), S("12345"), S("12345"));
+    test3(S(""), S("1234567890"), S("1234567890"));
+    test3(S(""), S("12345678901234567890"), S("12345678901234567890"));
+    test3(S("abcde"), S(""), S("abcde"));
+    test3(S("abcde"), S("12345"), S("abcde12345"));
+    test3(S("abcde"), S("1234567890"), S("abcde1234567890"));
+    test3(S("abcde"), S("12345678901234567890"), S("abcde12345678901234567890"));
+    test3(S("abcdefghij"), S(""), S("abcdefghij"));
+    test3(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
+    test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
+    test3(S("abcdefghij"), S("12345678901234567890"), S("abcdefghij12345678901234567890"));
+    test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
+    test3(S("abcdefghijklmnopqrst"), S("12345"), S("abcdefghijklmnopqrst12345"));
+    test3(S("abcdefghijklmnopqrst"), S("1234567890"), S("abcdefghijklmnopqrst1234567890"));
+    test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"), S("abcdefghijklmnopqrst12345678901234567890"));
+
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
+    }
 #endif
-
-int main() {
-  {
-    typedef std::string S;
-    test0(S(""), S(""), S(""));
-    test0(S(""), S("12345"), S("12345"));
-    test0(S(""), S("1234567890"), S("1234567890"));
-    test0(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test0(S("abcde"), S(""), S("abcde"));
-    test0(S("abcde"), S("12345"), S("abcde12345"));
-    test0(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test0(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test0(S("abcdefghij"), S(""), S("abcdefghij"));
-    test0(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test0(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test0(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test0(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
-#if TEST_STD_VER >= 11
-  {
-    typedef std::string S;
-    test1(S(""), S(""), S(""));
-    test1(S(""), S("12345"), S("12345"));
-    test1(S(""), S("1234567890"), S("1234567890"));
-    test1(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test1(S("abcde"), S(""), S("abcde"));
-    test1(S("abcde"), S("12345"), S("abcde12345"));
-    test1(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test1(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test1(S("abcdefghij"), S(""), S("abcdefghij"));
-    test1(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test1(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test1(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test1(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-
-    test2(S(""), S(""), S(""));
-    test2(S(""), S("12345"), S("12345"));
-    test2(S(""), S("1234567890"), S("1234567890"));
-    test2(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test2(S("abcde"), S(""), S("abcde"));
-    test2(S("abcde"), S("12345"), S("abcde12345"));
-    test2(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test2(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test2(S("abcdefghij"), S(""), S("abcdefghij"));
-    test2(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test2(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test2(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test2(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-
-    test3(S(""), S(""), S(""));
-    test3(S(""), S("12345"), S("12345"));
-    test3(S(""), S("1234567890"), S("1234567890"));
-    test3(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test3(S("abcde"), S(""), S("abcde"));
-    test3(S("abcde"), S("12345"), S("abcde12345"));
-    test3(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test3(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test3(S("abcdefghij"), S(""), S("abcdefghij"));
-    test3(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test3(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test3(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test3(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
-  {
-    typedef std::basic_string<char, std::char_traits<char>,
-                              min_allocator<char> >
-        S;
-    test0(S(""), S(""), S(""));
-    test0(S(""), S("12345"), S("12345"));
-    test0(S(""), S("1234567890"), S("1234567890"));
-    test0(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test0(S("abcde"), S(""), S("abcde"));
-    test0(S("abcde"), S("12345"), S("abcde12345"));
-    test0(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test0(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test0(S("abcdefghij"), S(""), S("abcdefghij"));
-    test0(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test0(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test0(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test0(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test0(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test0(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test0(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-
-    test1(S(""), S(""), S(""));
-    test1(S(""), S("12345"), S("12345"));
-    test1(S(""), S("1234567890"), S("1234567890"));
-    test1(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test1(S("abcde"), S(""), S("abcde"));
-    test1(S("abcde"), S("12345"), S("abcde12345"));
-    test1(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test1(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test1(S("abcdefghij"), S(""), S("abcdefghij"));
-    test1(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test1(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test1(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test1(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test1(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test1(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test1(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-
-    test2(S(""), S(""), S(""));
-    test2(S(""), S("12345"), S("12345"));
-    test2(S(""), S("1234567890"), S("1234567890"));
-    test2(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test2(S("abcde"), S(""), S("abcde"));
-    test2(S("abcde"), S("12345"), S("abcde12345"));
-    test2(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test2(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test2(S("abcdefghij"), S(""), S("abcdefghij"));
-    test2(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test2(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test2(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test2(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test2(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test2(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test2(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-
-    test3(S(""), S(""), S(""));
-    test3(S(""), S("12345"), S("12345"));
-    test3(S(""), S("1234567890"), S("1234567890"));
-    test3(S(""), S("12345678901234567890"), S("12345678901234567890"));
-    test3(S("abcde"), S(""), S("abcde"));
-    test3(S("abcde"), S("12345"), S("abcde12345"));
-    test3(S("abcde"), S("1234567890"), S("abcde1234567890"));
-    test3(S("abcde"), S("12345678901234567890"),
-          S("abcde12345678901234567890"));
-    test3(S("abcdefghij"), S(""), S("abcdefghij"));
-    test3(S("abcdefghij"), S("12345"), S("abcdefghij12345"));
-    test3(S("abcdefghij"), S("1234567890"), S("abcdefghij1234567890"));
-    test3(S("abcdefghij"), S("12345678901234567890"),
-          S("abcdefghij12345678901234567890"));
-    test3(S("abcdefghijklmnopqrst"), S(""), S("abcdefghijklmnopqrst"));
-    test3(S("abcdefghijklmnopqrst"), S("12345"),
-          S("abcdefghijklmnopqrst12345"));
-    test3(S("abcdefghijklmnopqrst"), S("1234567890"),
-          S("abcdefghijklmnopqrst1234567890"));
-    test3(S("abcdefghijklmnopqrst"), S("12345678901234567890"),
-          S("abcdefghijklmnopqrst12345678901234567890"));
-  }
-#endif // TEST_STD_VER >= 11
 }
diff --git a/test/std/strings/basic.string/traits_mismatch.fail.cpp b/test/std/strings/basic.string/traits_mismatch.fail.cpp
deleted file mode 100644
index 1d54238..0000000
--- a/test/std/strings/basic.string/traits_mismatch.fail.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string>
-//   The strings's value type must be the same as the traits's char_type
-
-#include <string>
-
-int main()
-{
-    std::basic_string<char, std::char_traits<wchar_t>> s;
-}
diff --git a/test/std/strings/string.conversions/stof.pass.cpp b/test/std/strings/string.conversions/stof.pass.cpp
index a5e5872..1e17e1d 100644
--- a/test/std/strings/string.conversions/stof.pass.cpp
+++ b/test/std/strings/string.conversions/stof.pass.cpp
@@ -7,9 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR14919 was fixed in r172447, out_of_range wasn't thrown before.
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <string>
 
diff --git a/test/std/strings/string.conversions/stol.pass.cpp b/test/std/strings/string.conversions/stol.pass.cpp
index 5e16735..457cf0a 100644
--- a/test/std/strings/string.conversions/stol.pass.cpp
+++ b/test/std/strings/string.conversions/stol.pass.cpp
@@ -7,9 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR14919 was fixed in r172447, out_of_range wasn't thrown before.
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <string>
 
diff --git a/test/std/strings/string.conversions/stoll.pass.cpp b/test/std/strings/string.conversions/stoll.pass.cpp
index c33f9ee..ca8412a 100644
--- a/test/std/strings/string.conversions/stoll.pass.cpp
+++ b/test/std/strings/string.conversions/stoll.pass.cpp
@@ -7,9 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR14919 was fixed in r172447, out_of_range wasn't thrown before.
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <string>
 
diff --git a/test/std/strings/string.conversions/stoul.pass.cpp b/test/std/strings/string.conversions/stoul.pass.cpp
index 523c49a..1acdf11 100644
--- a/test/std/strings/string.conversions/stoul.pass.cpp
+++ b/test/std/strings/string.conversions/stoul.pass.cpp
@@ -7,9 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR14919 was fixed in r172447, out_of_range wasn't thrown before.
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <string>
 
diff --git a/test/std/strings/string.conversions/stoull.pass.cpp b/test/std/strings/string.conversions/stoull.pass.cpp
index 549c8da..e63679e 100644
--- a/test/std/strings/string.conversions/stoull.pass.cpp
+++ b/test/std/strings/string.conversions/stoull.pass.cpp
@@ -7,9 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// PR14919 was fixed in r172447, out_of_range wasn't thrown before.
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <string>
 
diff --git a/test/libcxx/selftest/test.arc.fail.mm b/test/std/strings/string.view/nothing_to_do.pass.cpp
similarity index 79%
rename from test/libcxx/selftest/test.arc.fail.mm
rename to test/std/strings/string.view/nothing_to_do.pass.cpp
index a185eab..353dd98 100644
--- a/test/libcxx/selftest/test.arc.fail.mm
+++ b/test/std/strings/string.view/nothing_to_do.pass.cpp
@@ -1,4 +1,3 @@
-// -*- C++ -*-
 //===----------------------------------------------------------------------===//
 //
 //                     The LLVM Compiler Infrastructure
@@ -8,6 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-#if __has_feature(objc_arc)
-#error This test should not compile.
-#endif
+#include <string_view>
+
+int main () {}
diff --git a/test/std/strings/string.view/string.view.hash/string_view.pass.cpp b/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
index 53c3d26..d076648 100644
--- a/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
+++ b/test/std/strings/string.view/string.view.hash/string_view.pass.cpp
@@ -23,8 +23,6 @@
 #include <cassert>
 #include <type_traits>
 
-#include "test_macros.h"
-
 using std::string_view;
 
 template <class SV>
@@ -38,7 +36,6 @@
     typedef typename SV::value_type char_type;
     typedef std::basic_string<char_type> String;
     typedef std::hash<String> SH;
-    ASSERT_NOEXCEPT(H()(SV()));
 
     char_type g1 [ 10 ];
     char_type g2 [ 10 ];
diff --git a/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp b/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp
new file mode 100644
index 0000000..c1137e8
--- /dev/null
+++ b/test/std/strings/string.view/string.view.modifiers/clear.pass.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+
+// <string_view>
+
+// void clear() noexcept
+
+#include <string_view>
+#include <cassert>
+
+#include "test_macros.h"
+
+template<typename CharT>
+void test ( const CharT *s, size_t len ) {
+    typedef std::basic_string_view<CharT> SV;
+    {
+    SV sv1 ( s );
+    assert ( sv1.size() == len );
+    assert ( sv1.data() == s );
+
+    sv1.clear ();
+    assert ( sv1.data() == nullptr );
+    assert ( sv1.size() == 0 );
+    assert ( sv1 == SV());
+    }
+}
+
+#if TEST_STD_VER > 11
+constexpr size_t test_ce ( size_t n ) {
+    typedef std::basic_string_view<char> SV;
+    SV sv1{ "ABCDEFGHIJKL", n };
+    sv1.clear();
+    return sv1.size();
+}
+#endif
+
+int main () {
+    test ( "ABCDE", 5 );
+    test ( "a", 1 );
+    test ( "", 0 );
+
+    test ( L"ABCDE", 5 );
+    test ( L"a", 1 );
+    test ( L"", 0 );
+
+#if TEST_STD_VER >= 11
+    test ( u"ABCDE", 5 );
+    test ( u"a", 1 );
+    test ( u"", 0 );
+
+    test ( U"ABCDE", 5 );
+    test ( U"a", 1 );
+    test ( U"", 0 );
+#endif
+
+#if TEST_STD_VER > 11
+    static_assert ( test_ce (5) == 0, "" );
+#endif
+
+}
diff --git a/test/std/strings/string.view/traits_mismatch.fail.cpp b/test/std/strings/string.view/traits_mismatch.fail.cpp
deleted file mode 100644
index 6cd15e6..0000000
--- a/test/std/strings/string.view/traits_mismatch.fail.cpp
+++ /dev/null
@@ -1,18 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <string_view>
-//   The string_views's value type must be the same as the traits's char_type
-
-#include <string_view>
-
-int main()
-{
-    std::basic_string_view<char, std::char_traits<wchar_t>> s;
-}
diff --git a/test/std/thread/futures/futures.future_error/what.pass.cpp b/test/std/thread/futures/futures.future_error/what.pass.cpp
index 957d530..a44f8af 100644
--- a/test/std/thread/futures/futures.future_error/what.pass.cpp
+++ b/test/std/thread/futures/futures.future_error/what.pass.cpp
@@ -12,11 +12,9 @@
 // LWG 2056 changed the values of future_errc, so if we're using new headers
 // with an old library we'll get incorrect messages.
 //
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin13
 
 // <future>
 
diff --git a/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp b/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
index 7cac21d..3978487 100644
--- a/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
+++ b/test/std/thread/futures/futures.task/futures.task.members/ctor_func_alloc.pass.cpp
@@ -69,7 +69,7 @@
         p(3, 'a');
         assert(f.get() == 105.0);
         assert(A::n_copies > 0);
-        assert(A::n_moves >= 0);
+        assert(A::n_moves > 0);
     }
     assert(test_alloc_base::alloc_count == 0);
     A::n_copies = 0;
diff --git a/test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp b/test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
similarity index 100%
rename from test/libcxx/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
rename to test/std/thread/thread.condition/PR30202_notify_from_pthread_created_thread.pass.cpp
diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
index a0071cd..245c480 100644
--- a/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock.algorithm/lock.pass.cpp
@@ -188,7 +188,7 @@
         }
     }
 #endif
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     {
         L0 l0;
         L0 l1;
@@ -518,5 +518,5 @@
         }
     }
 #endif  // TEST_HAS_NO_EXCEPTIONS
-#endif // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 }
diff --git a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
index 4ad7a3a..fb563cb 100644
--- a/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock.algorithm/try_lock.pass.cpp
@@ -126,7 +126,7 @@
         }
     }
 #endif
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     {
         L0 l0;
         L0 l1;
@@ -522,5 +522,5 @@
         assert(!l2.locked());
         assert(!l3.locked());
     }
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
index 97f9d07..a15405f 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/mutex.pass.cpp
@@ -15,16 +15,11 @@
 
 // explicit lock_guard(mutex_type& m);
 
-// template<class _Mutex> lock_guard(lock_guard<_Mutex>)
-//     -> lock_guard<_Mutex>;  // C++17
-
 #include <mutex>
 #include <thread>
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
 std::mutex m;
 
 typedef std::chrono::system_clock Clock;
@@ -52,9 +47,4 @@
     std::this_thread::sleep_for(ms(250));
     m.unlock();
     t.join();
-
-#ifdef __cpp_deduction_guides
-    std::lock_guard lg(m);
-    static_assert((std::is_same<decltype(lg), std::lock_guard<decltype(m)>>::value), "" );
-#endif
 }
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.guard/variadic_adopt_lock.pass.cpp
similarity index 71%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/adopt_lock.pass.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_adopt_lock.pass.cpp
index 7816538..81fc0d3 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.guard/variadic_adopt_lock.pass.cpp
@@ -8,17 +8,18 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class ...Mutex> class scoped_lock;
+// template <class ...Mutex> class lock_guard;
 
-// scoped_lock(Mutex&..., adopt_lock_t);
+// lock_guard(Mutex&..., adopt_lock_t);
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
 #include <cassert>
-#include "test_macros.h"
 
 struct TestMutex {
     bool locked = false;
@@ -35,22 +36,12 @@
 int main()
 {
     {
-        using LG = std::scoped_lock<>;
+        using LG = std::lock_guard<>;
         LG lg(std::adopt_lock);
     }
     {
-        TestMutex m1;
-        using LG = std::scoped_lock<TestMutex>;
-        m1.lock();
-        {
-            LG lg(m1, std::adopt_lock);
-            assert(m1.locked);
-        }
-        assert(!m1.locked);
-    }
-    {
         TestMutex m1, m2;
-        using LG = std::scoped_lock<TestMutex, TestMutex>;
+        using LG = std::lock_guard<TestMutex, TestMutex>;
         m1.lock(); m2.lock();
         {
             LG lg(m1, m2, std::adopt_lock);
@@ -60,7 +51,7 @@
     }
     {
         TestMutex m1, m2, m3;
-        using LG = std::scoped_lock<TestMutex, TestMutex, TestMutex>;
+        using LG = std::lock_guard<TestMutex, TestMutex, TestMutex>;
         m1.lock(); m2.lock(); m3.lock();
         {
             LG lg(m1, m2, m3, std::adopt_lock);
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/assign.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
similarity index 66%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/assign.fail.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
index a054729..1b4c9d4 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/assign.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_assign.fail.cpp
@@ -8,16 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class ...Mutex> class scoped_lock;
+// template <class ...Mutex> class lock_guard;
 
-// scoped_lock& operator=(scoped_lock const&) = delete;
+// lock_guard& operator=(lock_guard const&) = delete;
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
-#include "test_macros.h"
 
 int main()
 {
@@ -25,24 +26,18 @@
     M m0, m1, m2;
     M om0, om1, om2;
     {
-        using LG = std::scoped_lock<>;
+        using LG = std::lock_guard<>;
         LG lg1, lg2;
         lg1 = lg2; // expected-error{{overload resolution selected deleted operator '='}}
     }
     {
-        using LG = std::scoped_lock<M>;
-        LG lg1(m0);
-        LG lg2(om0);
-        lg1 = lg2; // expected-error{{overload resolution selected deleted operator '='}}
-    }
-    {
-        using LG = std::scoped_lock<M, M>;
+        using LG = std::lock_guard<M, M>;
         LG lg1(m0, m1);
         LG lg2(om0, om1);
         lg1 = lg2; // expected-error{{overload resolution selected deleted operator '='}}
     }
     {
-        using LG = std::scoped_lock<M, M, M>;
+        using LG = std::lock_guard<M, M, M>;
         LG lg1(m0, m1, m2);
         LG lg2(om0, om1, om2);
         lg1 = lg2; // expected-error{{overload resolution selected deleted operator '='}}
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/copy.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
similarity index 65%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/copy.fail.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
index 5075a42..c7fd0e9 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/copy.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_copy.fail.cpp
@@ -8,38 +8,34 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class ...Mutex> class scoped_lock;
+// template <class ...Mutex> class lock_guard;
 
-// scoped_lock(scoped_lock const&) = delete;
+// lock_guard(lock_guard const&) = delete;
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
-#include "test_macros.h"
 
 int main()
 {
     using M = std::mutex;
     M m0, m1, m2;
     {
-        using LG = std::scoped_lock<>;
+        using LG = std::lock_guard<>;
         const LG Orig;
         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
     }
     {
-        using LG = std::scoped_lock<M>;
-        const LG Orig(m0);
-        LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
-    }
-    {
-        using LG = std::scoped_lock<M, M>;
+        using LG = std::lock_guard<M, M>;
         const LG Orig(m0, m1);
         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
     }
     {
-        using LG = std::scoped_lock<M, M, M>;
+        using LG = std::lock_guard<M, M, M>;
         const LG Orig(m0, m1, m2);
         LG Copy(Orig); // expected-error{{call to deleted constructor of 'LG'}}
     }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.fail.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
similarity index 68%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.fail.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
index 7bb4673..1eef7e2 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.fail.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.fail.cpp
@@ -8,16 +8,17 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class ...Mutex> class scoped_lock;
+// template <class ...Mutex> class lock_guard;
 
-// explicit scoped_lock(Mutex&...);
+// explicit lock_guard(Mutex&...);
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
-#include "test_macros.h"
 
 template <class LG>
 void test_conversion(LG) {}
@@ -28,25 +29,19 @@
     M m0, m1, m2;
     M n0, n1, n2;
     {
-        using LG = std::scoped_lock<>;
+        using LG = std::lock_guard<>;
         LG lg = {}; // expected-error{{chosen constructor is explicit in copy-initialization}}
         test_conversion<LG>({}); // expected-error{{no matching function for call}}
         ((void)lg);
     }
     {
-        using LG = std::scoped_lock<M>;
-        LG lg = {m0}; // expected-error{{chosen constructor is explicit in copy-initialization}}
-        test_conversion<LG>({n0}); // expected-error{{no matching function for call}}
-        ((void)lg);
-    }
-    {
-        using LG = std::scoped_lock<M, M>;
+        using LG = std::lock_guard<M, M>;
         LG lg = {m0, m1}; // expected-error{{chosen constructor is explicit in copy-initialization}}
         test_conversion<LG>({n0, n1}); // expected-error{{no matching function for call}}
         ((void)lg);
     }
     {
-        using LG = std::scoped_lock<M, M, M>;
+        using LG = std::lock_guard<M, M, M>;
         LG lg = {m0, m1, m2}; // expected-error{{chosen constructor is explicit in copy-initialization}}
         test_conversion<LG>({n0, n1, n2}); // expected-error{{no matching function for call}}
     }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
similarity index 61%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
index cdf3cee..8d83ddf 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex.pass.cpp
@@ -8,16 +8,19 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class ...Mutex> class scoped_lock;
+// template <class ...Mutex> class lock_guard;
 
-// explicit scoped_lock(mutex_type& m);
+// explicit lock_guard(mutex_type& m);
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
 #include <cassert>
+
 #include "test_macros.h"
 
 struct TestMutex {
@@ -65,20 +68,11 @@
 int main()
 {
     {
-        using LG = std::scoped_lock<>;
+        using LG = std::lock_guard<>;
         LG lg;
     }
     {
-        using LG = std::scoped_lock<TestMutex>;
-        TestMutex m1;
-        {
-            LG lg(m1);
-            assert(m1.locked);
-        }
-        assert(!m1.locked);
-    }
-    {
-        using LG = std::scoped_lock<TestMutex, TestMutex>;
+        using LG = std::lock_guard<TestMutex, TestMutex>;
         TestMutex m1, m2;
         {
             LG lg(m1, m2);
@@ -87,7 +81,7 @@
         assert(!m1.locked && !m2.locked);
     }
     {
-        using LG = std::scoped_lock<TestMutex, TestMutex, TestMutex>;
+        using LG = std::lock_guard<TestMutex, TestMutex, TestMutex>;
         TestMutex m1, m2, m3;
         {
             LG lg(m1, m2, m3);
@@ -98,18 +92,7 @@
 #if !defined(TEST_HAS_NO_EXCEPTIONS)
     {
         using MT = TestMutexThrows;
-        using LG = std::scoped_lock<MT>;
-        MT m1;
-        m1.throws_on_lock = true;
-        try {
-            LG lg(m1);
-            assert(false);
-        } catch (int) {}
-        assert(!m1.locked);
-    }
-    {
-        using MT = TestMutexThrows;
-        using LG = std::scoped_lock<MT, MT>;
+        using LG = std::lock_guard<MT, MT>;
         MT m1, m2;
         m1.throws_on_lock = true;
         try {
@@ -120,7 +103,7 @@
     }
     {
         using MT = TestMutexThrows;
-        using LG = std::scoped_lock<MT, MT, MT>;
+        using LG = std::lock_guard<MT, MT, MT>;
         MT m1, m2, m3;
         m2.throws_on_lock = true;
         try {
@@ -130,26 +113,4 @@
         assert(!m1.locked && !m2.locked && !m3.locked);
     }
 #endif
-
-#ifdef __cpp_deduction_guides
-    {
-    TestMutex m1, m2, m3;
-        {
-        std::scoped_lock sl{};
-        static_assert((std::is_same<decltype(sl), std::scoped_lock<>>::value), "" );
-        }
-        {
-        std::scoped_lock sl{m1};
-        static_assert((std::is_same<decltype(sl), std::scoped_lock<decltype(m1)>>::value), "" );
-        }
-        {
-        std::scoped_lock sl{m1, m2};
-        static_assert((std::is_same<decltype(sl), std::scoped_lock<decltype(m1), decltype(m2)>>::value), "" );
-        }
-        {
-        std::scoped_lock sl{m1, m2, m3};
-        static_assert((std::is_same<decltype(sl), std::scoped_lock<decltype(m1), decltype(m2), decltype(m3)>>::value), "" );
-        }
-    }
-#endif
 }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
new file mode 100644
index 0000000..0ad16e2
--- /dev/null
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_mutex_cxx03.pass.cpp
@@ -0,0 +1,21 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// UNSUPPORTED: libcpp-has-no-threads
+// <mutex>
+
+// template <class ...Mutex> class lock_guard;
+
+// Test that the variadic lock guard implementation compiles in all standard
+// dialects, including C++03, even though it is forward declared using
+// variadic templates.
+
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#include "mutex.pass.cpp" // Use the existing non-variadic test
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/types.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
similarity index 75%
rename from test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/types.pass.cpp
rename to test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
index 6af3c6c..600399d 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.scoped/types.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.guard/variadic_types.pass.cpp
@@ -8,21 +8,22 @@
 //===----------------------------------------------------------------------===//
 //
 // UNSUPPORTED: libcpp-has-no-threads
-// UNSUPPORTED: c++98, c++03, c++11, c++14
+// UNSUPPORTED: c++98, c++03
 
 // <mutex>
 
-// template <class Mutex...>
-// class scoped_lock
+// template <class Mutex>
+// class lock_guard
 // {
 // public:
-//     typedef Mutex mutex_type;  // only if sizeof...(Mutex) == 1
+//     typedef Mutex mutex_type;
 //     ...
 // };
 
+// MODULES_DEFINES: _LIBCPP_ABI_VARIADIC_LOCK_GUARD
+#define _LIBCPP_ABI_VARIADIC_LOCK_GUARD
 #include <mutex>
 #include <type_traits>
-#include "test_macros.h"
 
 struct NAT {};
 
@@ -40,39 +41,39 @@
 int main()
 {
     {
-        using T = std::scoped_lock<>;
+        using T = std::lock_guard<>;
         static_assert(!has_mutex_type<T>(), "");
     }
     {
         using M1 = std::mutex;
-        using T = std::scoped_lock<M1>;
+        using T = std::lock_guard<M1>;
         static_assert(std::is_same<T::mutex_type, M1>::value, "");
     }
     {
         using M1 = std::recursive_mutex;
-        using T = std::scoped_lock<M1>;
+        using T = std::lock_guard<M1>;
         static_assert(std::is_same<T::mutex_type, M1>::value, "");
     }
     {
         using M1 = std::mutex;
         using M2 = std::recursive_mutex;
-        using T = std::scoped_lock<M1, M2>;
+        using T = std::lock_guard<M1, M2>;
         static_assert(!has_mutex_type<T>(), "");
     }
     {
         using M1 = std::mutex;
         using M2 = std::recursive_mutex;
-        using T = std::scoped_lock<M1, M1, M2>;
+        using T = std::lock_guard<M1, M1, M2>;
         static_assert(!has_mutex_type<T>(), "");
     }
     {
         using M1 = std::mutex;
-        using T = std::scoped_lock<M1, M1>;
+        using T = std::lock_guard<M1, M1>;
         static_assert(!has_mutex_type<T>(), "");
     }
     {
         using M1 = std::recursive_mutex;
-        using T = std::scoped_lock<M1, M1, M1>;
+        using T = std::lock_guard<M1, M1, M1>;
         static_assert(!has_mutex_type<T>(), "");
     }
 }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg
deleted file mode 100644
index fd3dc77..0000000
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if 'availability' in config.available_features:
-    config.unsupported = True
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
index ac33806..f9a5370 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.shared/thread.lock.shared.cons/mutex.pass.cpp
@@ -18,9 +18,6 @@
 
 // explicit shared_lock(mutex_type& m);
 
-// template<class _Mutex> shared_lock(shared_lock<_Mutex>)
-//     -> shared_lock<_Mutex>;  // C++17
-
 #include <shared_mutex>
 #include <thread>
 #include <vector>
@@ -95,9 +92,4 @@
             t.join();
         q.join();
     }
-
-#ifdef __cpp_deduction_guides
-    std::shared_lock sl(m);
-    static_assert((std::is_same<decltype(sl), std::shared_lock<decltype(m)>>::value), "" );
-#endif
 }
diff --git a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
index ca8bc69..1f7217a 100644
--- a/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.lock/thread.lock.unique/thread.lock.unique.cons/mutex.pass.cpp
@@ -15,16 +15,11 @@
 
 // explicit unique_lock(mutex_type& m);
 
-// template<class _Mutex> unique_lock(unique_lock<_Mutex>)
-//     -> unique_lock<_Mutex>;  // C++17
-
 #include <mutex>
 #include <thread>
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
 std::mutex m;
 
 typedef std::chrono::system_clock Clock;
@@ -52,9 +47,4 @@
     std::this_thread::sleep_for(ms(250));
     m.unlock();
     t.join();
-
-#ifdef __cpp_deduction_guides
-	std::unique_lock ul(m);
-    static_assert((std::is_same<decltype(ul), std::unique_lock<decltype(m)>>::value), "" );
-#endif
 }
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/default.pass.cpp b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/default.pass.cpp
index 48c3a73..4de42fb 100644
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/default.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.mutex.requirements.mutex/thread.mutex.class/default.pass.cpp
@@ -16,10 +16,8 @@
 // mutex();
 
 #include <mutex>
-#include <type_traits>
 
 int main()
 {
-    static_assert(std::is_nothrow_default_constructible<std::mutex>::value, "");
     std::mutex m;
 }
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/lit.local.cfg b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/lit.local.cfg
deleted file mode 100644
index fd3dc77..0000000
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.shared_mutex.requirements/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if 'availability' in config.available_features:
-    config.unsupported = True
diff --git a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/lit.local.cfg b/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/lit.local.cfg
deleted file mode 100644
index fd3dc77..0000000
--- a/test/std/thread/thread.mutex/thread.mutex.requirements/thread.sharedtimedmutex.requirements/lit.local.cfg
+++ /dev/null
@@ -1,2 +0,0 @@
-if 'availability' in config.available_features:
-    config.unsupported = True
diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
index dfd2f10..138b657 100644
--- a/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.once/thread.once.callonce/call_once.pass.cpp
@@ -66,7 +66,7 @@
 #endif
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 struct init1
 {
@@ -101,7 +101,7 @@
     std::call_once(flg2, init2(), 4, 5);
 }
 
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 
 std::once_flag flg41;
 std::once_flag flg42;
@@ -135,7 +135,7 @@
     std::call_once(flg41, init41);
 }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
 
 class MoveOnly
 {
@@ -174,6 +174,7 @@
     void operator()(int&) {}
 };
 
+#if TEST_STD_VER >= 11
 // reference qualifiers on functions are a C++11 extension
 struct RefQual
 {
@@ -184,8 +185,8 @@
     void operator()() & { ++lv_called; }
     void operator()() && { ++rv_called; }
 };
-
-#endif // TEST_STD_VER >= 11
+#endif
+#endif
 
 int main()
 {
@@ -217,7 +218,7 @@
         assert(init41_called == 1);
         assert(init42_called == 1);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     // check functors with 1 arg
     {
         std::thread t0(f1);
@@ -244,6 +245,7 @@
         int i = 0;
         std::call_once(f, NonCopyable(), i);
     }
+#if TEST_STD_VER >= 11
 // reference qualifiers on functions are a C++11 extension
     {
         std::once_flag f1, f2;
@@ -253,5 +255,6 @@
         std::call_once(f2, std::move(rq));
         assert(rq.rv_called == 1);
     }
-#endif  // TEST_STD_VER >= 11
+#endif
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 }
diff --git a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp
index 21011ed..6995f06 100644
--- a/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp
+++ b/test/std/thread/thread.mutex/thread.once/thread.once.onceflag/default.pass.cpp
@@ -14,14 +14,13 @@
 // constexpr once_flag() noexcept;
 
 #include <mutex>
-#include "test_macros.h"
 
 int main()
 {
     {
     std::once_flag f;
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::once_flag f;
     }
diff --git a/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
index 4f1491d..f7d4deb 100644
--- a/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.class/thread.thread.id/thread_id.pass.cpp
@@ -23,8 +23,6 @@
 #include <thread>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     std::thread::id id1;
@@ -32,7 +30,6 @@
     typedef std::hash<std::thread::id> H;
     static_assert((std::is_same<typename H::argument_type, std::thread::id>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(id2));
     H h;
     assert(h(id1) != h(id2));
 }
diff --git a/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp b/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
similarity index 80%
rename from test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
rename to test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
index b46c2cd..27e1d2a 100644
--- a/test/libcxx/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
+++ b/test/std/thread/thread.threads/thread.thread.this/sleep_for.pass.cpp
@@ -9,18 +9,6 @@
 //
 // UNSUPPORTED: libcpp-has-no-threads
 
-// This test uses the POSIX header <sys/time.h> which Windows doesn't provide
-// UNSUPPORTED: windows
-
-// This test depends on signal behaviour until r210210, so some system libs
-// don't pass.
-//
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.8
-// XFAIL: with_system_cxx_lib=macosx10.7
-
 // <thread>
 
 // template <class Rep, class Period>
diff --git a/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp b/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp
deleted file mode 100644
index 3406fff..0000000
--- a/test/std/thread/thread.threads/thread.thread.this/sleep_for_tested_elsewhere.pass.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <thread>
-
-// template <class Rep, class Period>
-//   void sleep_for(const chrono::duration<Rep, Period>& rel_time);
-
-// The std::this_thread::sleep_for test requires POSIX specific headers and
-// is therefore non-standard. For this reason the test lives under the 'libcxx'
-// subdirectory.
-
-int main()
-{
-}
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
index 2aa19c6..0aef2af 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.cnstr/allocs.pass.cpp
@@ -107,11 +107,5 @@
         assert((a.inner_allocator() ==
             std::scoped_allocator_adaptor<A2<int>, A3<int>>(A2<int>(5), A3<int>(6))));
     }
-//  Test for LWG2782
-    {
-        static_assert(!std::is_convertible<A1<int>, A2<int>>::value, "");
-        static_assert(!std::is_convertible<
-             std::scoped_allocator_adaptor<A1<int>>, 
-             std::scoped_allocator_adaptor<A2<int>>>::value, "");
-    }
+
 }
diff --git a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
index 82d63ec..4e73d80 100644
--- a/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
+++ b/test/std/utilities/allocator.adaptor/allocator.adaptor.members/construct_pair.pass.cpp
@@ -39,7 +39,6 @@
         using SA = std::scoped_allocator_adaptor<Alloc>;
         static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
         Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
-        assert(ptr);
         Alloc CA(P);
         SA A(CA);
         A.construct(ptr);
@@ -62,7 +61,6 @@
         using SA = std::scoped_allocator_adaptor<Alloc>;
         static_assert(std::uses_allocator<T, CountingAllocator<T> >::value, "");
         Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
-        assert(ptr);
         Alloc CA(P);
         SA A(CA);
         A.construct(ptr);
@@ -79,6 +77,7 @@
 
 void test_with_inner_alloc()
 {
+    using VoidAlloc1 = CountingAllocator<void, 1>;
     using VoidAlloc2 = CountingAllocator<void, 2>;
 
     AllocController POuter;
@@ -94,7 +93,6 @@
         static_assert(!std::uses_allocator<T, Outer>::value, "");
         static_assert(std::uses_allocator<T, Inner>::value, "");
         Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
-        assert(ptr);
         Outer O(POuter);
         Inner I(PInner);
         SA A(O, I);
@@ -121,7 +119,6 @@
         static_assert(!std::uses_allocator<T, Outer>::value, "");
         static_assert(std::uses_allocator<T, Inner>::value, "");
         Pair * ptr = (Pair*)std::malloc(sizeof(Pair));
-        assert(ptr);
         Outer O(POuter);
         Inner I(PInner);
         SA A(O, I);
diff --git a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
index 37618f7..eba9bc6 100644
--- a/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
+++ b/test/std/utilities/any/any.class/any.assign/copy.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any& operator=(any const &);
diff --git a/test/std/utilities/any/any.class/any.assign/move.pass.cpp b/test/std/utilities/any/any.class/any.assign/move.pass.cpp
index 418f200..2063e4f 100644
--- a/test/std/utilities/any/any.class/any.assign/move.pass.cpp
+++ b/test/std/utilities/any/any.class/any.assign/move.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any& operator=(any &&);
diff --git a/test/std/utilities/any/any.class/any.assign/value.pass.cpp b/test/std/utilities/any/any.class/any.assign/value.pass.cpp
index ddedb88..6af4817 100644
--- a/test/std/utilities/any/any.class/any.assign/value.pass.cpp
+++ b/test/std/utilities/any/any.class/any.assign/value.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class ValueType>
diff --git a/test/std/utilities/any/any.class/any.cons/copy.pass.cpp b/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
index aceb9e6..021c9e4 100644
--- a/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
+++ b/test/std/utilities/any/any.class/any.cons/copy.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any(any const &);
diff --git a/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp b/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
index d01a88d..4cf5d91 100644
--- a/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
+++ b/test/std/utilities/any/any.class/any.cons/in_place_type.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class T, class ...Args> any(in_place_type_t<T>, Args&&...);
diff --git a/test/std/utilities/any/any.class/any.cons/move.pass.cpp b/test/std/utilities/any/any.class/any.cons/move.pass.cpp
index 09e9288..fb7dda8 100644
--- a/test/std/utilities/any/any.class/any.cons/move.pass.cpp
+++ b/test/std/utilities/any/any.class/any.cons/move.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any(any &&) noexcept;
diff --git a/test/std/utilities/any/any.class/any.cons/value.pass.cpp b/test/std/utilities/any/any.class/any.cons/value.pass.cpp
index d18de06..a164fbe 100644
--- a/test/std/utilities/any/any.class/any.cons/value.pass.cpp
+++ b/test/std/utilities/any/any.class/any.cons/value.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class Value> any(Value &&)
@@ -158,4 +151,4 @@
     test_copy_value_throws<large_throws_on_copy>();
     test_move_value_throws();
     test_sfinae_constraints();
-}
+}
\ No newline at end of file
diff --git a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
index 789a861..65d94fd 100644
--- a/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
+++ b/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -9,18 +9,11 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
-// template <class T, class ...Args> T& emplace(Args&&...);
+// template <class T, class ...Args> emplace(Args&&...);
 // template <class T, class U, class ...Args>
-// T& emplace(initializer_list<U>, Args&&...);
+// void emplace(initializer_list<U>, Args&&...);
 
 #include <any>
 #include <cassert>
@@ -49,9 +42,7 @@
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
 
-        auto &v = a.emplace<Type>();
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
+        a.emplace<Type>();
 
         assert(Tracked::count == 0);
         assert(Type::count == 1);
@@ -65,9 +56,7 @@
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
 
-        auto &v = a.emplace<Type>(101);
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
+        a.emplace<Type>(101);
 
         assert(Tracked::count == 0);
         assert(Type::count == 1);
@@ -81,9 +70,7 @@
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
 
-        auto &v = a.emplace<Type>(-1, 42, -1);
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
+        a.emplace<Type>(-1, 42, -1);
 
         assert(Tracked::count == 0);
         assert(Type::count == 1);
@@ -102,20 +89,14 @@
     {
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
-        auto &v = a.emplace<Type>();
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
-
+        a.emplace<Type>();
         assert(Tracked::count == 0);
         assertArgsMatch<Type>(a);
     }
     {
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
-        auto &v = a.emplace<Type>(-1, 42, -1);
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
-
+        a.emplace<Type>(-1, 42, -1);
         assert(Tracked::count == 0);
         assertArgsMatch<Type, int, int, int>(a);
     }
@@ -123,10 +104,7 @@
     {
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
-        auto &v = a.emplace<Type>({-1, 42, -1});
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
-
+        a.emplace<Type>({-1, 42, -1});
         assert(Tracked::count == 0);
         assertArgsMatch<Type, std::initializer_list<int>>(a);
     }
@@ -134,10 +112,7 @@
         int x = 42;
         any a(std::in_place_type<Tracked>);
         assert(Tracked::count == 1);
-        auto &v = a.emplace<Type>({-1, 42, -1}, x);
-        static_assert( std::is_same_v<Type&, decltype(v)>, "" );
-        assert(&v == std::any_cast<Type>(&a));
-
+        a.emplace<Type>({-1, 42, -1}, x);
         assert(Tracked::count == 0);
         assertArgsMatch<Type, std::initializer_list<int>, int&>(a);
     }
@@ -166,8 +141,7 @@
         std::any a(small{42});
         assert(small::count == 1);
         try {
-            auto &v = a.emplace<Type>(101);
-            static_assert( std::is_same_v<Type&, decltype(v)>, "" );
+            a.emplace<Type>(101);
             assert(false);
         } catch (int const&) {
         }
@@ -177,8 +151,7 @@
         std::any a(small{42});
         assert(small::count == 1);
         try {
-            auto &v = a.emplace<Type>({1, 2, 3}, 101);
-            static_assert( std::is_same_v<Type&, decltype(v)>, "" );
+            a.emplace<Type>({1, 2, 3}, 101);
             assert(false);
         } catch (int const&) {
         }
@@ -189,8 +162,7 @@
         std::any a(large{42});
         assert(large::count == 1);
         try {
-            auto &v = a.emplace<Type>(101);
-            static_assert( std::is_same_v<Type&, decltype(v)>, "" );
+            a.emplace<Type>(101);
             assert(false);
         } catch (int const&) {
         }
@@ -200,8 +172,7 @@
         std::any a(large{42});
         assert(large::count == 1);
         try {
-            auto &v = a.emplace<Type>({1, 2, 3}, 101);
-            static_assert( std::is_same_v<Type&, decltype(v)>, "" );
+            a.emplace<Type>({1, 2, 3}, 101);
             assert(false);
         } catch (int const&) {
         }
diff --git a/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
index 2e781d9..45bc70f 100644
--- a/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
+++ b/test/std/utilities/any/any.class/any.modifiers/reset.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any::reset() noexcept
diff --git a/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp b/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
index f56a256..6fc1009 100644
--- a/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
+++ b/test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // any::swap(any &) noexcept
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
index a5fa932..1a5a854 100644
--- a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_pointer.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class ValueType>
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
index ed04a91..af081ec 100644
--- a/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/any.cast/any_cast_reference.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class ValueType>
diff --git a/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp b/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
index bbc1350..99cc029 100644
--- a/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
+++ b/test/std/utilities/any/any.nonmembers/any.cast/reference_types.fail.cpp
@@ -25,30 +25,13 @@
 int main()
 {
     any a(1);
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int &>(&a); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int &&>(&a); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int const &>(&a); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int const&&>(&a); // expected-note {{requested here}}
-
+    any_cast<int &>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int &&>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int const &>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int const&&>(&a); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
     any const& a2 = a;
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int &>(&a2); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int &&>(&a2); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int const &>(&a2); // expected-note {{requested here}}
-
-    // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
-    any_cast<int const &&>(&a2); // expected-note {{requested here}}
+    any_cast<int &>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int &&>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int const &>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
+    any_cast<int const &&>(&a2); // expected-error@any:* 1 {{static_assert failed "_ValueType may not be a reference."}}
 }
diff --git a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
index 5a4a3c3..59c06be 100644
--- a/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/make_any.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // template <class T, class ...Args> any make_any(Args&&...);
diff --git a/test/std/utilities/any/any.nonmembers/swap.pass.cpp b/test/std/utilities/any/any.nonmembers/swap.pass.cpp
index c723b6e..1b3785b 100644
--- a/test/std/utilities/any/any.nonmembers/swap.pass.cpp
+++ b/test/std/utilities/any/any.nonmembers/swap.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <any>
 
 // void swap(any &, any &) noexcept
diff --git a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
index aa8eb39..2b19211 100644
--- a/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
+++ b/test/std/utilities/function.objects/func.not_fn/not_fn.pass.cpp
@@ -416,7 +416,7 @@
       ThrowsOnCopy() = default;
       bool operator()() const {
         assert(false);
-#if defined(TEST_COMPILER_C1XX)
+#if defined(_LIBCPP_MSVC)
         __assume(0);
 #else
         __builtin_unreachable();
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
index 7516b2e..9d5681a 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/copy_move.pass.cpp
@@ -11,8 +11,7 @@
 
 // class function<R(ArgTypes...)>
 
-// function(const function&  f);
-// function(const function&& f);
+// function(const function& f);
 
 #include <functional>
 #include <memory>
diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp
index 7a4678a..53476a2 100644
--- a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp
+++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.targ/target.pass.cpp
@@ -63,7 +63,6 @@
     assert(A::count == 1);
     assert(f.target<A>());
     assert(f.target<int(*)(int)>() == 0);
-    assert(f.target<int>() == nullptr);
     }
     assert(A::count == 0);
     {
@@ -71,7 +70,6 @@
     assert(A::count == 0);
     assert(f.target<int(*)(int)>());
     assert(f.target<A>() == 0);
-    assert(f.target<int>() == nullptr);
     }
     assert(A::count == 0);
     {
@@ -79,7 +77,6 @@
     assert(A::count == 1);
     assert(f.target<A>());
     assert(f.target<int(*)(int)>() == 0);
-    assert(f.target<int>() == nullptr);
     }
     assert(A::count == 0);
     {
@@ -87,7 +84,6 @@
     assert(A::count == 0);
     assert(f.target<int(*)(int)>());
     assert(f.target<A>() == 0);
-    assert(f.target<int>() == nullptr);
     }
     assert(A::count == 0);
 }
diff --git a/test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp b/test/std/utilities/function.objects/refwrap/binary.pass.cpp
similarity index 100%
rename from test/libcxx/utilities/function.objects/refwrap/binary.pass.cpp
rename to test/std/utilities/function.objects/refwrap/binary.pass.cpp
diff --git a/test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp b/test/std/utilities/function.objects/refwrap/unary.pass.cpp
similarity index 100%
rename from test/libcxx/utilities/function.objects/refwrap/unary.pass.cpp
rename to test/std/utilities/function.objects/refwrap/unary.pass.cpp
diff --git a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
index a7ddd9a..09ea034 100644
--- a/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/enum.pass.cpp
@@ -36,7 +36,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     typedef typename std::underlying_type<T>::type under_type;
 
     H h1;
diff --git a/test/std/utilities/function.objects/unord.hash/floating.pass.cpp b/test/std/utilities/function.objects/unord.hash/floating.pass.cpp
index e67aa01..643e2d8 100644
--- a/test/std/utilities/function.objects/unord.hash/floating.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/floating.pass.cpp
@@ -24,8 +24,6 @@
 #include <limits>
 #include <cmath>
 
-#include "test_macros.h"
-
 template <class T>
 void
 test()
@@ -33,7 +31,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     H h;
 
     std::size_t t0 = h(0.);
diff --git a/test/std/utilities/function.objects/unord.hash/integral.pass.cpp b/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
index ce87f59..08a2a8c 100644
--- a/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/integral.pass.cpp
@@ -31,7 +31,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     H h;
 
     for (int i = 0; i <= 5; ++i)
@@ -65,42 +64,42 @@
     test<long long>();
     test<unsigned long long>();
 
-//  LWG #2119
+//	LWG #2119
     test<std::ptrdiff_t>();
     test<size_t>();
 
-    test<int8_t>();
-    test<int16_t>();
-    test<int32_t>();
-    test<int64_t>();
+	test<int8_t>();
+	test<int16_t>();
+	test<int32_t>();
+	test<int64_t>();
 
-    test<int_fast8_t>();
-    test<int_fast16_t>();
-    test<int_fast32_t>();
-    test<int_fast64_t>();
+	test<int_fast8_t>();
+	test<int_fast16_t>();
+	test<int_fast32_t>();
+	test<int_fast64_t>();
 
-    test<int_least8_t>();
-    test<int_least16_t>();
-    test<int_least32_t>();
-    test<int_least64_t>();
+	test<int_least8_t>();
+	test<int_least16_t>();
+	test<int_least32_t>();
+	test<int_least64_t>();
 
     test<intmax_t>();
     test<intptr_t>();
 
-    test<uint8_t>();
-    test<uint16_t>();
-    test<uint32_t>();
-    test<uint64_t>();
+	test<uint8_t>();
+	test<uint16_t>();
+	test<uint32_t>();
+	test<uint64_t>();
 
-    test<uint_fast8_t>();
-    test<uint_fast16_t>();
-    test<uint_fast32_t>();
-    test<uint_fast64_t>();
+	test<uint_fast8_t>();
+	test<uint_fast16_t>();
+	test<uint_fast32_t>();
+	test<uint_fast64_t>();
 
-    test<uint_least8_t>();
-    test<uint_least16_t>();
-    test<uint_least32_t>();
-    test<uint_least64_t>();
+	test<uint_least8_t>();
+	test<uint_least16_t>();
+	test<uint_least32_t>();
+	test<uint_least64_t>();
 
     test<uintmax_t>();
     test<uintptr_t>();
diff --git a/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp b/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
index 36280a3..a483944 100644
--- a/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
+++ b/test/std/utilities/function.objects/unord.hash/pointer.pass.cpp
@@ -23,8 +23,6 @@
 #include <type_traits>
 #include <limits>
 
-#include "test_macros.h"
-
 template <class T>
 void
 test()
@@ -32,7 +30,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
     H h;
 
     typedef typename std::remove_pointer<T>::type type;
@@ -41,20 +38,7 @@
     assert(h(&i) != h(&j));
 }
 
-// can't hash nullptr_t until c++17
-void test_nullptr()
-{
-#if TEST_STD_VER > 14
-    typedef std::nullptr_t T;
-    typedef std::hash<T> H;
-    static_assert((std::is_same<typename H::argument_type, T>::value), "" );
-    static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
-#endif
-}
-
 int main()
 {
     test<int*>();
-    test_nullptr();
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/nothing_to_do.pass.cpp b/test/std/utilities/memory/unique.ptr/nothing_to_do.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/nothing_to_do.pass.cpp
rename to test/std/utilities/memory/unique.ptr/nothing_to_do.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array1.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array1.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array1.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array1.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array2.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array2.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array2.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array2.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array3.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array3.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array3.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array3.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array4.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array4.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.array4.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.array4.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.single.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.create/make_unique.single.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.create/make_unique.single.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/nothing_to_do.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/convert_ctor.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/default.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/incomplete.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt/void.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/convert_ctor.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/default.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.dflt1/incomplete.fail.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.dltr/unique.ptr.dltr.general/nothing_to_do.pass.cpp
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp
new file mode 100644
index 0000000..ed94c1a
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.fail.cpp
@@ -0,0 +1,28 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+int main()
+{
+    std::unique_ptr<int> s, s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+    s2 = s; // expected-error {{'operator=' is a private member of 'std::__1::unique_ptr}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp
new file mode 100644
index 0000000..a29c527
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move01.pass.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+// test move assignment.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> s1(new A[3]);
+    A* p = s1.get();
+    assert(A::count == 3);
+    std::unique_ptr<A[]> s2(new A[2]);
+    assert(A::count == 5);
+    s2 = std::move(s1);
+    assert(A::count == 3);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    }
+    assert(A::count == 0);
+    {
+    std::unique_ptr<A[], Deleter<A[]> > s1(new A[4], Deleter<A[]>(5));
+    A* p = s1.get();
+    assert(A::count == 4);
+    std::unique_ptr<A[], Deleter<A[]> > s2(new A[5]);
+    assert(A::count == 9);
+    s2 = std::move(s1);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    assert(A::count == 4);
+    assert(s2.get_deleter().state() == 5);
+    assert(s1.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    {
+    CDeleter<A[]> d1(5);
+    std::unique_ptr<A[], CDeleter<A[]>&> s1(new A[6], d1);
+    A* p = s1.get();
+    assert(A::count == 6);
+    CDeleter<A[]> d2(6);
+    std::unique_ptr<A[], CDeleter<A[]>&> s2(new A[3], d2);
+    assert(A::count == 9);
+    s2 = std::move(s1);
+    assert(A::count == 6);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    assert(d1.state() == 5);
+    assert(d2.state() == 5);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp
new file mode 100644
index 0000000..6e13873
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move02.fail.cpp
@@ -0,0 +1,39 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// Can't copy from const lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<A[]> s(new A[3]);
+    std::unique_ptr<A[]> s2;
+    s2 = s;
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp
new file mode 100644
index 0000000..3712a27
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move03.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// Can't copy from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete p;}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<A, Deleter> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter> s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp
new file mode 100644
index 0000000..4e85e5b
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move04.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test move ctor.  Can't copy from const lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete p;}
+};
+
+int main()
+{
+    {
+    const std::unique_ptr<A, Deleter> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter> s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp
new file mode 100644
index 0000000..9461958
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert01.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// Can't assign from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp
new file mode 100644
index 0000000..78caaa4
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert02.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    boost::unique_ptr<B[], Deleter<B> > s(new B);
+    A* p = s.get();
+    boost::unique_ptr<A[], Deleter<A> > s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp
new file mode 100644
index 0000000..b9693b8
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert03.fail.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    Deleter<B> db(5);
+    boost::unique_ptr<B[], Deleter<B>&> s(new B, db);
+    A* p = s.get();
+    Deleter<A> da(6);
+    boost::unique_ptr<A[], Deleter<A>&> s2(new A, da);
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp
new file mode 100644
index 0000000..970beb5
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert04.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// Can't assign from const lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const boost::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    boost::unique_ptr<A[]> s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp
new file mode 100644
index 0000000..8976731
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert05.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from const lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const boost::unique_ptr<B[], Deleter<B> > s(new B);
+    A* p = s.get();
+    boost::unique_ptr<A[], Deleter<A> > s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp
new file mode 100644
index 0000000..1081cd1
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert06.fail.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from const lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    Deleter<B> db(5);
+    const boost::unique_ptr<B[], Deleter<B>&> s(new B, db);
+    A* p = s.get();
+    Deleter<A> da(6);
+    boost::unique_ptr<A[], Deleter<A>&> s2(new A, da);
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp
new file mode 100644
index 0000000..65ee269
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert07.fail.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    boost::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    boost::unique_ptr<A[]> s2(new A);
+    assert(A::count == 2);
+    s2 = boost::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp
new file mode 100644
index 0000000..310be99
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert08.fail.cpp
@@ -0,0 +1,60 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    boost::unique_ptr<B[], Deleter<B> > s(new B);
+    A* p = s.get();
+    boost::unique_ptr<A[], Deleter<A> > s2(new A);
+    assert(A::count == 2);
+    s2 = (boost::move(s));
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp
new file mode 100644
index 0000000..eb48e9c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/move_convert09.fail.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// test converting move assignment with reference deleters
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    Deleter<B> db(5);
+    boost::unique_ptr<B[], Deleter<B>&> s(new B, db);
+    A* p = s.get();
+    Deleter<A> da(6);
+    boost::unique_ptr<A[], Deleter<A>&> s2(new A, da);
+    s2 = boost::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp
new file mode 100644
index 0000000..e2d7956
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_asgn.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <cassert>
+
+// test assignment from null
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A> s2(new A);
+    assert(A::count == 1);
+    s2 = 0;
+    assert(A::count == 0);
+    assert(s2.get() == 0);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp
new file mode 100644
index 0000000..5038997
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/null_ctor.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// The deleter is not called if get() == 0
+
+#include <memory>
+#include <cassert>
+
+#include "test_macros.h"
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(0) {}
+
+    int state() const {return state_;}
+
+    void operator()(void*) {++state_;}
+};
+
+int main()
+{
+    Deleter d;
+    assert(d.state() == 0);
+    {
+    std::unique_ptr<int[], Deleter&> p(nullptr, d);
+    assert(p.get() == 0);
+    assert(&p.get_deleter() == &d);
+    }
+#if defined(_LIBCPP_VERSION)
+    {
+    // The standard only requires the constructor accept nullptr, but libc++
+    // also supports the literal 0.
+    std::unique_ptr<int[], Deleter&> p(0, d);
+    assert(p.get() == 0);
+    assert(&p.get_deleter() == &d);
+    }
+#endif
+    assert(d.state() == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp
new file mode 100644
index 0000000..30ecdde
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/nullptr_asgn.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <cassert>
+
+// test assignment from null
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> s2(new A[3]);
+    assert(A::count == 3);
+    s2 = nullptr;
+    assert(A::count == 0);
+    assert(s2.get() == 0);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp
new file mode 100644
index 0000000..e7ad6ad
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/pointer_type.pass.cpp
@@ -0,0 +1,34 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr<T[]>::pointer type
+
+#include <memory>
+#include <type_traits>
+
+struct Deleter
+{
+    struct pointer {};
+};
+
+int main()
+{
+    {
+    typedef std::unique_ptr<int[]> P;
+    static_assert((std::is_same<P::pointer, int*>::value), "");
+    }
+    {
+    typedef std::unique_ptr<int[], Deleter> P;
+    static_assert((std::is_same<P::pointer, Deleter::pointer>::value), "");
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
new file mode 100644
index 0000000..b6bcad9
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.fail.cpp
@@ -0,0 +1,38 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr default ctor
+
+// default unique_ptr ctor should require default Deleter ctor
+
+
+#include <memory>
+
+class Deleter
+{
+    // expected-error@memory:* {{base class 'Deleter' has private default constructor}}
+    // expected-note@memory:* + {{in instantiation of member function}}
+    Deleter() {} // expected-note {{implicitly declared private here}}
+
+public:
+
+    Deleter(Deleter&) {}
+    Deleter& operator=(Deleter&) { return *this; }
+
+    void operator()(void*) const {}
+};
+
+int main()
+{
+    std::unique_ptr<int[], Deleter> p;
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp
new file mode 100644
index 0000000..0cc5438
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default01.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr default ctor
+
+// default unique_ptr ctor should only require default Deleter ctor
+
+#include <memory>
+#include <cassert>
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(void*) {}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<int[]> p;
+    assert(p.get() == 0);
+    }
+    {
+    std::unique_ptr<int[], Deleter> p;
+    assert(p.get() == 0);
+    assert(p.get_deleter().state() == 5);
+    }
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp
similarity index 65%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp
index f838661..82b8494 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.fail.cpp
@@ -11,15 +11,20 @@
 
 // unique_ptr
 
-// test reset against resetting self
+// Test unique_ptr default ctor
+
+// default unique_ptr ctor should require non-reference Deleter ctor
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
+class Deleter
+{
+public:
 
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
+    void operator()(void*) {}
 };
 
-int main() { (new A)->reset(); }
+int main()
+{
+    std::unique_ptr<int[], Deleter&> p;
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp
new file mode 100644
index 0000000..3ded41c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default02.pass.cpp
@@ -0,0 +1,87 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test default unique_ptr<T[]> ctor
+
+// default unique_ptr<T[]> ctor shouldn't require complete type
+
+#include <memory>
+#include <cassert>
+
+struct A;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p);
+};
+
+void check(int i);
+
+template <class D = std::default_delete<A> >
+struct B
+{
+    std::unique_ptr<A[], D> a_;
+    B();
+    ~B();
+
+    A* get() const {return a_.get();}
+    D& get_deleter() {return a_.get_deleter();}
+};
+
+int main()
+{
+    {
+    B<> s;
+    assert(s.get() == 0);
+    }
+    check(0);
+    {
+    B<Deleter> s;
+    assert(s.get() == 0);
+    assert(s.get_deleter().state() == 5);
+    }
+    check(0);
+}
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+void Deleter::operator()(A* p) {delete p;}
+
+void check(int i)
+{
+    assert(A::count == i);
+}
+
+template <class D>
+B<D>::B() {}
+
+template <class D>
+B<D>::~B() {}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp
similarity index 72%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp
index 8bed9dd..74d24fd 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/default03.fail.cpp
@@ -11,18 +11,13 @@
 
 // unique_ptr
 
-// test op->()
+// Test unique_ptr default ctor
+
+// default unique_ptr ctor should require non-pointer Deleter
 
 #include <memory>
-#include <cassert>
 
-struct A {
-  int i_;
-
-  A() : i_(7) {}
-};
-
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<int[], void (*)(void*)> p;
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp
new file mode 100644
index 0000000..bc49a0e
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <cassert>
+
+// test move ctor.  Can't copy from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> s(new A[3]);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp
new file mode 100644
index 0000000..8a1f2ce
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move01.pass.cpp
@@ -0,0 +1,70 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+// test move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> s(new A[3]);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 3);
+    }
+    assert(A::count == 0);
+    {
+    std::unique_ptr<A[], Deleter<A[]> > s(new A[3], Deleter<A[]>(5));
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 3);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    {
+    NCDeleter<A[]> d;
+    std::unique_ptr<A[], NCDeleter<A[]>&> s(new A[3], d);
+    A* p = s.get();
+    std::unique_ptr<A[], NCDeleter<A[]>&> s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 3);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp
new file mode 100644
index 0000000..8e44c78
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+// test move ctor.  Can't copy from const lvalue
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<A[]> s(new A[3]);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp
new file mode 100644
index 0000000..f758b08
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move02.pass.cpp
@@ -0,0 +1,72 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+// test move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+
+std::unique_ptr<A[]>
+source1()
+{
+    return std::unique_ptr<A[]>(new A[3]);
+}
+
+void sink1(std::unique_ptr<A[]>)
+{
+}
+
+std::unique_ptr<A[], Deleter<A[]> >
+source2()
+{
+    return std::unique_ptr<A[], Deleter<A[]> >(new A[3]);
+}
+
+void sink2(std::unique_ptr<A[], Deleter<A[]> >)
+{
+}
+
+std::unique_ptr<A[], NCDeleter<A[]>&>
+source3()
+{
+    static NCDeleter<A[]> d;
+    return std::unique_ptr<A[], NCDeleter<A[]>&>(new A[3], d);
+}
+
+void sink3(std::unique_ptr<A[], NCDeleter<A[]>&>)
+{
+}
+
+int main()
+{
+    sink1(source1());
+    sink2(source2());
+    sink3(source3());
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp
new file mode 100644
index 0000000..c952cf2
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move03.fail.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+// test move ctor.  Can't copy from lvalue
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<A[], Deleter> s(new A[3]);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp
new file mode 100644
index 0000000..0d091ff
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move04.fail.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+// test move ctor.  Can't copy from const lvalue
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    const std::unique_ptr<A[], Deleter> s(new A[3]);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp
new file mode 100644
index 0000000..d175fbf
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert01.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp
new file mode 100644
index 0000000..1d3dd85
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert02.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp
new file mode 100644
index 0000000..36ad75d
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert03.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp
new file mode 100644
index 0000000..3a19bde
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert04.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// implicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp
new file mode 100644
index 0000000..2253766
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert05.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Implicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp
new file mode 100644
index 0000000..fba8951
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert06.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp
new file mode 100644
index 0000000..24c6469
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert07.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp
new file mode 100644
index 0000000..2c8f281
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert08.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp
new file mode 100644
index 0000000..e4cbef5
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert09.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    const std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp
new file mode 100644
index 0000000..73423d1
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert10.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// implicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp
new file mode 100644
index 0000000..a7d853d
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert11.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Implicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp
new file mode 100644
index 0000000..fdb0882
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert12.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    const std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp
new file mode 100644
index 0000000..d9ef8e9
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert13.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2(std::move(s));
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp
new file mode 100644
index 0000000..431c8bf
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert14.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2(std::move(s));
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp
new file mode 100644
index 0000000..9325d07
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert15.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2(std::move(s));
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp
new file mode 100644
index 0000000..b090e59
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert16.fail.cpp
@@ -0,0 +1,57 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// implicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[]> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[]> s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp
new file mode 100644
index 0000000..6e214f1
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert17.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Implicit version
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B[], Deleter<B[]> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A[], Deleter<A[]> > s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp
new file mode 100644
index 0000000..d1c0e8a
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/move_convert18.fail.cpp
@@ -0,0 +1,78 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B[], CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A[], CDeleter<A>&> s2 = std::move(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp
new file mode 100644
index 0000000..9a8c175
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/nullptr.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// unique_ptr(nullptr_t);
+
+#include <memory>
+#include <cassert>
+
+// default unique_ptr ctor should only require default Deleter ctor
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(void*) {}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<int[]> p(nullptr);
+    assert(p.get() == 0);
+    }
+    {
+    std::unique_ptr<int[], Deleter> p(nullptr);
+    assert(p.get() == 0);
+    assert(p.get_deleter().state() == 5);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp
new file mode 100644
index 0000000..4c31611
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.fail.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr<T[]>(pointer) ctor
+
+// unique_ptr<T[]>(pointer) ctor should require default Deleter ctor
+
+#include <memory>
+
+class Deleter
+{
+
+    Deleter() {}
+
+public:
+
+    Deleter(Deleter&) {}
+    Deleter& operator=(Deleter&) {}
+
+    void operator()(void*) const {}
+};
+
+int main()
+{
+    std::unique_ptr<int[], Deleter> p(new int);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp
new file mode 100644
index 0000000..dab42f2
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer01.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer) ctor
+
+// unique_ptr<T[]>(pointer) ctor should only require default Deleter ctor
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    std::unique_ptr<A[]> s(p);
+    assert(s.get() == p);
+    }
+    assert(A::count == 0);
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    std::unique_ptr<A[], Deleter> s(p);
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp
similarity index 63%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp
index f838661..af7f27f 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.fail.cpp
@@ -11,15 +11,19 @@
 
 // unique_ptr
 
-// test reset against resetting self
+// Test unique_ptr<T[]>(pointer) ctor
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
+// unique_ptr<T[]>(pointer) ctor should require non-reference Deleter ctor
+class Deleter
+{
+public:
 
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
+    void operator()(void*) {}
 };
 
-int main() { (new A)->reset(); }
+int main()
+{
+    std::unique_ptr<int[], Deleter&> p(new int);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp
new file mode 100644
index 0000000..1afb1c3
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer02.pass.cpp
@@ -0,0 +1,95 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr<T[]>(pointer) ctor
+
+// unique_ptr<T[]>(pointer) ctor shouldn't require complete type
+
+#include <memory>
+#include <cassert>
+
+struct A;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p);
+};
+
+void check(int i);
+
+template <class D = std::default_delete<A[]> >
+struct B
+{
+    std::unique_ptr<A[], D> a_;
+    explicit B(A*);
+    ~B();
+
+    A* get() const {return a_.get();}
+    D& get_deleter() {return a_.get_deleter();}
+};
+
+A* get();
+
+int main()
+{
+    {
+    A* p = get();
+    check(3);
+    B<> s(p);
+    assert(s.get() == p);
+    }
+    check(0);
+    {
+    A* p = get();
+    check(3);
+    B<Deleter> s(p);
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 5);
+    }
+    check(0);
+}
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+A* get() {return new A[3];}
+
+void Deleter::operator()(A* p) {delete [] p;}
+
+void check(int i)
+{
+    assert(A::count == i);
+}
+
+template <class D>
+B<D>::B(A* a) : a_(a) {}
+
+template <class D>
+B<D>::~B() {}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp
similarity index 69%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp
index f838661..31f7ce3 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer03.fail.cpp
@@ -11,15 +11,13 @@
 
 // unique_ptr
 
-// test reset against resetting self
+// Test unique_ptr<T[]>(pointer) ctor
+
+// unique_ptr<T[]>(pointer) ctor should require non-pointer Deleter
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
-
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
-};
-
-int main() { (new A)->reset(); }
+int main()
+{
+    std::unique_ptr<int[], void (*)(void*)> p(new int);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp
new file mode 100644
index 0000000..591144f
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer04.fail.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer) ctor
+
+// unique_ptr(pointer) ctor should not work with derived pointers
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    B* p = new B[3];
+    std::unique_ptr<A[]> s(p);
+    }
+    {
+    B* p = new B[3];
+    std::unique_ptr<A[], Deleter> s(p);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
new file mode 100644
index 0000000..480dc08
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter01.pass.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr(pointer, deleter()) only requires MoveConstructible deleter
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    std::unique_ptr<A[], Deleter<A[]> > s(p, Deleter<A[]>());
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+
+    { // LWG#2520 says that nullptr is a valid input as well as null
+#ifdef _LIBCPP_VERSION
+    std::unique_ptr<A[], Deleter<A[]> > s1(NULL, Deleter<A[]>());
+#endif
+    std::unique_ptr<A[], Deleter<A[]> > s2(nullptr, Deleter<A[]>());
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp
new file mode 100644
index 0000000..a92fdbc
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter02.pass.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr(pointer, d) requires CopyConstructible deleter
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    Deleter d;
+    std::unique_ptr<A[], Deleter> s(p, d);
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 5);
+    d.set_state(6);
+    assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    {
+    Deleter d;
+    std::unique_ptr<A[], Deleter> s(nullptr, d);
+    assert(s.get() == nullptr);
+    assert(s.get_deleter().state() == 5);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp
new file mode 100644
index 0000000..dd27401
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter03.pass.cpp
@@ -0,0 +1,65 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr<T[], D&>(pointer, d) does not requires CopyConstructible deleter
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(const Deleter&);
+    Deleter& operator=(const Deleter&);
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    Deleter d;
+    std::unique_ptr<A[], Deleter&> s(p, d);
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 5);
+    d.set_state(6);
+    assert(s.get_deleter().state() == 6);
+    }
+    assert(A::count == 0);
+    {
+    Deleter d;
+    std::unique_ptr<A[], Deleter&> s(nullptr, d);
+    assert(s.get() == nullptr);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp
new file mode 100644
index 0000000..9d3f940
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.fail.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// XFAIL: c++98, c++03
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr<T, const D&>(pointer, D()) should not compile
+
+#include <memory>
+
+class Deleter
+{
+public:
+    Deleter() {}
+    void operator()(int* p) const {delete [] p;}
+};
+
+int main()
+{
+    int* p = nullptr;
+    std::unique_ptr<int[], const Deleter&> s(p, Deleter()); // expected-error@memory:* {{static_assert failed "rvalue deleter bound to reference"}}
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp
new file mode 100644
index 0000000..02f44d3
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter04.pass.cpp
@@ -0,0 +1,63 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr<T[], const D&>(pointer, d) does not requires CopyConstructible deleter
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+    Deleter(const Deleter&);
+    Deleter& operator=(const Deleter&);
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(A* p) const {delete [] p;}
+};
+
+int main()
+{
+    {
+    A* p = new A[3];
+    assert(A::count == 3);
+    Deleter d;
+    std::unique_ptr<A[], const Deleter&> s(p, d);
+    assert(s.get() == p);
+    assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    {
+    Deleter d;
+    std::unique_ptr<A[], const Deleter&> s(nullptr, d);
+    assert(s.get() == nullptr);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp
new file mode 100644
index 0000000..0e03a7d
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.ctor/pointer_deleter05.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer, deleter) ctor
+
+// unique_ptr(pointer, deleter) should not work with derived pointers
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete [] p;}
+};
+
+int main()
+{
+    B* p = new B[3];
+    std::unique_ptr<A[], Deleter> s(p, Deleter());
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp
similarity index 69%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp
index 8bed9dd..d79a4e3 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/release.pass.cpp
@@ -11,18 +11,17 @@
 
 // unique_ptr
 
-// test op->()
+// test release
 
 #include <memory>
 #include <cassert>
 
-struct A {
-  int i_;
-
-  A() : i_(7) {}
-};
-
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<int[]> p(new int[3]);
+    int* i = p.get();
+    int* j = p.release();
+    assert(p.get() == 0);
+    assert(i == j);
+    delete [] j;
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
new file mode 100644
index 0000000..195d877
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset1.pass.cpp
@@ -0,0 +1,50 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test reset
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> p(new A[3]);
+    assert(A::count == 3);
+    A* i = p.get();
+    assert(i != nullptr);
+    p.reset();
+    assert(A::count == 0);
+    assert(p.get() == 0);
+    }
+    assert(A::count == 0);
+    {
+    std::unique_ptr<A[]> p(new A[4]);
+    assert(A::count == 4);
+    A* i = p.get();
+    assert(i != nullptr);
+    p.reset(new A[5]);
+    assert(A::count == 5);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp
new file mode 100644
index 0000000..bca6cb2
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/reset2.fail.cpp
@@ -0,0 +1,64 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test reset
+
+#include <memory>
+#include <cassert>
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A[]> p(new A);
+    assert(A::count == 1);
+    assert(B::count == 0);
+    A* i = p.get();
+    p.reset(new B);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+    std::unique_ptr<A[]> p(new B);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    A* i = p.get();
+    p.reset(new B);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp
new file mode 100644
index 0000000..5e98475
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.modifiers/swap.pass.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test swap
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    int state_;
+    static int count;
+    A() : state_(0) {++count;}
+    explicit A(int i) : state_(i) {++count;}
+    A(const A& a) : state_(a.state_) {++count;}
+    A& operator=(const A& a) {state_ = a.state_; return *this;}
+    ~A() {--count;}
+
+    friend bool operator==(const A& x, const A& y)
+        {return x.state_ == y.state_;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    A* p1 = new A[3];
+    std::unique_ptr<A[], Deleter<A[]> > s1(p1, Deleter<A[]>(1));
+    A* p2 = new A[3];
+    std::unique_ptr<A[], Deleter<A[]> > s2(p2, Deleter<A[]>(2));
+    assert(s1.get() == p1);
+    assert(s1.get_deleter().state() == 1);
+    assert(s2.get() == p2);
+    assert(s2.get_deleter().state() == 2);
+    s1.swap(s2);
+    assert(s1.get() == p2);
+    assert(s1.get_deleter().state() == 2);
+    assert(s2.get() == p1);
+    assert(s2.get_deleter().state() == 1);
+    assert(A::count == 6);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp
similarity index 84%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp
index b2d3da4..46ba139 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/dereference.fail.cpp
@@ -16,7 +16,8 @@
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    std::unique_ptr<int[]> p(new int(3));
+    assert(*p == 3);
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp
similarity index 60%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp
index b2d3da4..9ec9b95 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/explicit_bool.pass.cpp
@@ -16,7 +16,24 @@
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    {
+    std::unique_ptr<int[]> p(new int [3]);
+    if (p)
+        ;
+    else
+        assert(false);
+    if (!p)
+        assert(false);
+    }
+    {
+    std::unique_ptr<int[]> p;
+    if (!p)
+        ;
+    else
+        assert(false);
+    if (p)
+        assert(false);
+    }
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp
similarity index 79%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp
index b2d3da4..2ae0659 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get.pass.cpp
@@ -11,12 +11,14 @@
 
 // unique_ptr
 
-// test op*()
+// test get
 
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    int* p = new int[3];
+    std::unique_ptr<int[]> s(p);
+    assert(s.get() == p);
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp
new file mode 100644
index 0000000..4496740
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/get_deleter.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test get_deleter()
+
+#include <memory>
+#include <cassert>
+
+struct Deleter
+{
+    void operator()(void*) {}
+
+    int test() {return 5;}
+    int test() const {return 6;}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<int[], Deleter> p;
+    assert(p.get_deleter().test() == 5);
+    }
+    {
+    const std::unique_ptr<int[], Deleter> p;
+    assert(p.get_deleter().test() == 6);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp
new file mode 100644
index 0000000..519eae6
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/index.pass.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test op[](size_t)
+
+#include <memory>
+#include <cassert>
+
+class A
+{
+    int state_;
+    static int next_;
+public:
+    A() : state_(++next_) {}
+    int get() const {return state_;}
+
+    friend bool operator==(const A& x, int y)
+        {return x.state_ == y;}
+
+    A& operator=(int i) {state_ = i; return *this;}
+};
+
+int A::next_ = 0;
+
+int main()
+{
+    std::unique_ptr<A[]> p(new A[3]);
+    assert(p[0] == 1);
+    assert(p[1] == 2);
+    assert(p[2] == 3);
+    p[0] = 3;
+    p[1] = 2;
+    p[2] = 1;
+    assert(p[0] == 3);
+    assert(p[1] == 2);
+    assert(p[2] == 1);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp
similarity index 79%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp
index 8bed9dd..1c90ba7 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.runtime/unique.ptr.runtime.observers/op_arrow.fail.cpp
@@ -16,13 +16,15 @@
 #include <memory>
 #include <cassert>
 
-struct A {
-  int i_;
+struct A
+{
+    int i_;
 
-  A() : i_(7) {}
+    A() : i_(7) {}
 };
 
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<A[]> p(new A);
+    assert(p->i_ == 7);
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp
new file mode 100644
index 0000000..380f2e1
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/pointer_type.pass.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr::pointer type
+
+#include <memory>
+#include <type_traits>
+
+#include "test_macros.h"
+
+struct Deleter
+{
+    struct pointer {};
+};
+
+struct D2 {
+private:
+    typedef void pointer;
+};
+
+struct D3 {
+    static long pointer;
+};
+
+int main()
+{
+    {
+    typedef std::unique_ptr<int> P;
+    static_assert((std::is_same<P::pointer, int*>::value), "");
+    }
+    {
+    typedef std::unique_ptr<int, Deleter> P;
+    static_assert((std::is_same<P::pointer, Deleter::pointer>::value), "");
+    }
+#if TEST_STD_VER >= 11
+    {
+    typedef std::unique_ptr<int, D2> P;
+    static_assert(std::is_same<P::pointer, int*>::value, "");
+    }
+    {
+    typedef std::unique_ptr<int, D3> P;
+    static_assert(std::is_same<P::pointer, int*>::value, "");
+    }
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp
new file mode 100644
index 0000000..87cfb72
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.fail.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+// Can't copy from lvalue
+int main()
+{
+    std::unique_ptr<int> s, s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+    s2 = s; // expected-error {{'operator=' is a private member}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp
new file mode 100644
index 0000000..67f4da2
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move01.pass.cpp
@@ -0,0 +1,75 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+// test move assignment.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A> s1(new A);
+    A* p = s1.get();
+    std::unique_ptr<A> s2(new A);
+    assert(A::count == 2);
+    s2 = std::move(s1);
+    assert(A::count == 1);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    }
+    assert(A::count == 0);
+    {
+    std::unique_ptr<A, Deleter<A> > s1(new A, Deleter<A>(5));
+    A* p = s1.get();
+    std::unique_ptr<A, Deleter<A> > s2(new A);
+    assert(A::count == 2);
+    s2 = std::move(s1);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    assert(A::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s1.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    {
+    CDeleter<A> d1(5);
+    std::unique_ptr<A, CDeleter<A>&> s1(new A, d1);
+    A* p = s1.get();
+    CDeleter<A> d2(6);
+    std::unique_ptr<A, CDeleter<A>&> s2(new A, d2);
+    s2 = std::move(s1);
+    assert(s2.get() == p);
+    assert(s1.get() == 0);
+    assert(A::count == 1);
+    assert(d1.state() == 5);
+    assert(d2.state() == 5);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp
new file mode 100644
index 0000000..9cea12b
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move02.fail.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+// Can't copy from const lvalue
+
+int main()
+{
+    const std::unique_ptr<int> s(new int);
+    std::unique_ptr<int> s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+    // NOTE: The error says "constructor" because the assignment operator takes
+    // 's' by value and attempts to copy construct it.
+    s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp
new file mode 100644
index 0000000..05a057f
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move03.fail.cpp
@@ -0,0 +1,33 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+struct Deleter {
+    void operator()(int* p) {delete p;}
+};
+
+// Can't copy from lvalue
+int main()
+{
+    std::unique_ptr<int, Deleter> s, s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+    s2 = s; // expected-error {{'operator=' is a private member}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp
new file mode 100644
index 0000000..24703ec
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move04.fail.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+struct Deleter {
+    void operator()(int* p) {delete p;}
+};
+
+// Can't copy from a const lvalue
+int main()
+{
+    const std::unique_ptr<int, Deleter> s(new int);
+    std::unique_ptr<int, Deleter> s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{cannot be assigned because its copy assignment operator is implicitly deleted}}
+#else
+    // NOTE: The error says "constructor" because the assignment operator takes
+    // 's' by value and attempts to copy construct it.
+    s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp
new file mode 100644
index 0000000..7876760
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert.pass.cpp
@@ -0,0 +1,89 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+template <class APtr, class BPtr>
+void testAssign(APtr& aptr, BPtr& bptr) {
+    A* p = bptr.get();
+    assert(A::count == 2);
+    aptr = std::move(bptr);
+    assert(aptr.get() == p);
+    assert(bptr.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+}
+
+template <class LHS, class RHS>
+void checkDeleter(LHS& lhs, RHS& rhs, int LHSState, int RHSState) {
+    assert(lhs.get_deleter().state() == LHSState);
+    assert(rhs.get_deleter().state() == RHSState);
+}
+
+int main()
+{
+    {
+        std::unique_ptr<B> bptr(new B);
+        std::unique_ptr<A> aptr(new A);
+        testAssign(aptr, bptr);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+        Deleter<B> del(42);
+        std::unique_ptr<B, Deleter<B> > bptr(new B, std::move(del));
+        std::unique_ptr<A, Deleter<A> > aptr(new A);
+        testAssign(aptr, bptr);
+        checkDeleter(aptr, bptr, 42, 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+        CDeleter<A> adel(6);
+        CDeleter<B> bdel(42);
+        std::unique_ptr<B, CDeleter<B>&> bptr(new B, bdel);
+        std::unique_ptr<A, CDeleter<A>&> aptr(new A, adel);
+        testAssign(aptr, bptr);
+        checkDeleter(aptr, bptr, 42, 42);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp
new file mode 100644
index 0000000..816a598
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert01.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+
+struct A
+{
+    A() {}
+    virtual ~A() {}
+};
+
+struct B : public A
+{
+};
+
+// Can't assign from lvalue
+int main()
+{
+    std::unique_ptr<B> s;
+    std::unique_ptr<A> s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+    // NOTE: The move-semantic emulation creates an ambiguous overload set
+    // so that assignment from an lvalue does not compile
+    s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp
new file mode 100644
index 0000000..6e69d51
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert02.fail.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+#include "deleter_types.h"
+
+struct A
+{
+    A() {}
+    virtual ~A() {}
+};
+
+struct B : public A
+{
+};
+
+// Can't assign from lvalue
+int main()
+{
+    std::unique_ptr<B, Deleter<B> > s;
+    std::unique_ptr<A, Deleter<A> > s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+    // NOTE: The move-semantic emulation creates an ambiguous overload set
+    // so that assignment from an lvalue does not compile
+    s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp
new file mode 100644
index 0000000..1d89f99
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert03.fail.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from lvalue
+
+#include <memory>
+
+#include "test_macros.h"
+#include "deleter_types.h"
+
+struct A
+{
+    A() {}
+    virtual ~A() {}
+};
+
+struct B : public A
+{
+};
+
+// Can't assign from lvalue
+int main()
+{
+    Deleter<B> db;
+    std::unique_ptr<B, Deleter<B>& > s(new B, db);
+    Deleter<A> da;
+    std::unique_ptr<A, Deleter<A> &> s2(new A, da);
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+    // NOTE: The move-semantic emulation creates an ambiguous overload set
+    // so that assignment from an lvalue does not compile
+    s2 = s; // expected-error {{use of overloaded operator '=' is ambiguous}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp
new file mode 100644
index 0000000..f7de69c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert04.fail.cpp
@@ -0,0 +1,43 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+#include <memory>
+
+#include "test_macros.h"
+#include "deleter_types.h"
+
+struct A
+{
+    A() {}
+    virtual ~A() {}
+};
+
+struct B : public A
+{
+};
+
+// Can't assign from lvalue
+int main()
+{
+    const std::unique_ptr<B> s(new B);
+    std::unique_ptr<A> s2;
+#if TEST_STD_VER >= 11
+    s2 = s; // expected-error {{no viable overloaded '='}}
+#else
+    // NOTE: The error says "constructor" because the assignment operator takes
+    // 's' by value and attempts to copy construct it.
+    s2 = s; // expected-error {{no matching constructor for initialization}}
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp
new file mode 100644
index 0000000..55ebe51
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert05.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from const lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B, Deleter<B> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter<A> > s2;
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp
new file mode 100644
index 0000000..657b011
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert06.fail.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Can't assign from const lvalue
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    Deleter<B> db(5);
+    const std::unique_ptr<B, Deleter<B>&> s(new B, db);
+    A* p = s.get();
+    Deleter<A> da(6);
+    std::unique_ptr<A, Deleter<A>&> s2(new A, da);
+    s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp
new file mode 100644
index 0000000..4126484
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/move_convert13.fail.cpp
@@ -0,0 +1,36 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move assignment
+
+// Do not convert from an array unique_ptr
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+struct A
+{
+};
+
+struct Deleter
+{
+    void operator()(void*) {}
+};
+
+int main()
+{
+    std::unique_ptr<A[], Deleter> s;
+    std::unique_ptr<A, Deleter> s2;
+    s2 = std::move(s); // expected-error {{no viable overloaded '='}}
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp
new file mode 100644
index 0000000..e2d7956
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/null.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <cassert>
+
+// test assignment from null
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A> s2(new A);
+    assert(A::count == 1);
+    s2 = 0;
+    assert(A::count == 0);
+    assert(s2.get() == 0);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp
new file mode 100644
index 0000000..fb15849
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.asgn/nullptr.pass.cpp
@@ -0,0 +1,41 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move assignment
+
+#include <memory>
+#include <cassert>
+
+// test assignment from null
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A> s2(new A);
+    assert(A::count == 1);
+    s2 = nullptr;
+    assert(A::count == 0);
+    assert(s2.get() == 0);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp
new file mode 100644
index 0000000..f878ce4
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer.pass.cpp
@@ -0,0 +1,80 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// libc++ cannot safely provide the auto_ptr constructor without rvalue
+// references.
+// REQUIRES: c++11 || c++14
+
+// <memory>
+
+// unique_ptr
+
+// template <class U> unique_ptr(auto_ptr<U>&&) noexcept
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    B* p = new B;
+    std::auto_ptr<B> ap(p);
+    std::unique_ptr<A> up(std::move(ap));
+    assert(up.get() == p);
+    assert(ap.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+    B* p = new B;
+    std::auto_ptr<B> ap(p);
+    std::unique_ptr<A> up;
+    up = std::move(ap);
+    assert(up.get() == p);
+    assert(ap.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+#if TEST_STD_VER >= 11
+    {
+        static_assert(std::is_nothrow_constructible<
+            std::unique_ptr<A>,
+            std::auto_ptr<B>&&
+        >::value, "");
+    }
+#endif
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp
new file mode 100644
index 0000000..1f317c7
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer01.fail.cpp
@@ -0,0 +1,67 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer) ctor
+
+#include <memory>
+#include <cassert>
+
+// template <class U> explicit unique_ptr(auto_ptr<U>&);
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+//    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    B* p = new B;
+    std::auto_ptr<B> ap(p);
+    std::unique_ptr<A> up(ap);
+    assert(up.get() == p);
+    assert(ap.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+    B* p = new B;
+    std::auto_ptr<B> ap(p);
+    std::unique_ptr<A> up;
+    up = ap;
+    assert(up.get() == p);
+    assert(ap.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp
new file mode 100644
index 0000000..2dd5ea3
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/auto_pointer02.fail.cpp
@@ -0,0 +1,61 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer) ctor
+
+#include <memory>
+#include <cassert>
+
+// template <class U> explicit unique_ptr(auto_ptr<U>&);
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+struct Deleter
+{
+    template <class T>
+        void operator()(T*) {}
+};
+
+int main()
+{
+    {
+    B* p = new B;
+    std::auto_ptr<B> ap(p);
+    std::unique_ptr<A, Deleter> up(ap);
+    assert(up.get() == p);
+    assert(ap.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp
new file mode 100644
index 0000000..569daae
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default.pass.cpp
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING std::unique_ptr::unique_ptr()
+//
+// Concerns:
+//   1 The default constructor works for any default constructible deleter types.
+//   2 The stored type 'T' is allowed to be incomplete.
+//
+// Plan
+//  1 Default construct unique_ptr's with various deleter types (C-1)
+//  2 Default construct a unique_ptr with an incomplete element_type and
+//    various deleter types (C-1,2)
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct IncompleteT;
+
+void checkNumIncompleteTypeAlive(int i);
+
+template <class Del = std::default_delete<IncompleteT> >
+struct StoresIncomplete {
+  std::unique_ptr<IncompleteT, Del> m_ptr;
+  StoresIncomplete() {}
+  ~StoresIncomplete();
+
+  IncompleteT* get() const { return m_ptr.get(); }
+  Del& get_deleter() { return m_ptr.get_deleter(); }
+};
+
+int main()
+{
+    {
+      std::unique_ptr<int> p;
+      assert(p.get() == 0);
+    }
+    {
+      std::unique_ptr<int, NCDeleter<int> > p;
+      assert(p.get() == 0);
+      assert(p.get_deleter().state() == 0);
+      p.get_deleter().set_state(5);
+      assert(p.get_deleter().state() == 5);
+    }
+    {
+        StoresIncomplete<> s;
+        assert(s.get() == 0);
+        checkNumIncompleteTypeAlive(0);
+    }
+    checkNumIncompleteTypeAlive(0);
+    {
+        StoresIncomplete< Deleter<IncompleteT> > s;
+        assert(s.get() == 0);
+        assert(s.get_deleter().state() == 0);
+        checkNumIncompleteTypeAlive(0);
+    }
+    checkNumIncompleteTypeAlive(0);
+}
+
+struct IncompleteT {
+    static int count;
+    IncompleteT() { ++count; }
+    ~IncompleteT() {--count; }
+};
+
+int IncompleteT::count = 0;
+
+void checkNumIncompleteTypeAlive(int i) {
+    assert(IncompleteT::count == i);
+}
+
+template <class Del>
+StoresIncomplete<Del>::~StoresIncomplete() { }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp
new file mode 100644
index 0000000..2ffe1be
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default01.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr default ctor
+
+#include <memory>
+
+// default unique_ptr ctor should require default Deleter ctor
+class Deleter
+{
+
+    Deleter() {}
+
+public:
+
+    Deleter(Deleter&) {}
+    Deleter& operator=(Deleter&) {}
+
+    void operator()(void*) const {}
+};
+
+int main()
+{
+    std::unique_ptr<int, Deleter> p;
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp
similarity index 66%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp
index 8bed9dd..6907501 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default02.fail.cpp
@@ -11,18 +11,19 @@
 
 // unique_ptr
 
-// test op->()
+// Test unique_ptr default ctor
 
 #include <memory>
-#include <cassert>
 
-struct A {
-  int i_;
+// default unique_ptr ctor should require non-reference Deleter ctor
+class Deleter
+{
+public:
 
-  A() : i_(7) {}
+    void operator()(void*) {}
 };
 
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<int, Deleter&> p;
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp
similarity index 72%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp
index 8bed9dd..78f6e73 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/default03.fail.cpp
@@ -11,18 +11,13 @@
 
 // unique_ptr
 
-// test op->()
+// Test unique_ptr default ctor
 
 #include <memory>
-#include <cassert>
 
-struct A {
-  int i_;
+// default unique_ptr ctor should require non-pointer Deleter
 
-  A() : i_(7) {}
-};
-
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<int, void (*)(void*)> p;
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp
new file mode 100644
index 0000000..f49702a
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move.pass.cpp
@@ -0,0 +1,140 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+//=============================================================================
+// TESTING unique_ptr(unique_ptr&&)
+//
+// Concerns
+//   1 The moved from pointer is empty and the new pointer stores the old value.
+//   2 The only requirement on the deleter is that it is MoveConstructible
+//     or a reference.
+//   3 The constructor works for explicitly moved values (ie std::move(x))
+//   4 The constructor works for true temporaries (ie a return value)
+//
+// Plan
+//  1 Explicitly construct unique_ptr<T, D> for various deleter types 'D'.
+//    check that the value and deleter have been properly moved. (C-1,2,3)
+//
+//  2 Use the expression 'sink(source())' to move construct a unique_ptr<T, D>
+//    from a temporary. 'source' should return the unique_ptr by value and
+//    'sink' should accept the unique_ptr by value. (C-1,2,4)
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+template <class Expect>
+void sinkFunction(Expect)
+{
+}
+
+typedef std::unique_ptr<A> APtrSource1;
+typedef std::unique_ptr<A, Deleter<A> > APtrSource2;
+typedef std::unique_ptr<A, NCDeleter<A>& > APtrSource3;
+
+APtrSource1 source1() {
+    return APtrSource1 (new A);
+}
+
+void sink1(APtrSource1 p) {
+    assert(p.get() != nullptr);
+}
+
+APtrSource2 source2() {
+    return APtrSource2(new A, Deleter<A>(5));
+}
+
+void sink2(APtrSource2 p) {
+    assert(p.get() != nullptr);
+    assert(p.get_deleter().state() == 5);
+}
+
+APtrSource3 source3() {
+    static NCDeleter<A> d(5);
+    return APtrSource3(new A, d);
+}
+
+void sink3(APtrSource3 p) {
+    assert(p.get() != nullptr);
+    assert(p.get_deleter().state() == 5);
+    assert(&p.get_deleter() == &source3().get_deleter());
+}
+
+int main()
+{
+    {
+        typedef std::unique_ptr<A> APtr;
+        APtr s(new A);
+        A* p = s.get();
+        APtr s2 = std::move(s);
+        assert(s2.get() == p);
+        assert(s.get() == 0);
+        assert(A::count == 1);
+    }
+    assert(A::count == 0);
+    {
+        typedef Deleter<A> MoveDel;
+        typedef std::unique_ptr<A, MoveDel> APtr;
+        MoveDel d(5);
+        APtr s(new A, std::move(d));
+        assert(d.state() == 0);
+        assert(s.get_deleter().state() == 5);
+        A* p = s.get();
+        APtr s2 = std::move(s);
+        assert(s2.get() == p);
+        assert(s.get() == 0);
+        assert(A::count == 1);
+        assert(s2.get_deleter().state() == 5);
+        assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    {
+        typedef NCDeleter<A> NonCopyDel;
+        typedef std::unique_ptr<A, NonCopyDel&> APtr;
+
+        NonCopyDel d;
+        APtr s(new A, d);
+        A* p = s.get();
+        APtr s2 = std::move(s);
+        assert(s2.get() == p);
+        assert(s.get() == 0);
+        assert(A::count == 1);
+        d.set_state(6);
+        assert(s2.get_deleter().state() == d.state());
+        assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    {
+       sink1(source1());
+       assert(A::count == 0);
+       sink2(source2());
+       assert(A::count == 0);
+       sink3(source3());
+       assert(A::count == 0);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp
new file mode 100644
index 0000000..68ad589
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move01.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <cassert>
+
+// test move ctor.  Can't copy from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<A> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp
new file mode 100644
index 0000000..897b889
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move02.fail.cpp
@@ -0,0 +1,42 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <cassert>
+
+// test move ctor.  Can't copy from const lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<A> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp
new file mode 100644
index 0000000..7fb1a0a
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move03.fail.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <cassert>
+
+// test move ctor.  Can't copy from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete p;}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<A, Deleter> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp
new file mode 100644
index 0000000..671e343
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move04.fail.cpp
@@ -0,0 +1,55 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr move ctor
+
+#include <memory>
+#include <cassert>
+
+// test move ctor.  Can't copy from const lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
+
+int A::count = 0;
+
+class Deleter
+{
+    int state_;
+
+public:
+
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(A* p) {delete p;}
+};
+
+int main()
+{
+    {
+    const std::unique_ptr<A, Deleter> s(new A);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp
new file mode 100644
index 0000000..ada0109
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert.pass.cpp
@@ -0,0 +1,171 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// NOTE: unique_ptr does not provide converting constructors in c++03
+// XFAIL: c++98, c++03
+
+
+
+#include <memory>
+#include <type_traits>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+template <class LHS, class RHS>
+void checkReferenceDeleter(LHS& lhs, RHS& rhs) {
+    typedef typename LHS::deleter_type NewDel;
+    static_assert(std::is_reference<NewDel>::value, "");
+    rhs.get_deleter().set_state(42);
+    assert(rhs.get_deleter().state() == 42);
+    assert(lhs.get_deleter().state() == 42);
+    lhs.get_deleter().set_state(99);
+    assert(lhs.get_deleter().state() == 99);
+    assert(rhs.get_deleter().state() == 99);
+}
+
+template <class LHS, class RHS>
+void checkDeleter(LHS& lhs, RHS& rhs, int LHSVal, int RHSVal) {
+    assert(lhs.get_deleter().state() == LHSVal);
+    assert(rhs.get_deleter().state() == RHSVal);
+}
+
+template <class LHS, class RHS>
+void checkCtor(LHS& lhs, RHS& rhs, A* RHSVal) {
+    assert(lhs.get() == RHSVal);
+    assert(rhs.get() == nullptr);
+    assert(A::count == 1);
+    assert(B::count == 1);
+}
+
+void checkNoneAlive() {
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+int main()
+{
+    {
+        typedef std::unique_ptr<A> APtr;
+        typedef std::unique_ptr<B> BPtr;
+        { // explicit
+            BPtr b(new B);
+            A* p = b.get();
+            APtr a(std::move(b));
+            checkCtor(a, b, p);
+        }
+        checkNoneAlive();
+        { // implicit
+            BPtr b(new B);
+            A* p = b.get();
+            APtr a = std::move(b);
+            checkCtor(a, b, p);
+        }
+        checkNoneAlive();
+    }
+    { // test with moveable deleters
+        typedef std::unique_ptr<A, Deleter<A> > APtr;
+        typedef std::unique_ptr<B, Deleter<B> > BPtr;
+        {
+            Deleter<B> del(5);
+            BPtr b(new B, std::move(del));
+            A* p = b.get();
+            APtr a(std::move(b));
+            checkCtor(a, b, p);
+            checkDeleter(a, b, 5, 0);
+        }
+        checkNoneAlive();
+        {
+            Deleter<B> del(5);
+            BPtr b(new B, std::move(del));
+            A* p = b.get();
+            APtr a = std::move(b);
+            checkCtor(a, b, p);
+            checkDeleter(a, b, 5, 0);
+        }
+        checkNoneAlive();
+
+    }
+    { // test with reference deleters
+        typedef std::unique_ptr<A, NCDeleter<A>& > APtr;
+        typedef std::unique_ptr<B, NCDeleter<A>& > BPtr;
+        NCDeleter<A> del(5);
+        {
+            BPtr b(new B, del);
+            A* p = b.get();
+            APtr a(std::move(b));
+            checkCtor(a, b, p);
+            checkReferenceDeleter(a, b);
+        }
+        checkNoneAlive();
+        {
+            BPtr b(new B, del);
+            A* p = b.get();
+            APtr a = std::move(b);
+            checkCtor(a, b, p);
+            checkReferenceDeleter(a, b);
+        }
+        checkNoneAlive();
+    }
+    {
+        typedef std::unique_ptr<A, CDeleter<A> > APtr;
+        typedef std::unique_ptr<B, CDeleter<B>& > BPtr;
+        CDeleter<B> del(5);
+        {
+            BPtr b(new B, del);
+            A* p = b.get();
+            APtr a(std::move(b));
+            checkCtor(a, b, p);
+            checkDeleter(a, b, 5, 5);
+        }
+        checkNoneAlive();
+        {
+            BPtr b(new B, del);
+            A* p = b.get();
+            APtr a = std::move(b);
+            checkCtor(a, b, p);
+            checkDeleter(a, b, 5, 5);
+        }
+        checkNoneAlive();
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp
new file mode 100644
index 0000000..ed1fe8c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert01.fail.cpp
@@ -0,0 +1,56 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// Can't construct from lvalue
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp
new file mode 100644
index 0000000..3d1cb6f
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert02.fail.cpp
@@ -0,0 +1,62 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B, Deleter<B> > s(new B);
+    A* p = s.get();
+    std::unique_ptr<A, Deleter<A> > s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    assert(s2.get_deleter().state() == 5);
+    assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp
new file mode 100644
index 0000000..7409199
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert03.fail.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B, CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A, CDeleter<A>&> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp
new file mode 100644
index 0000000..981ea70
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert04.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// implicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    std::unique_ptr<B> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp
new file mode 100644
index 0000000..76462dc
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert05.fail.cpp
@@ -0,0 +1,51 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+#include "deleter_types.h"
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Implicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    std::unique_ptr<B, Deleter<B> > s(new B);
+    std::unique_ptr<A, Deleter<A> > s2 = s;
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp
new file mode 100644
index 0000000..5b9b12e
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert06.fail.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    std::unique_ptr<B, CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A, CDeleter<A>&> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp
new file mode 100644
index 0000000..bef022c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert07.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp
new file mode 100644
index 0000000..016eadc
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert08.fail.cpp
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class Deleter
+{
+    int state_;
+    Deleter(const Deleter&);
+    Deleter& operator=(const Deleter&);
+
+public:
+    Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;}
+    Deleter& operator=(Deleter&& r)
+    {
+        state_ = r.state_;
+        r.state_ = 0;
+        return *this;
+    }
+
+    Deleter() : state_(5) {}
+
+    template <class U>
+        Deleter(Deleter<U>&& d,
+            typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
+            : state_(d.state()) {d.set_state(0);}
+
+private:
+    template <class U>
+        Deleter(const Deleter<U>& d,
+            typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
+
+public:
+    int state() const {return state_;}
+    void set_state(int i) {state_ = i;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    const std::unique_ptr<B, Deleter<B> > s;
+    std::unique_ptr<A, Deleter<A> > s2(s);  // expected-error {{no matching constructor}}
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp
new file mode 100644
index 0000000..a475c17
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert09.fail.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    const std::unique_ptr<B, CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A, CDeleter<A>&> s2(s);
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp
new file mode 100644
index 0000000..f0da5ef
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert10.fail.cpp
@@ -0,0 +1,58 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// implicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
+    const std::unique_ptr<B> s(new B);
+    A* p = s.get();
+    std::unique_ptr<A> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp
new file mode 100644
index 0000000..1b8bb73
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert11.fail.cpp
@@ -0,0 +1,86 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: c++98, c++03
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Implicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class Deleter
+{
+    int state_;
+
+    Deleter(const Deleter&);
+    Deleter& operator=(const Deleter&);
+public:
+    Deleter(Deleter&& r) : state_(r.state_) {r.state_ = 0;}
+    Deleter& operator=(Deleter&& r)
+    {
+        state_ = r.state_;
+        r.state_ = 0;
+        return *this;
+    }
+
+    Deleter() : state_(5) {}
+
+    template <class U>
+        Deleter(Deleter<U>&& d,
+            typename std::enable_if<!std::is_same<U, T>::value>::type* = 0)
+            : state_(d.state()) {d.set_state(0);}
+
+private:
+    template <class U>
+        Deleter(const Deleter<U>& d,
+            typename std::enable_if<!std::is_same<U, T>::value>::type* = 0);
+
+public:
+    int state() const {return state_;}
+    void set_state(int i) {state_ = i;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    const std::unique_ptr<B, Deleter<B> > s;
+    std::unique_ptr<A, Deleter<A> > s2 = s; // expected-error {{no viable conversion}}
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp
new file mode 100644
index 0000000..095bec6
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert12.fail.cpp
@@ -0,0 +1,79 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr converting move ctor
+
+#include <memory>
+#include <utility>
+#include <cassert>
+
+// test converting move ctor.  Should only require a MoveConstructible deleter, or if
+//    deleter is a reference, not even that.
+// Explicit version
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+template <class T>
+class CDeleter
+{
+    int state_;
+
+    CDeleter(CDeleter&);
+    CDeleter& operator=(CDeleter&);
+public:
+
+    CDeleter() : state_(5) {}
+
+    int state() const {return state_;}
+    void set_state(int s) {state_ = s;}
+
+    void operator()(T* p) {delete p;}
+};
+
+int main()
+{
+    {
+    CDeleter<A> d;
+    const std::unique_ptr<B, CDeleter<A>&> s(new B, d);
+    A* p = s.get();
+    std::unique_ptr<A, CDeleter<A>&> s2 = s;
+    assert(s2.get() == p);
+    assert(s.get() == 0);
+    assert(A::count == 1);
+    assert(B::count == 1);
+    d.set_state(6);
+    assert(s2.get_deleter().state() == d.state());
+    assert(s.get_deleter().state() ==  d.state());
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp
similarity index 61%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp
index 8bed9dd..a4bd2cb 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/move_convert13.fail.cpp
@@ -11,18 +11,25 @@
 
 // unique_ptr
 
-// test op->()
+// Test unique_ptr converting move ctor
+
+// Do not convert from an array unique_ptr
 
 #include <memory>
+#include <utility>
 #include <cassert>
 
-struct A {
-  int i_;
-
-  A() : i_(7) {}
+struct A
+{
 };
 
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+struct Deleter
+{
+    void operator()(void*) {}
+};
+
+int main()
+{
+    std::unique_ptr<A[], Deleter> s;
+    std::unique_ptr<A, Deleter> s2(std::move(s));
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp
new file mode 100644
index 0000000..67a48a3
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/nullptr.pass.cpp
@@ -0,0 +1,46 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// unique_ptr(nullptr_t);
+
+#include <memory>
+#include <cassert>
+
+// default unique_ptr ctor should only require default Deleter ctor
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(5) {}
+
+    int state() const {return state_;}
+
+    void operator()(void*) {}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<int> p(nullptr);
+    assert(p.get() == 0);
+    }
+    {
+    std::unique_ptr<int, Deleter> p(nullptr);
+    assert(p.get() == 0);
+    assert(p.get_deleter().state() == 5);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp
new file mode 100644
index 0000000..da502b0
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer.pass.cpp
@@ -0,0 +1,163 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING std::unique_ptr::unique_ptr()
+//
+// Concerns:
+//   1 The pointer constructor works for any default constructible deleter types.
+//   2 The pointer constructor accepts pointers to derived types.
+//   2 The stored type 'T' is allowed to be incomplete.
+//
+// Plan
+//  1 Construct unique_ptr<T, D>'s with a pointer to 'T' and various deleter
+//   types (C-1)
+//  2 Construct unique_ptr<T, D>'s with a pointer to 'D' and various deleter
+//    types where 'D' is derived from 'T'. (C-1,2)
+//  3 Construct a unique_ptr<T, D> with a pointer to 'T' and various deleter
+//    types where 'T' is an incomplete type (C-1,3)
+
+// Test unique_ptr(pointer) ctor
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+// unique_ptr(pointer) ctor should only require default Deleter ctor
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+
+struct IncompleteT;
+
+IncompleteT* getIncomplete();
+void checkNumIncompleteTypeAlive(int i);
+
+template <class Del = std::default_delete<IncompleteT> >
+struct StoresIncomplete {
+  std::unique_ptr<IncompleteT, Del> m_ptr;
+  StoresIncomplete() {}
+  explicit StoresIncomplete(IncompleteT* ptr) : m_ptr(ptr) {}
+  ~StoresIncomplete();
+
+  IncompleteT* get() const { return m_ptr.get(); }
+  Del& get_deleter() { return m_ptr.get_deleter(); }
+};
+
+void test_pointer()
+{
+    {
+        A* p = new A;
+        assert(A::count == 1);
+        std::unique_ptr<A> s(p);
+        assert(s.get() == p);
+    }
+    assert(A::count == 0);
+    {
+        A* p = new A;
+        assert(A::count == 1);
+        std::unique_ptr<A, NCDeleter<A> > s(p);
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+}
+
+void test_derived()
+{
+    {
+        B* p = new B;
+        assert(A::count == 1);
+        assert(B::count == 1);
+        std::unique_ptr<A> s(p);
+        assert(s.get() == p);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
+        B* p = new B;
+        assert(A::count == 1);
+        assert(B::count == 1);
+        std::unique_ptr<A, NCDeleter<A> > s(p);
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+}
+
+void test_incomplete()
+{
+    {
+        IncompleteT* p = getIncomplete();
+        checkNumIncompleteTypeAlive(1);
+        StoresIncomplete<> s(p);
+        assert(s.get() == p);
+    }
+    checkNumIncompleteTypeAlive(0);
+    {
+        IncompleteT* p = getIncomplete();
+        checkNumIncompleteTypeAlive(1);
+        StoresIncomplete< NCDeleter<IncompleteT> > s(p);
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 0);
+    }
+    checkNumIncompleteTypeAlive(0);
+}
+
+struct IncompleteT {
+    static int count;
+    IncompleteT() { ++count; }
+    ~IncompleteT() {--count; }
+};
+
+int IncompleteT::count = 0;
+
+IncompleteT* getIncomplete() {
+    return new IncompleteT;
+}
+
+void checkNumIncompleteTypeAlive(int i) {
+    assert(IncompleteT::count == i);
+}
+
+template <class Del>
+StoresIncomplete<Del>::~StoresIncomplete() { }
+
+int main()
+{
+    test_pointer();
+    test_derived();
+    test_incomplete();
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp
new file mode 100644
index 0000000..1af04b2
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer01.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// Test unique_ptr(pointer) ctor
+
+#include <memory>
+
+// unique_ptr(pointer) ctor should require default Deleter ctor
+class Deleter
+{
+
+    Deleter() {}
+
+public:
+
+    Deleter(Deleter&) {}
+    Deleter& operator=(Deleter&) {}
+
+    void operator()(void*) const {}
+};
+
+int main()
+{
+    std::unique_ptr<int, Deleter> p(new int);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp
similarity index 64%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp
index f838661..9b7dd8c 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer02.fail.cpp
@@ -11,15 +11,19 @@
 
 // unique_ptr
 
-// test reset against resetting self
+// Test unique_ptr(pointer) ctor
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
+// unique_ptr(pointer) ctor should require non-reference Deleter ctor
+class Deleter
+{
+public:
 
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
+    void operator()(void*) {}
 };
 
-int main() { (new A)->reset(); }
+int main()
+{
+    std::unique_ptr<int, Deleter&> p(new int);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp
similarity index 70%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp
index f838661..a917d87 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer03.fail.cpp
@@ -11,15 +11,13 @@
 
 // unique_ptr
 
-// test reset against resetting self
+// Test unique_ptr(pointer) ctor
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
+// unique_ptr(pointer) ctor should require non-pointer Deleter
 
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
-};
-
-int main() { (new A)->reset(); }
+int main()
+{
+    std::unique_ptr<int, void (*)(void*)> p(new int);
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp
new file mode 100644
index 0000000..9294681
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter.pass.cpp
@@ -0,0 +1,123 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+//=============================================================================
+// TESTING unique_ptr(pointer, deleter)
+//
+// Concerns:
+//   1 unique_ptr(pointer, deleter&&) only requires a MoveConstructible deleter.
+//   2 unique_ptr(pointer, deleter&) requires a CopyConstructible deleter.
+//   3 unique_ptr<T, D&>(pointer, deleter) does not require a CopyConstructible deleter.
+//   4 unique_ptr<T, D const&>(pointer, deleter) does not require a CopyConstructible deleter.
+//   5 unique_ptr(pointer, deleter) should work for derived pointers.
+//   6 unique_ptr(pointer, deleter) should work with function pointers.
+//   7 unique_ptr<void> should work.
+
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
+
+int A::count = 0;
+
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+bool my_free_called = false;
+
+void my_free(void*) {
+    my_free_called = true;
+}
+
+int main()
+{
+    { // MoveConstructible deleter (C-1)
+        A* p = new A;
+        assert(A::count == 1);
+        std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>(5));
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    { // CopyConstructible deleter (C-2)
+        A* p = new A;
+        assert(A::count == 1);
+        CopyDeleter<A> d(5);
+        std::unique_ptr<A, CopyDeleter<A> > s(p, d);
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 5);
+        d.set_state(6);
+        assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    { // Reference deleter (C-3)
+        A* p = new A;
+        assert(A::count == 1);
+        NCDeleter<A> d(5);
+        std::unique_ptr<A, NCDeleter<A>&> s(p, d);
+        assert(s.get() == p);
+        assert(&s.get_deleter() == &d);
+        assert(s.get_deleter().state() == 5);
+        d.set_state(6);
+        assert(s.get_deleter().state() == 6);
+    }
+    assert(A::count == 0);
+    { // Const Reference deleter (C-4)
+        A* p = new A;
+        assert(A::count == 1);
+        NCConstDeleter<A> d(5);
+        std::unique_ptr<A, NCConstDeleter<A> const&> s(p, d);
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 5);
+        assert(&s.get_deleter() == &d);
+    }
+    assert(A::count == 0);
+    { // Derived pointers (C-5)
+        B* p = new B;
+        assert(A::count == 1);
+        assert(B::count == 1);
+        std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>(5));
+        assert(s.get() == p);
+        assert(s.get_deleter().state() == 5);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    { // Void and function pointers (C-6,7)
+        {
+        int i = 0;
+        std::unique_ptr<void, void(*)(void*)> s(&i, my_free);
+        assert(s.get() == &i);
+        assert(s.get_deleter() == my_free);
+        assert(!my_free_called);
+        }
+        assert(my_free_called);
+    }
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
similarity index 69%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.fail.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
index b4cd3f3..ad64b5e 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.fail.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.ctor/pointer_deleter04.fail.cpp
@@ -20,10 +20,11 @@
 #include <memory>
 
 struct Deleter {
-  void operator()(int* p) const { delete p; }
+    void operator()(int* p) const {delete p;}
 };
 
-int main() {
-  // expected-error@+1 {{call to deleted constructor of 'std::unique_ptr<int, const Deleter &>}}
-  std::unique_ptr<int, const Deleter&> s((int*)nullptr, Deleter());
+int main()
+{
+    // expected-error@memory:* {{static_assert failed "rvalue deleter bound to reference"}}
+    std::unique_ptr<int, const Deleter&> s((int*)nullptr, Deleter()); // expected-note {{requested here}}
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp
new file mode 100644
index 0000000..064f38c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.dtor/null.pass.cpp
@@ -0,0 +1,44 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// The deleter is not called if get() == 0
+
+#include <memory>
+#include <cassert>
+
+class Deleter
+{
+    int state_;
+
+    Deleter(Deleter&);
+    Deleter& operator=(Deleter&);
+
+public:
+    Deleter() : state_(0) {}
+
+    int state() const {return state_;}
+
+    void operator()(void*) {++state_;}
+};
+
+int main()
+{
+    Deleter d;
+    assert(d.state() == 0);
+    {
+    std::unique_ptr<int, Deleter&> p(0, d);
+    assert(p.get() == 0);
+    assert(&p.get_deleter() == &d);
+    }
+    assert(d.state() == 0);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp
similarity index 70%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp
index 8bed9dd..dadd4ec 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/release.pass.cpp
@@ -11,18 +11,17 @@
 
 // unique_ptr
 
-// test op->()
+// test release
 
 #include <memory>
 #include <cassert>
 
-struct A {
-  int i_;
-
-  A() : i_(7) {}
-};
-
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<int> p(new int(3));
+    int* i = p.get();
+    int* j = p.release();
+    assert(p.get() == 0);
+    assert(i == j);
+    delete j;
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
similarity index 63%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
index 8f2a699..2cf7f8b 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset1.pass.cpp
@@ -16,31 +16,35 @@
 #include <memory>
 #include <cassert>
 
-#include "unique_ptr_test_helper.h"
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    ~A() {--count;}
+};
 
-int main() {
-  {
+int A::count = 0;
+
+int main()
+{
+    {
     std::unique_ptr<A> p(new A);
     assert(A::count == 1);
-    assert(B::count == 0);
     A* i = p.get();
     assert(i != nullptr);
-    p.reset(new B);
+    p.reset();
+    assert(A::count == 0);
+    assert(p.get() == 0);
+    }
+    assert(A::count == 0);
+    {
+    std::unique_ptr<A> p(new A);
     assert(A::count == 1);
-    assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
-    std::unique_ptr<A> p(new B);
-    assert(A::count == 1);
-    assert(B::count == 1);
     A* i = p.get();
     assert(i != nullptr);
-    p.reset(new B);
+    p.reset(new A);
     assert(A::count == 1);
-    assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
+    }
+    assert(A::count == 0);
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
similarity index 66%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
index 8f2a699..2de7787 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset2.pass.cpp
@@ -16,10 +16,30 @@
 #include <memory>
 #include <cassert>
 
-#include "unique_ptr_test_helper.h"
+struct A
+{
+    static int count;
+    A() {++count;}
+    A(const A&) {++count;}
+    virtual ~A() {--count;}
+};
 
-int main() {
-  {
+int A::count = 0;
+
+struct B
+    : public A
+{
+    static int count;
+    B() {++count;}
+    B(const B&) {++count;}
+    virtual ~B() {--count;}
+};
+
+int B::count = 0;
+
+int main()
+{
+    {
     std::unique_ptr<A> p(new A);
     assert(A::count == 1);
     assert(B::count == 0);
@@ -28,10 +48,10 @@
     p.reset(new B);
     assert(A::count == 1);
     assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
+    {
     std::unique_ptr<A> p(new B);
     assert(A::count == 1);
     assert(B::count == 1);
@@ -40,7 +60,7 @@
     p.reset(new B);
     assert(A::count == 1);
     assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
+    }
+    assert(A::count == 0);
+    assert(B::count == 0);
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp
similarity index 76%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp
index f838661..58b05ef 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset_self.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/reset_self.pass.cpp
@@ -15,11 +15,15 @@
 
 #include <memory>
 
-struct A {
-  std::unique_ptr<A> ptr_;
+struct A
+{
+    std::unique_ptr<A> ptr_;
 
-  A() : ptr_(this) {}
-  void reset() { ptr_.reset(); }
+    A() : ptr_(this) {}
+    void reset() {ptr_.reset();}
 };
 
-int main() { (new A)->reset(); }
+int main()
+{
+    (new A)->reset();
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp
new file mode 100644
index 0000000..68a3204
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.modifiers/swap.pass.cpp
@@ -0,0 +1,59 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test swap
+
+#include <memory>
+#include <cassert>
+
+#include "deleter_types.h"
+
+struct A
+{
+    int state_;
+    static int count;
+    explicit A(int i) : state_(i) {++count;}
+    A(const A& a) : state_(a.state_) {++count;}
+    A& operator=(const A& a) {state_ = a.state_; return *this;}
+    ~A() {--count;}
+
+    friend bool operator==(const A& x, const A& y)
+        {return x.state_ == y.state_;}
+};
+
+int A::count = 0;
+
+int main()
+{
+    {
+    A* p1 = new A(1);
+    std::unique_ptr<A, Deleter<A> > s1(p1, Deleter<A>(1));
+    A* p2 = new A(2);
+    std::unique_ptr<A, Deleter<A> > s2(p2, Deleter<A>(2));
+    assert(s1.get() == p1);
+    assert(*s1 == A(1));
+    assert(s1.get_deleter().state() == 1);
+    assert(s2.get() == p2);
+    assert(*s2 == A(2));
+    assert(s2.get_deleter().state() == 2);
+    s1.swap(s2);
+    assert(s1.get() == p2);
+    assert(*s1 == A(2));
+    assert(s1.get_deleter().state() == 2);
+    assert(s2.get() == p1);
+    assert(*s2 == A(1));
+    assert(s2.get_deleter().state() == 1);
+    assert(A::count == 2);
+    }
+    assert(A::count == 0);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp
similarity index 85%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp
index b2d3da4..9d0cfca 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/dereference.pass.cpp
@@ -16,7 +16,8 @@
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    std::unique_ptr<int> p(new int(3));
+    assert(*p == 3);
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp
similarity index 60%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp
index b2d3da4..d5c7445 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/explicit_bool.pass.cpp
@@ -16,7 +16,24 @@
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    {
+    std::unique_ptr<int> p(new int(3));
+    if (p)
+        ;
+    else
+        assert(false);
+    if (!p)
+        assert(false);
+    }
+    {
+    std::unique_ptr<int> p;
+    if (!p)
+        ;
+    else
+        assert(false);
+    if (p)
+        assert(false);
+    }
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp
similarity index 79%
copy from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
copy to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp
index b2d3da4..24fa6be 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get.pass.cpp
@@ -11,12 +11,14 @@
 
 // unique_ptr
 
-// test op*()
+// test get
 
 #include <memory>
 #include <cassert>
 
-int main() {
-  std::unique_ptr<int> p(new int(3));
-  assert(*p == 3);
+int main()
+{
+    int* p = new int;
+    std::unique_ptr<int> s(p);
+    assert(s.get() == p);
 }
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp
new file mode 100644
index 0000000..5ed8a22
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/get_deleter.pass.cpp
@@ -0,0 +1,37 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test get_deleter()
+
+#include <memory>
+#include <cassert>
+
+struct Deleter
+{
+    void operator()(void*) {}
+
+    int test() {return 5;}
+    int test() const {return 6;}
+};
+
+int main()
+{
+    {
+    std::unique_ptr<int, Deleter> p;
+    assert(p.get_deleter().test() == 5);
+    }
+    {
+    const std::unique_ptr<int, Deleter> p;
+    assert(p.get_deleter().test() == 6);
+    }
+}
diff --git a/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp
new file mode 100644
index 0000000..21e829c
--- /dev/null
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/index.fail.cpp
@@ -0,0 +1,47 @@
+//===----------------------------------------------------------------------===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <memory>
+
+// unique_ptr
+
+// test op[](size_t)
+
+#include <memory>
+#include <cassert>
+
+class A
+{
+    int state_;
+    static int next_;
+public:
+    A() : state_(++next_) {}
+    int get() const {return state_;}
+
+    friend bool operator==(const A& x, int y)
+        {return x.state_ == y;}
+
+    A& operator=(int i) {state_ = i; return *this;}
+};
+
+int A::next_ = 0;
+
+int main()
+{
+    std::unique_ptr<A> p(new A[3]);
+    assert(p[0] == 1);
+    assert(p[1] == 2);
+    assert(p[2] == 3);
+    p[0] = 3;
+    p[1] = 2;
+    p[2] = 1;
+    assert(p[0] == 3);
+    assert(p[1] == 2);
+    assert(p[2] == 1);
+}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp
similarity index 79%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp
index 8bed9dd..47de8f6 100644
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.single.pass.cpp
+++ b/test/std/utilities/memory/unique.ptr/unique.ptr.single/unique.ptr.single.observers/op_arrow.pass.cpp
@@ -16,13 +16,15 @@
 #include <memory>
 #include <cassert>
 
-struct A {
-  int i_;
+struct A
+{
+    int i_;
 
-  A() : i_(7) {}
+    A() : i_(7) {}
 };
 
-int main() {
-  std::unique_ptr<A> p(new A);
-  assert(p->i_ == 7);
+int main()
+{
+    std::unique_ptr<A> p(new A);
+    assert(p->i_ == 7);
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.special/eq.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.special/eq.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.special/eq.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.special/rel.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.special/rel.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.special/rel.pass.cpp
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.special/swap.pass.cpp b/test/std/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp
similarity index 100%
rename from test/std/utilities/smartptr/unique.ptr/unique.ptr.special/swap.pass.cpp
rename to test/std/utilities/memory/unique.ptr/unique.ptr.special/swap.pass.cpp
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
index eb0d0a9..5a0d925 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.enab/enable_shared_from_this.pass.cpp
@@ -49,10 +49,6 @@
 };
 
 
-struct PrivateBase : private std::enable_shared_from_this<PrivateBase> {
-};
-
-
 int main()
 {
     {  // https://bugs.llvm.org/show_bug.cgi?id=18843
@@ -78,12 +74,6 @@
     assert(p == q);
     assert(!p.owner_before(q) && !q.owner_before(p)); // p and q share ownership
     }
-    {
-      typedef std::shared_ptr<PrivateBase> APtr;
-      typedef std::weak_ptr<PrivateBase> WeakAPtr;
-      APtr a1 = std::make_shared<PrivateBase>();
-      assert(a1.use_count() == 1);
-    }
     // Test LWG issue 2529. Only reset '__weak_ptr_' when it's already expired.
     // http://cplusplus.github.io/LWG/lwg-active.html#2529.
     // Test two different ways:
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
index 78b04d8..879ea40 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.hash/hash_unique_ptr.pass.cpp
@@ -50,7 +50,7 @@
 
 template <class T>
 struct hash<::min_pointer<T, std::integral_constant<size_t, 1>>> {
-  size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const TEST_NOEXCEPT_FALSE {
+  size_t operator()(::min_pointer<T, std::integral_constant<size_t, 1>> p) const {
     if (!p) return 0;
     return std::hash<T*>{}(std::addressof(*p));
   }
@@ -72,11 +72,6 @@
   }
 #if TEST_STD_VER >= 11
   {
-    std::unique_ptr<int, PointerDeleter<int, 1>> pThrowingHash;
-    std::hash<std::unique_ptr<int, PointerDeleter<int, 1>>> fThrowingHash;
-    ASSERT_NOT_NOEXCEPT(fThrowingHash(pThrowingHash));
-  }
-  {
     test_enabled_with_deleter<int, Deleter<int>>();
     test_enabled_with_deleter<int[], Deleter<int[]>>();
     test_enabled_with_deleter<int, CopyDeleter<int>>();
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
index 4b56a8f..3bad537 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
index 065a7e9..5cc1234 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_strong_explicit.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
index 2351e97..a89c0db 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
index e36c8a5..821cea6 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_compare_exchange_weak_explicit.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
index f1fe28c..66be756 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
index 45cbc50..493ba7f 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_exchange_explicit.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
index b51c6cf..4820d05 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
index 9f3617a..ef8dc82 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_load_explicit.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
index 5ae2680..a13a7d5 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
index ecba90b..6dfe316 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared.atomic/atomic_store_explicit.pass.cpp
@@ -11,8 +11,8 @@
 //
 // This test uses new symbols that were not defined in the libc++ shipped on
 // darwin11 and darwin12:
-// XFAIL: availability=macosx10.7
-// XFAIL: availability=macosx10.8
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 
 // <memory>
 
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
index 3ad3232..73e87f3 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/auto_ptr.pass.cpp
@@ -86,7 +86,6 @@
             // Without rvalue references, ptr got copied into
             // the shared_ptr destructor and the copy was
             // destroyed during unwinding.
-            (void) raw_ptr; // silence 'unused variable' warning
             assert(A::count == 0);
             assert(B::count == 0);
 #endif
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
index 1728919..877577c 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp
@@ -80,7 +80,6 @@
             assert(B::count == 1);
             assert(ptr.get() == raw_ptr);
 #else
-            (void) raw_ptr; // silence 'unused variable' warning
             assert(A::count == 0);
             assert(B::count == 0);
             assert(ptr.get() == 0);
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
index f8f73f7..2a7ac99 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/make_shared.pass.cpp
@@ -45,25 +45,6 @@
     virtual ~Foo() = default;
 };
 
-#ifdef _LIBCPP_VERSION
-struct Result {};
-static Result theFunction() { return Result(); }
-static int resultDeletorCount;
-static void resultDeletor(Result (*pf)()) {
-  assert(pf == theFunction);
-  ++resultDeletorCount;
-}
-
-void test_pointer_to_function() {
-    { // https://bugs.llvm.org/show_bug.cgi?id=27566
-      std::shared_ptr<Result()> x(&theFunction, &resultDeletor);
-      std::shared_ptr<Result()> y(theFunction, resultDeletor);
-    }
-    assert(resultDeletorCount == 2);
-}
-#else // _LIBCPP_VERSION
-void test_pointer_to_function() {}
-#endif // _LIBCPP_VERSION
 
 int main()
 {
@@ -85,8 +66,6 @@
     assert(p2.get());
     }
 
-    test_pointer_to_function();
-
 #if TEST_STD_VER >= 11
     nc = globalMemCounter.outstanding_new;
     {
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp
index 9f6f1bc..3acd2f8 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_shared_ptr.pass.cpp
@@ -11,11 +11,10 @@
 
 // shared_ptr
 
-// template <class U> bool owner_before(shared_ptr<U> const& b) const noexcept;
+// template <class U> bool owner_before(shared_ptr<U> const& b) const;
 
 #include <memory>
 #include <cassert>
-#include "test_macros.h"
 
 int main()
 {
@@ -26,5 +25,4 @@
     assert(!p2.owner_before(p1));
     assert(p1.owner_before(p3) || p3.owner_before(p1));
     assert(p3.owner_before(p1) == p3.owner_before(p2));
-    ASSERT_NOEXCEPT(p1.owner_before(p2));
 }
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp
index 560293b..33447ba 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.obs/owner_before_weak_ptr.pass.cpp
@@ -11,11 +11,10 @@
 
 // shared_ptr
 
-// template <class U> bool owner_before(weak_ptr<U> const& b) const noexcept;
+// template <class U> bool owner_before(weak_ptr<U> const& b) const;
 
 #include <memory>
 #include <cassert>
-#include "test_macros.h"
 
 int main()
 {
@@ -29,5 +28,4 @@
     assert(!p2.owner_before(w1));
     assert(p1.owner_before(w3) || p3.owner_before(w1));
     assert(p3.owner_before(w1) == p3.owner_before(w2));
-    ASSERT_NOEXCEPT(p1.owner_before(w2));
 }
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
index 501844a..142eba2 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.ownerless/owner_less.pass.cpp
@@ -16,9 +16,9 @@
 //     : binary_function<shared_ptr<T>, shared_ptr<T>, bool>
 // {
 //     typedef bool result_type;
-//     bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const noexcept;
-//     bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-//     bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
+//     bool operator()(shared_ptr<T> const&, shared_ptr<T> const&) const;
+//     bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
+//     bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
 // };
 //
 // template <class T>
@@ -26,22 +26,22 @@
 //     : binary_function<weak_ptr<T>, weak_ptr<T>, bool>
 // {
 //     typedef bool result_type;
-//     bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-//     bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const noexcept;
-//     bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const noexcept;
+//     bool operator()(weak_ptr<T> const&, weak_ptr<T> const&) const;
+//     bool operator()(shared_ptr<T> const&, weak_ptr<T> const&) const;
+//     bool operator()(weak_ptr<T> const&, shared_ptr<T> const&) const;
 // };
 //
 // Added in C++17
 // template<> struct owner_less<void>
 // {
 //     template<class T, class U>
-//         bool operator()(shared_ptr<T> const&, shared_ptr<U> const&) const noexcept;
+//         bool operator()(shared_ptr<T> const&, shared_ptr<U> const&) const;
 //     template<class T, class U>
-//         bool operator()(shared_ptr<T> const&, weak_ptr<U> const&) const noexcept;
+//         bool operator()(shared_ptr<T> const&, weak_ptr<U> const&) const;
 //     template<class T, class U>
-//         bool operator()(weak_ptr<T> const&, shared_ptr<U> const&) const noexcept;
+//         bool operator()(weak_ptr<T> const&, shared_ptr<U> const&) const;
 //     template<class T, class U>
-//         bool operator()(weak_ptr<T> const&, weak_ptr<U> const&) const noexcept;
+//         bool operator()(weak_ptr<T> const&, weak_ptr<U> const&) const;
 //
 //     typedef unspecified is_transparent;
 // };
@@ -74,14 +74,11 @@
     assert(!cs(p2, p1));
     assert(cs(p1 ,p3) || cs(p3, p1));
     assert(cs(p3, p1) == cs(p3, p2));
-	ASSERT_NOEXCEPT(cs(p1, p1));
 
     assert(!cs(p1, w2));
     assert(!cs(p2, w1));
     assert(cs(p1, w3) || cs(p3, w1));
     assert(cs(p3, w1) == cs(p3, w2));
-	ASSERT_NOEXCEPT(cs(p1, w1));
-	ASSERT_NOEXCEPT(cs(w1, p1));
     }
     {
     typedef std::owner_less<std::weak_ptr<int> > CS;
@@ -95,14 +92,11 @@
     assert(!cs(w2, w1));
     assert(cs(w1, w3) || cs(w3, w1));
     assert(cs(w3, w1) == cs(w3, w2));
-	ASSERT_NOEXCEPT(cs(w1, w1));
 
     assert(!cs(w1, p2));
     assert(!cs(w2, p1));
     assert(cs(w1, p3) || cs(w3, p1));
     assert(cs(w3, p1) == cs(w3, p2));
-	ASSERT_NOEXCEPT(cs(w1, p1));
-	ASSERT_NOEXCEPT(cs(p1, w1));
     }
 #if TEST_STD_VER > 14
     {
@@ -117,10 +111,6 @@
     cmp(sp1, sp3);
     cmp(wp1, sp1);
     cmp(wp1, wp1);
-	ASSERT_NOEXCEPT(cmp(sp1, sp1));
-	ASSERT_NOEXCEPT(cmp(sp1, wp1));
-	ASSERT_NOEXCEPT(cmp(wp1, sp1));
-	ASSERT_NOEXCEPT(cmp(wp1, wp1));
     }
     {
     // test heterogeneous lookups
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp
index 458f8a1..4aa49cf 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_shared_ptr.pass.cpp
@@ -11,11 +11,10 @@
 
 // weak_ptr
 
-// template<class U> bool owner_before(const shared_ptr<U>& b) const noexcept;
+// template<class U> bool owner_before(const shared_ptr<U>& b);
 
 #include <memory>
 #include <cassert>
-#include "test_macros.h"
 
 int main()
 {
@@ -29,6 +28,4 @@
     assert(!w2.owner_before(p1));
     assert(w1.owner_before(p3) || w3.owner_before(p1));
     assert(w3.owner_before(p1) == w3.owner_before(p2));
-//  change to 'ASSERT_NOEXCEPT' when LWG2942 is adopted
-    LIBCPP_ASSERT_NOEXCEPT(w1.owner_before(p2));
 }
diff --git a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp
index 5cd171a..9fe2b6e 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp
+++ b/test/std/utilities/memory/util.smartptr/util.smartptr.weak/util.smartptr.weak.obs/owner_before_weak_ptr.pass.cpp
@@ -11,11 +11,10 @@
 
 // weak_ptr
 
-// template<class U> bool owner_before(const weak_ptr<U>& b) const noexcept;
+// template<class U> bool owner_before(const weak_ptr<U>& b);
 
 #include <memory>
 #include <cassert>
-#include "test_macros.h"
 
 int main()
 {
@@ -29,6 +28,4 @@
     assert(!w2.owner_before(w1));
     assert(w1.owner_before(w3) || w3.owner_before(w1));
     assert(w3.owner_before(w1) == w3.owner_before(w2));
-//  change to 'ASSERT_NOEXCEPT' when LWG2942 is adopted
-    LIBCPP_ASSERT_NOEXCEPT(w1.owner_before(w2));
 }
diff --git a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
index bf8aa04..51a837e 100644
--- a/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
+++ b/test/std/utilities/meta/meta.help/integral_constant.pass.cpp
@@ -22,11 +22,11 @@
     static_assert(_5::value == 5, "");
     static_assert((std::is_same<_5::value_type, int>::value), "");
     static_assert((std::is_same<_5::type, _5>::value), "");
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert((_5() == 5), "");
-#endif
+#else
     assert(_5() == 5);
-
+#endif
 
 #if TEST_STD_VER > 11
     static_assert ( _5{}() == 5, "" );
diff --git a/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp b/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
index 20c9eca..552c160 100644
--- a/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
+++ b/test/std/utilities/meta/meta.rel/is_convertible.pass.cpp
@@ -120,9 +120,7 @@
     static_assert((!std::is_convertible<ConstFunction, Function>::value), "");
     static_assert((!std::is_convertible<ConstFunction, Function*>::value), "");
     static_assert((!std::is_convertible<ConstFunction, Function&>::value), "");
-#if TEST_STD_VER >= 11
-    static_assert((!std::is_convertible<ConstFunction, Function&&>::value), "");
-#endif
+    static_assert((!std::is_convertible<ConstFunction, Function>::value), "");
     static_assert((!std::is_convertible<Function*, ConstFunction>::value), "");
     static_assert((!std::is_convertible<Function&, ConstFunction>::value), "");
     static_assert((!std::is_convertible<ConstFunction, ConstFunction>::value), "");
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
index 8835482..43f23f5 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/aligned_union.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // type_traits
 
 // aligned_union<size_t Len, class ...Types>
@@ -19,6 +17,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     {
     typedef std::aligned_union<10, char >::type T1;
 #if TEST_STD_VER > 11
@@ -91,4 +90,5 @@
     static_assert(std::alignment_of<T1>::value == 4, "");
     static_assert(sizeof(T1) == 4, "");
     }
+#endif
 }
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
index 85b1472..61523e4 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
@@ -37,16 +37,8 @@
       typedef S<T> type;
     };
 
-//  P0548
-    template <class T>
-    struct common_type< ::S<T>, ::S<T> > {
-      typedef S<T> type;
-    };
-
     template <> struct common_type< ::S<long>, long> {};
     template <> struct common_type<long, ::S<long> > {};
-    template <> struct common_type< ::X<float> > {};
-    template <> struct common_type< ::X<double>, ::X<double> > {};
 }
 
 #if TEST_STD_VER >= 11
@@ -96,9 +88,6 @@
   static_assert(std::is_same<CommonType<int const>, int>::value, "");
   static_assert(std::is_same<CommonType<int volatile[]>, int volatile*>::value, "");
   static_assert(std::is_same<CommonType<void(&)()>, void(*)()>::value, "");
-
-  static_assert(no_common_type<X<float> >::value, "");
-  static_assert(no_common_type<X<double> >::value, "");
 }
 
 template <class T, class U, class Expect>
@@ -295,18 +284,4 @@
   test_bullet_three_two();
   test_bullet_four();
 #endif
-
-//  P0548
-    static_assert((std::is_same<std::common_type<S<int> >::type,         S<int> >::value), "");
-    static_assert((std::is_same<std::common_type<S<int>, S<int> >::type, S<int> >::value), "");
-
-    static_assert((std::is_same<std::common_type<int>::type,                int>::value), "");
-    static_assert((std::is_same<std::common_type<const int>::type,          int>::value), "");
-    static_assert((std::is_same<std::common_type<volatile int>::type,       int>::value), "");
-    static_assert((std::is_same<std::common_type<const volatile int>::type, int>::value), "");
-
-    static_assert((std::is_same<std::common_type<int, int>::type,             int>::value), "");
-    static_assert((std::is_same<std::common_type<const int, int>::type,       int>::value), "");
-    static_assert((std::is_same<std::common_type<int, const int>::type,       int>::value), "");
-    static_assert((std::is_same<std::common_type<const int, const int>::type, int>::value), "");
 }
diff --git a/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp b/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
index 4f45a03..bcd8398 100644
--- a/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
+++ b/test/std/utilities/meta/meta.trans/meta.trans.other/decay.pass.cpp
@@ -33,10 +33,4 @@
     test_decay<int[3], int*>();
     test_decay<const int[3], const int*>();
     test_decay<void(), void (*)()>();
-#if TEST_STD_VER > 11
-	test_decay<int(int) const, int(int) const>();
-	test_decay<int(int) volatile, int(int) volatile>();
-	test_decay<int(int)  &, int(int)  &>();
-	test_decay<int(int) &&, int(int) &&>();
-#endif
 }
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
index 4e875fa..c340ba6 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/is_function.pass.cpp
@@ -16,13 +16,9 @@
 
 #include "test_macros.h"
 
-// NOTE: On Windows the function `test_is_function<void()>` and
-// `test_is_function<void() noexcept> has the same mangled despite being
-// a distinct instantiation. This causes Clang to emit an error. However
-// structs do not have this problem.
-
 template <class T>
-struct test_is_function {
+void test_is_function()
+{
     static_assert( std::is_function<T>::value, "");
     static_assert( std::is_function<const T>::value, "");
     static_assert( std::is_function<volatile T>::value, "");
@@ -33,10 +29,11 @@
     static_assert( std::is_function_v<volatile T>, "");
     static_assert( std::is_function_v<const volatile T>, "");
 #endif
-};
+}
 
 template <class T>
-struct test_is_not_function {
+void test_is_not_function()
+{
     static_assert(!std::is_function<T>::value, "");
     static_assert(!std::is_function<const T>::value, "");
     static_assert(!std::is_function<volatile T>::value, "");
@@ -47,7 +44,7 @@
     static_assert(!std::is_function_v<volatile T>, "");
     static_assert(!std::is_function_v<const volatile T>, "");
 #endif
-};
+}
 
 class Empty
 {
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
index f685d71..691c549 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.cat/member_function_pointer.pass.cpp
@@ -14,12 +14,9 @@
 #include <type_traits>
 #include "test_macros.h"
 
-// NOTE: On Windows the function `test_is_member_function<void()>` and
-// `test_is_member_function<void() noexcept> has the same mangled despite being
-// a distinct instantiation. This causes Clang to emit an error. However
-// structs do not have this problem.
 template <class T>
-struct test_member_function_pointer_imp {
+void test_member_function_pointer_imp()
+{
     static_assert(!std::is_void<T>::value, "");
 #if TEST_STD_VER > 11
     static_assert(!std::is_null_pointer<T>::value, "");
@@ -36,16 +33,16 @@
     static_assert(!std::is_union<T>::value, "");
     static_assert(!std::is_class<T>::value, "");
     static_assert(!std::is_function<T>::value, "");
-};
+}
 
 template <class T>
-struct test_member_function_pointer :
-    test_member_function_pointer_imp<T>,
-    test_member_function_pointer_imp<const T>,
-    test_member_function_pointer_imp<volatile T>,
-    test_member_function_pointer_imp<const volatile T>
+void test_member_function_pointer()
 {
-};
+    test_member_function_pointer_imp<T>();
+    test_member_function_pointer_imp<const T>();
+    test_member_function_pointer_imp<volatile T>();
+    test_member_function_pointer_imp<const volatile T>();
+}
 
 class Class
 {
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp
deleted file mode 100644
index 9c72d4d..0000000
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_aggregate.pass.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// <type_traits>
-
-// template <class T> struct is_aggregate;
-// template <class T> constexpr bool is_aggregate_v = is_aggregate<T>::value;
-
-#include <type_traits>
-#include "test_macros.h"
-
-template <class T>
-void test_true()
-{
-#if !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
-    static_assert( std::is_aggregate<T>::value, "");
-    static_assert( std::is_aggregate<const T>::value, "");
-    static_assert( std::is_aggregate<volatile T>::value, "");
-    static_assert( std::is_aggregate<const volatile T>::value, "");
-    static_assert( std::is_aggregate_v<T>, "");
-    static_assert( std::is_aggregate_v<const T>, "");
-    static_assert( std::is_aggregate_v<volatile T>, "");
-    static_assert( std::is_aggregate_v<const volatile T>, "");
-#endif
-}
-
-template <class T>
-void test_false()
-{
-#if !defined(_LIBCPP_HAS_NO_IS_AGGREGATE)
-    static_assert(!std::is_aggregate<T>::value, "");
-    static_assert(!std::is_aggregate<const T>::value, "");
-    static_assert(!std::is_aggregate<volatile T>::value, "");
-    static_assert(!std::is_aggregate<const volatile T>::value, "");
-    static_assert(!std::is_aggregate_v<T>, "");
-    static_assert(!std::is_aggregate_v<const T>, "");
-    static_assert(!std::is_aggregate_v<volatile T>, "");
-    static_assert(!std::is_aggregate_v<const volatile T>, "");
-#endif
-}
-
-struct Aggregate {};
-struct HasCons { HasCons(int); };
-struct HasPriv {
-  void PreventUnusedPrivateMemberWarning();
-private:
-  int x;
-};
-struct Union { int x; void* y; };
-
-
-int main ()
-{
-  {
-    test_false<void>();
-    test_false<int>();
-    test_false<void*>();
-    test_false<void()>();
-    test_false<void() const>();
-    test_false<void(Aggregate::*)(int) const>();
-    test_false<Aggregate&>();
-    test_false<HasCons>();
-    test_false<HasPriv>();
-  }
-  {
-    test_true<Aggregate>();
-    test_true<Aggregate[]>();
-    test_true<Aggregate[42][101]>();
-    test_true<Union>();
-  }
-}
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
index 9d2ec5e..f6ae401 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -251,7 +251,6 @@
     LIBCPP_STATIC_ASSERT(
         clang_disallows_valid_static_cast_bug !=
         std::__libcpp_is_constructible<int&&, ExplicitTo<int&&>>::value, "");
-    ((void)clang_disallows_valid_static_cast_bug); // Prevent unused warning
 #else
     static_assert(clang_disallows_valid_static_cast_bug == false, "");
     LIBCPP_STATIC_ASSERT(std::__libcpp_is_constructible<int&&, ExplicitTo<int&&>>::value, "");
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
index 0bb373c..42ecdb3 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_copyable.pass.cpp
@@ -11,9 +11,7 @@
 
 // is_trivially_copyable
 
-// These compilers have not implemented Core 2094 which makes volatile
-// qualified types trivially copyable.
-// XFAIL: clang-3, clang-4, apple-clang, gcc
+// XFAIL: gcc-4.9
 
 #include <type_traits>
 #include <cassert>
@@ -24,13 +22,13 @@
 {
     static_assert( std::is_trivially_copyable<T>::value, "");
     static_assert( std::is_trivially_copyable<const T>::value, "");
-    static_assert( std::is_trivially_copyable<volatile T>::value, "");
-    static_assert( std::is_trivially_copyable<const volatile T>::value, "");
+    static_assert(!std::is_trivially_copyable<volatile T>::value, "");
+    static_assert(!std::is_trivially_copyable<const volatile T>::value, "");
 #if TEST_STD_VER > 14
     static_assert( std::is_trivially_copyable_v<T>, "");
     static_assert( std::is_trivially_copyable_v<const T>, "");
-    static_assert( std::is_trivially_copyable_v<volatile T>, "");
-    static_assert( std::is_trivially_copyable_v<const volatile T>, "");
+    static_assert(!std::is_trivially_copyable_v<volatile T>, "");
+    static_assert(!std::is_trivially_copyable_v<const volatile T>, "");
 #endif
 }
 
diff --git a/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp b/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
index 198eee6..e3c7bb5 100644
--- a/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
+++ b/test/std/utilities/optional/optional.bad_optional_access/default.pass.cpp
@@ -9,13 +9,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // class bad_optional_access is default constructible
diff --git a/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp
index dc69739..b54a08f 100644
--- a/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/equal.pass.cpp
@@ -10,55 +10,44 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator==(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator==(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator==(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator==(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator==(const X& lhs, const X& rhs) {
-  return lhs.i_ == rhs.i_;
-}
+constexpr bool operator == ( const X &lhs, const X &rhs )
+    { return lhs.i_ == rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert(!(o1 == T(1)), "");
-    static_assert((o2 == T(1)), "");
-    static_assert(!(o3 == T(1)), "");
-    static_assert((o3 == T(2)), "");
-    static_assert((o3 == val), "");
+    static_assert ( !(o1 == T(1)), "" );
+    static_assert (  (o2 == T(1)), "" );
+    static_assert ( !(o3 == T(1)), "" );
+    static_assert (  (o3 == T(2)), "" );
+    static_assert (  (o3 == val),  "" );
 
-    static_assert(!(T(1) == o1), "");
-    static_assert((T(1) == o2), "");
-    static_assert(!(T(1) == o3), "");
-    static_assert((T(2) == o3), "");
-    static_assert((val == o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 == 42l, "");
-    static_assert(!(101l == o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 == 42, "");
-    static_assert(!(101 == o1), "");
-  }
+    static_assert ( !(T(1) == o1), "" );
+    static_assert (  (T(1) == o2), "" );
+    static_assert ( !(T(1) == o3), "" );
+    static_assert (  (T(2) == o3), "" );
+    static_assert (  (val  == o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp
index e1bad12..064114f 100644
--- a/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/greater.pass.cpp
@@ -10,55 +10,46 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator>(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator>(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator>(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator>(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator>(const X& lhs, const X& rhs) { return lhs.i_ > rhs.i_; }
+constexpr bool operator > ( const X &lhs, const X &rhs )
+    { return lhs.i_ > rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert(!(o1 > T(1)), "");
-    static_assert(!(o2 > T(1)), ""); // equal
-    static_assert((o3 > T(1)), "");
-    static_assert(!(o2 > val), "");
-    static_assert(!(o3 > val), ""); // equal
-    static_assert(!(o3 > T(3)), "");
+    static_assert ( !(o1 > T(1)), "" );
+    static_assert ( !(o2 > T(1)), "" );  // equal
+    static_assert (  (o3 > T(1)), "" );
+    static_assert ( !(o2 >  val), "" );
+    static_assert ( !(o3 >  val), "" );  // equal
+    static_assert ( !(o3 > T(3)), "" );
 
-    static_assert((T(1) > o1), "");
-    static_assert(!(T(1) > o2), ""); // equal
-    static_assert(!(T(1) > o3), "");
-    static_assert((val > o2), "");
-    static_assert(!(val > o3), ""); // equal
-    static_assert((T(3) > o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 > 11l, "");
-    static_assert(!(42l > o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 > 11, "");
-    static_assert(!(42 > o1), "");
-  }
+    static_assert (   (T(1) > o1), "" );
+    static_assert (  !(T(1) > o2), "" ); // equal
+    static_assert (  !(T(1) > o3), "" );
+    static_assert (   (val  > o2), "" );
+    static_assert (  !(val  > o3), "" ); // equal
+    static_assert (   (T(3) > o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp
index 342ddff..663686c 100644
--- a/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/greater_equal.pass.cpp
@@ -10,57 +10,46 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator>=(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator>=(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator>=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator>=(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator>=(const X& lhs, const X& rhs) {
-  return lhs.i_ >= rhs.i_;
-}
+constexpr bool operator >= ( const X &lhs, const X &rhs )
+    { return lhs.i_ >= rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert(!(o1 >= T(1)), "");
-    static_assert((o2 >= T(1)), ""); // equal
-    static_assert((o3 >= T(1)), "");
-    static_assert(!(o2 >= val), "");
-    static_assert((o3 >= val), ""); // equal
-    static_assert(!(o3 >= T(3)), "");
+    static_assert ( !(o1 >= T(1)), "" );
+    static_assert (  (o2 >= T(1)), "" );  // equal
+    static_assert (  (o3 >= T(1)), "" );
+    static_assert ( !(o2 >=  val), "" );
+    static_assert (  (o3 >=  val), "" );  // equal
+    static_assert ( !(o3 >= T(3)), "" );
 
-    static_assert((T(1) >= o1), "");
-    static_assert((T(1) >= o2), ""); // equal
-    static_assert(!(T(1) >= o3), "");
-    static_assert((val >= o2), "");
-    static_assert((val >= o3), ""); // equal
-    static_assert((T(3) >= o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 >= 42l, "");
-    static_assert(!(11l >= o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 >= 42, "");
-    static_assert(!(11 >= o1), "");
-  }
+    static_assert (   (T(1) >= o1), "" );
+    static_assert (   (T(1) >= o2), "" ); // equal
+    static_assert (  !(T(1) >= o3), "" );
+    static_assert (   (val  >= o2), "" );
+    static_assert (   (val  >= o3), "" ); // equal
+    static_assert (   (T(3) >= o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp
index bcf6afc..05ac5eb 100644
--- a/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/less_equal.pass.cpp
@@ -10,57 +10,46 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator<=(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator<=(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator<=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator<=(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator<=(const X& lhs, const X& rhs) {
-  return lhs.i_ <= rhs.i_;
-}
+constexpr bool operator <= ( const X &lhs, const X &rhs )
+    { return lhs.i_ <= rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert((o1 <= T(1)), "");
-    static_assert((o2 <= T(1)), ""); // equal
-    static_assert(!(o3 <= T(1)), "");
-    static_assert((o2 <= val), "");
-    static_assert((o3 <= val), ""); // equal
-    static_assert((o3 <= T(3)), "");
+    static_assert (  (o1 <= T(1)), "" );
+    static_assert (  (o2 <= T(1)), "" );  // equal
+    static_assert ( !(o3 <= T(1)), "" );
+    static_assert (  (o2 <=  val), "" );
+    static_assert (  (o3 <=  val), "" );  // equal
+    static_assert (  (o3 <= T(3)), "" );
 
-    static_assert(!(T(1) <= o1), "");
-    static_assert((T(1) <= o2), ""); // equal
-    static_assert((T(1) <= o3), "");
-    static_assert(!(val <= o2), "");
-    static_assert((val <= o3), ""); // equal
-    static_assert(!(T(3) <= o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 <= 42l, "");
-    static_assert(!(101l <= o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 <= 42, "");
-    static_assert(!(101 <= o1), "");
-  }
+    static_assert (  !(T(1) <= o1), "" );
+    static_assert (   (T(1) <= o2), "" ); // equal
+    static_assert (   (T(1) <= o3), "" );
+    static_assert (  !(val  <= o2), "" );
+    static_assert (   (val  <= o3), "" ); // equal
+    static_assert (  !(T(3) <= o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp
index 3d5e214..d1891a2 100644
--- a/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/less_than.pass.cpp
@@ -10,55 +10,46 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator<(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator<(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator<(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator<(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator<(const X& lhs, const X& rhs) { return lhs.i_ < rhs.i_; }
+constexpr bool operator < ( const X &lhs, const X &rhs )
+    { return lhs.i_ < rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert((o1 < T(1)), "");
-    static_assert(!(o2 < T(1)), ""); // equal
-    static_assert(!(o3 < T(1)), "");
-    static_assert((o2 < val), "");
-    static_assert(!(o3 < val), ""); // equal
-    static_assert((o3 < T(3)), "");
+    static_assert (  (o1 < T(1)), "" );
+    static_assert ( !(o2 < T(1)), "" );  // equal
+    static_assert ( !(o3 < T(1)), "" );
+    static_assert (  (o2 <  val), "" );
+    static_assert ( !(o3 <  val), "" );  // equal
+    static_assert (  (o3 < T(3)), "" );
 
-    static_assert(!(T(1) < o1), "");
-    static_assert(!(T(1) < o2), ""); // equal
-    static_assert((T(1) < o3), "");
-    static_assert(!(val < o2), "");
-    static_assert(!(val < o3), ""); // equal
-    static_assert(!(T(3) < o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 < 101l, "");
-    static_assert(!(42l < o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 < 101, "");
-    static_assert(!(42 < o1), "");
-  }
+    static_assert (  !(T(1) < o1), "" );
+    static_assert (  !(T(1) < o2), "" ); // equal
+    static_assert (   (T(1) < o3), "" );
+    static_assert (  !(val  < o2), "" );
+    static_assert (  !(val  < o3), "" ); // equal
+    static_assert (  !(T(3) < o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp
index 7da9b7b..ae2ff80 100644
--- a/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.comp_with_t/not_equal.pass.cpp
@@ -10,55 +10,44 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator!=(const optional<T>& x, const U& v);
-// template <class T, class U> constexpr bool operator!=(const U& v, const optional<T>& x);
+// template <class T> constexpr bool operator!=(const optional<T>& x, const T& v);
+// template <class T> constexpr bool operator!=(const T& v, const optional<T>& x);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator!=(const X& lhs, const X& rhs) {
-  return lhs.i_ != rhs.i_;
-}
+constexpr bool operator != ( const X &lhs, const X &rhs )
+    { return lhs.i_ != rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
     constexpr T val(2);
-    constexpr O o1;      // disengaged
-    constexpr O o2{1};   // engaged
-    constexpr O o3{val}; // engaged
+    constexpr O o1;       // disengaged
+    constexpr O o2{1};    // engaged
+    constexpr O o3{val};  // engaged
 
-    static_assert((o1 != T(1)), "");
-    static_assert(!(o2 != T(1)), "");
-    static_assert((o3 != T(1)), "");
-    static_assert(!(o3 != T(2)), "");
-    static_assert(!(o3 != val), "");
+    static_assert (  (o1 != T(1)), "" );
+    static_assert ( !(o2 != T(1)), "" );
+    static_assert (  (o3 != T(1)), "" );
+    static_assert ( !(o3 != T(2)), "" );
+    static_assert ( !(o3 != val),  "" );
 
-    static_assert((T(1) != o1), "");
-    static_assert(!(T(1) != o2), "");
-    static_assert((T(1) != o3), "");
-    static_assert(!(T(2) != o3), "");
-    static_assert(!(val != o3), "");
-  }
-  {
-    using O = optional<int>;
-    constexpr O o1(42);
-    static_assert(o1 != 101l, "");
-    static_assert(!(42l != o1), "");
-  }
-  {
-    using O = optional<const int>;
-    constexpr O o1(42);
-    static_assert(o1 != 101, "");
-    static_assert(!(42 != o1), "");
-  }
+    static_assert (  (T(1) != o1), "" );
+    static_assert ( !(T(1) != o2), "" );
+    static_assert (  (T(1) != o3), "" );
+    static_assert ( !(T(2) != o3), "" );
+    static_assert ( !(val  != o3), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.hash/hash.pass.cpp b/test/std/utilities/optional/optional.hash/hash.pass.cpp
index b4a1832..ea89dc3 100644
--- a/test/std/utilities/optional/optional.hash/hash.pass.cpp
+++ b/test/std/utilities/optional/optional.hash/hash.pass.cpp
@@ -22,28 +22,17 @@
 struct A {};
 struct B {};
 
-namespace std {
-
 template <>
-struct hash<B> {
-  size_t operator()(B const&) TEST_NOEXCEPT_FALSE { return 0; }
+struct std::hash<B> {
+  size_t operator()(B const&) { return 0; }
 };
 
-}
-
 int main()
 {
     using std::optional;
     const std::size_t nullopt_hash =
         std::hash<optional<double>>{}(optional<double>{});
 
-
-    {
-        optional<B> opt;
-        ASSERT_NOT_NOEXCEPT(std::hash<optional<B>>()(opt));
-        ASSERT_NOT_NOEXCEPT(std::hash<optional<const B>>()(opt));
-    }
-
     {
         typedef int T;
         optional<T> opt;
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp
index 0fcc52b..1207e24 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/assign_value.pass.cpp
@@ -216,6 +216,7 @@
 #ifndef TEST_HAS_NO_EXCEPTIONS
     using T = ThrowAssign;
     {
+        using T = ThrowAssign;
         optional<T> opt;
         try {
             opt = 42;
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
index e7f59f1..b536258 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -10,7 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class... Args> T& optional<T>::emplace(Args&&... args);
+// template <class... Args> void optional<T>::emplace(Args&&... args);
 
 #include <optional>
 #include <type_traits>
@@ -51,35 +51,27 @@
     using Opt = std::optional<T>;
     {
         Opt opt;
-        auto & v = opt.emplace();
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace();
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(0));
-        assert(&v == &*opt);
     }
     {
         Opt opt;
-        auto & v = opt.emplace(1);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(1));
-        assert(&v == &*opt);
     }
     {
         Opt opt(2);
-        auto & v = opt.emplace();
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace();
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(0));
-        assert(&v == &*opt);
     }
     {
         Opt opt(2);
-        auto & v = opt.emplace(1);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(1));
-        assert(&v == &*opt);
     }
 }
 
@@ -91,26 +83,20 @@
     using Opt = std::optional<T>;
     {
         Opt opt;
-        auto &v = opt.emplace(101, 41);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(101, 41);
         assert(static_cast<bool>(opt) == true);
-        assert(   v == T(101, 41));
         assert(*opt == T(101, 41));
     }
     {
         Opt opt;
-        auto &v = opt.emplace({1, 2, 3, 4});
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace({1, 2, 3, 4});
         assert(static_cast<bool>(opt) == true);
-        assert(  v == T(4)); // T sets its value to the size of the init list
-        assert(*opt == T(4));
+        assert(*opt == T(4)); // T sets its value to the size of the init list
     }
     {
         Opt opt;
-        auto &v = opt.emplace({1, 2, 3, 4, 5}, 6);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace({1, 2, 3, 4, 5}, 6);
         assert(static_cast<bool>(opt) == true);
-        assert(  v == T(5)); // T sets its value to the size of the init list
         assert(*opt == T(5)); // T sets its value to the size of the init list
     }
 }
@@ -123,87 +109,73 @@
     assert(T::alive == 0);
     {
         T::reset_constructors();
-        auto &v = opt.emplace();
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace();
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::default_constructed == 1);
         assert(T::destroyed == 0);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T());
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace();
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace();
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::default_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T());
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace(101);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(101);
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::value_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(101));
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace(-10, 99);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(-10, 99);
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::value_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(-10, 99));
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace(-10, 99);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace(-10, 99);
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::value_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(-10, 99));
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace({-10, 99, 42, 1});
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace({-10, 99, 42, 1});
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::value_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(4)); // size of the initializer list
-        assert(&v == &*opt);
     }
     {
         T::reset_constructors();
-        auto &v = opt.emplace({-10, 99, 42, 1}, 42);
-        static_assert( std::is_same_v<T&, decltype(v)>, "" );
+        opt.emplace({-10, 99, 42, 1}, 42);
         assert(T::alive == 1);
         assert(T::constructed == 1);
         assert(T::value_constructed == 1);
         assert(T::destroyed == 1);
         assert(static_cast<bool>(opt) == true);
         assert(*opt == T(4)); // size of the initializer list
-        assert(&v == &*opt);
     }
 }
 
@@ -238,10 +210,8 @@
     }
     {
         optional<const int> opt;
-        auto &v = opt.emplace(42);
-        static_assert( std::is_same_v<const int&, decltype(v)>, "" );
+        opt.emplace(42);
         assert(*opt == 42);
-        assert(   v == 42);
         opt.emplace();
         assert(*opt == 0);
     }
@@ -254,9 +224,7 @@
         {
             assert(static_cast<bool>(opt) == true);
             assert(Y::dtor_called == false);
-            auto &v = opt.emplace(1);
-            static_assert( std::is_same_v<Y&, decltype(v)>, "" );
-            assert(false);
+            opt.emplace(1);
         }
         catch (int i)
         {
diff --git a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
index f6959c7..1c3c69a 100644
--- a/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -11,7 +11,7 @@
 // <optional>
 
 // template <class U, class... Args>
-//   T& optional<T>::emplace(initializer_list<U> il, Args&&... args);
+//   void optional<T>::emplace(initializer_list<U> il, Args&&... args);
 
 #include <optional>
 #include <type_traits>
@@ -76,27 +76,21 @@
         X x;
         optional<X> opt(x);
         assert(X::dtor_called == false);
-        auto &v = opt.emplace({1, 2});
-        static_assert( std::is_same_v<X&, decltype(v)>, "" );
+        opt.emplace({1, 2});
         assert(X::dtor_called == true);
         assert(*opt == X({1, 2}));
-        assert(&v == &*opt);
     }
     {
         optional<std::vector<int>> opt;
-        auto &v = opt.emplace({1, 2, 3}, std::allocator<int>());
-        static_assert( std::is_same_v<std::vector<int>&, decltype(v)>, "" );
+        opt.emplace({1, 2, 3}, std::allocator<int>());
         assert(static_cast<bool>(opt) == true);
         assert(*opt == std::vector<int>({1, 2, 3}));
-        assert(&v == &*opt);
     }
     {
         optional<Y> opt;
-        auto &v = opt.emplace({1, 2});
-        static_assert( std::is_same_v<Y&, decltype(v)>, "" );
+        opt.emplace({1, 2});
         assert(static_cast<bool>(opt) == true);
         assert(*opt == Y({1, 2}));
-        assert(&v == &*opt);
     }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
@@ -106,9 +100,7 @@
         {
             assert(static_cast<bool>(opt) == true);
             assert(Z::dtor_called == false);
-            auto &v = opt.emplace({1, 2});
-            static_assert( std::is_same_v<Z&, decltype(v)>, "" );
-            assert(false);
+            opt.emplace({1, 2});
         }
         catch (int i)
         {
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
index e4e4a97..4020d70 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/U.pass.cpp
@@ -9,13 +9,6 @@
 //
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // template <class U>
@@ -42,11 +35,6 @@
     constexpr explicit ExplicitThrow(int x) { if (x != -1) TEST_THROW(6);}
 };
 
-struct ImplicitAny {
-  template <class U>
-  constexpr ImplicitAny(U&&) {}
-};
-
 
 template <class To, class From>
 constexpr bool implicit_conversion(optional<To>&& opt, const From& v)
@@ -91,15 +79,6 @@
         using T = TestTypes::TestType;
         assert(implicit_conversion<T>(3, T(3)));
     }
-  {
-    using O = optional<ImplicitAny>;
-    static_assert(!test_convertible<O, std::in_place_t>(), "");
-    static_assert(!test_convertible<O, std::in_place_t&>(), "");
-    static_assert(!test_convertible<O, const std::in_place_t&>(), "");
-    static_assert(!test_convertible<O, std::in_place_t&&>(), "");
-    static_assert(!test_convertible<O, const std::in_place_t&&>(), "");
-
-  }
 #ifndef TEST_HAS_NO_EXCEPTIONS
     {
         try {
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
index e9e98c0..34a12b8 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/const_T.pass.cpp
@@ -9,13 +9,6 @@
 //
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // constexpr optional(const T& v);
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/copy.fail.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/copy.fail.cpp
deleted file mode 100644
index 3224c1b..0000000
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/copy.fail.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// <optional>
-
-// constexpr optional(const optional<T>& rhs);
-//   If is_trivially_copy_constructible_v<T> is true,
-//    this constructor shall be a constexpr constructor.
-
-#include <optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct S {
-	constexpr S()   : v_(0) {}
-	S(int v)        : v_(v) {}
-	S(const S &rhs) : v_(rhs.v_) {}  // make it not trivially copyable
-	int v_;
-	};
-
-
-int main()
-{
-    static_assert (!std::is_trivially_copy_constructible_v<S>, "" );
-    constexpr std::optional<S> o1;
-    constexpr std::optional<S> o2 = o1;  // not constexpr
-}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
index 6b4283a..5906d4e 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/copy.pass.cpp
@@ -10,7 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// constexpr optional(const optional<T>& rhs);
+// optional(const optional<T>& rhs);
 
 #include <optional>
 #include <type_traits>
@@ -32,16 +32,6 @@
         assert(*lhs == *rhs);
 }
 
-template <class T, class ...InitArgs>
-constexpr bool constexpr_test(InitArgs&&... args)
-{
-    static_assert( std::is_trivially_copy_constructible_v<T>, ""); // requirement
-    const optional<T> rhs(std::forward<InitArgs>(args)...);
-    optional<T> lhs = rhs;
-    return (lhs.has_value() == rhs.has_value()) &&
-           (lhs.has_value() ? *lhs == *rhs : true);
-}
-
 void test_throwing_ctor() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
     struct Z {
@@ -118,9 +108,6 @@
 {
     test<int>();
     test<int>(3);
-    static_assert(constexpr_test<int>(), "" );
-    static_assert(constexpr_test<int>(3), "" );
-
     {
         const optional<const int> o(42);
         optional<const int> o2(o);
@@ -165,9 +152,4 @@
     {
         test_reference_extension();
     }
-    {
-    constexpr std::optional<int> o1{4};
-    constexpr std::optional<int> o2 = o1;
-    static_assert( *o2 == 4, "" );
-    }
 }
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
deleted file mode 100644
index fb2e139..0000000
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/move.fail.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03, c++11, c++14
-// <optional>
-
-// constexpr optional(const optional<T>&& rhs);
-//   If is_trivially_move_constructible_v<T> is true,
-//    this constructor shall be a constexpr constructor.
-
-#include <optional>
-#include <type_traits>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct S {
-	constexpr S()   : v_(0) {}
-	S(int v)        : v_(v) {}
-	constexpr S(const S  &rhs) : v_(rhs.v_) {} // not trivially moveable
-	constexpr S(const S &&rhs) : v_(rhs.v_) {} // not trivially moveable
-	int v_;
-	};
-
-
-int main()
-{
-    static_assert (!std::is_trivially_move_constructible_v<S>, "" );
-    constexpr std::optional<S> o1;
-    constexpr std::optional<S> o2 = std::move(o1);  // not constexpr
-}
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
index 82acdd9..bff6f5b 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/move.pass.cpp
@@ -8,17 +8,9 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
-// constexpr optional(optional<T>&& rhs);
+// optional(optional<T>&& rhs);
 
 #include <optional>
 #include <type_traits>
@@ -41,17 +33,6 @@
         assert(*lhs == *orig);
 }
 
-template <class T, class ...InitArgs>
-constexpr bool constexpr_test(InitArgs&&... args)
-{
-    static_assert( std::is_trivially_copy_constructible_v<T>, ""); // requirement
-    const optional<T> orig(std::forward<InitArgs>(args)...);
-    optional<T> rhs(orig);
-    optional<T> lhs = std::move(rhs);
-    return (lhs.has_value() == orig.has_value()) &&
-           (lhs.has_value() ? *lhs == *orig : true);
-}
-
 void test_throwing_ctor() {
 #ifndef TEST_HAS_NO_EXCEPTIONS
     struct Z {
@@ -155,9 +136,6 @@
 {
     test<int>();
     test<int>(3);
-    static_assert(constexpr_test<int>(), "" );
-    static_assert(constexpr_test<int>(3), "" );
-	
     {
         optional<const int> o(42);
         optional<const int> o2(std::move(o));
@@ -220,9 +198,4 @@
     {
         test_reference_extension();
     }
-    {
-    constexpr std::optional<int> o1{4};
-    constexpr std::optional<int> o2 = std::move(o1);
-    static_assert( *o2 == 4, "" );
-    }
 }
diff --git a/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
index 761cbee..eee749d 100644
--- a/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.ctor/rvalue_T.pass.cpp
@@ -9,13 +9,6 @@
 //
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // constexpr optional(T&& v);
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
index 44e6e73..516a79d 100644
--- a/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value.pass.cpp
@@ -8,14 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // constexpr T& optional<T>::value() &;
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
index e2d48ec..d4038e4 100644
--- a/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const.pass.cpp
@@ -8,14 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // constexpr const T& optional<T>::value() const &;
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
index 874a544..e189d3a 100644
--- a/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_const_rvalue.pass.cpp
@@ -8,14 +8,6 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <optional>
 
 // constexpr const T& optional<T>::value() const &&;
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp
index f94dcab..c219e97 100644
--- a/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_or.pass.cpp
@@ -10,7 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class U> constexpr T optional<T>::value_or(U&& v) &&;
+// template <class U> T optional<T>::value_or(U&& v) &&;
 
 #include <optional>
 #include <type_traits>
@@ -26,22 +26,22 @@
 {
     int i_;
 
-    constexpr Y(int i) : i_(i) {}
+    Y(int i) : i_(i) {}
 };
 
 struct X
 {
     int i_;
 
-    constexpr X(int i) : i_(i) {}
-    constexpr X(X&& x) : i_(x.i_) {x.i_ = 0;}
-    constexpr X(const Y& y) : i_(y.i_) {}
-    constexpr X(Y&& y) : i_(y.i_+1) {}
+    X(int i) : i_(i) {}
+    X(X&& x) : i_(x.i_) {x.i_ = 0;}
+    X(const Y& y) : i_(y.i_) {}
+    X(Y&& y) : i_(y.i_+1) {}
     friend constexpr bool operator==(const X& x, const X& y)
         {return x.i_ == y.i_;}
 };
 
-constexpr int test()
+int main()
 {
     {
         optional<X> opt(in_place, 2);
@@ -65,10 +65,4 @@
         assert(std::move(opt).value_or(Y(3)) == 4);
         assert(!opt);
     }
-    return 0;
-}
-
-int main()
-{
-    static_assert(test() == 0);
 }
diff --git a/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
index 60cab7d..2ef485b 100644
--- a/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
+++ b/test/std/utilities/optional/optional.object/optional.object.observe/value_rvalue.pass.cpp
@@ -10,13 +10,6 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // constexpr T& optional<T>::value() &&;
 
 #include <optional>
diff --git a/test/std/utilities/optional/optional.relops/equal.pass.cpp b/test/std/utilities/optional/optional.relops/equal.pass.cpp
index 0752841..6650b67 100644
--- a/test/std/utilities/optional/optional.relops/equal.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/equal.pass.cpp
@@ -10,7 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator==(const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 #include <type_traits>
@@ -18,69 +18,57 @@
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator==(const X& lhs, const X& rhs) {
-  return lhs.i_ == rhs.i_;
-}
+constexpr bool operator == ( const X &lhs, const X &rhs )
+    { return lhs.i_ == rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert(o1 == o1, "");
-    static_assert(o1 == o2, "");
-    static_assert(!(o1 == o3), "");
-    static_assert(!(o1 == o4), "");
-    static_assert(!(o1 == o5), "");
+    static_assert (   o1 == o1 , "" );
+    static_assert (   o1 == o2 , "" );
+    static_assert ( !(o1 == o3), "" );
+    static_assert ( !(o1 == o4), "" );
+    static_assert ( !(o1 == o5), "" );
 
-    static_assert(o2 == o1, "");
-    static_assert(o2 == o2, "");
-    static_assert(!(o2 == o3), "");
-    static_assert(!(o2 == o4), "");
-    static_assert(!(o2 == o5), "");
+    static_assert (   o2 == o1 , "" );
+    static_assert (   o2 == o2 , "" );
+    static_assert ( !(o2 == o3), "" );
+    static_assert ( !(o2 == o4), "" );
+    static_assert ( !(o2 == o5), "" );
 
-    static_assert(!(o3 == o1), "");
-    static_assert(!(o3 == o2), "");
-    static_assert(o3 == o3, "");
-    static_assert(!(o3 == o4), "");
-    static_assert(o3 == o5, "");
+    static_assert ( !(o3 == o1), "" );
+    static_assert ( !(o3 == o2), "" );
+    static_assert (   o3 == o3 , "" );
+    static_assert ( !(o3 == o4), "" );
+    static_assert (   o3 == o5 , "" );
 
-    static_assert(!(o4 == o1), "");
-    static_assert(!(o4 == o2), "");
-    static_assert(!(o4 == o3), "");
-    static_assert(o4 == o4, "");
-    static_assert(!(o4 == o5), "");
+    static_assert ( !(o4 == o1), "" );
+    static_assert ( !(o4 == o2), "" );
+    static_assert ( !(o4 == o3), "" );
+    static_assert (   o4 == o4 , "" );
+    static_assert ( !(o4 == o5), "" );
 
-    static_assert(!(o5 == o1), "");
-    static_assert(!(o5 == o2), "");
-    static_assert(o5 == o3, "");
-    static_assert(!(o5 == o4), "");
-    static_assert(o5 == o5, "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 == O2(42), "");
-    static_assert(!(O2(101) == o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 == O2(42), "");
-    static_assert(!(O2(101) == o1), "");
-  }
+    static_assert ( !(o5 == o1), "" );
+    static_assert ( !(o5 == o2), "" );
+    static_assert (   o5 == o3 , "" );
+    static_assert ( !(o5 == o4), "" );
+    static_assert (   o5 == o5 , "" );
+
+    }
 }
diff --git a/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp
index f475f37..f9b3044 100644
--- a/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/greater_equal.pass.cpp
@@ -10,74 +10,61 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator>= (const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator>=(const X& lhs, const X& rhs) {
-  return lhs.i_ >= rhs.i_;
-}
+constexpr bool operator >= ( const X &lhs, const X &rhs )
+    { return lhs.i_ >= rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef optional<X> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert((o1 >= o1), "");
-    static_assert((o1 >= o2), "");
-    static_assert(!(o1 >= o3), "");
-    static_assert(!(o1 >= o4), "");
-    static_assert(!(o1 >= o5), "");
+    static_assert (  (o1 >= o1), "" );
+    static_assert (  (o1 >= o2), "" );
+    static_assert ( !(o1 >= o3), "" );
+    static_assert ( !(o1 >= o4), "" );
+    static_assert ( !(o1 >= o5), "" );
 
-    static_assert((o2 >= o1), "");
-    static_assert((o2 >= o2), "");
-    static_assert(!(o2 >= o3), "");
-    static_assert(!(o2 >= o4), "");
-    static_assert(!(o2 >= o5), "");
+    static_assert (  (o2 >= o1), "" );
+    static_assert (  (o2 >= o2), "" );
+    static_assert ( !(o2 >= o3), "" );
+    static_assert ( !(o2 >= o4), "" );
+    static_assert ( !(o2 >= o5), "" );
 
-    static_assert((o3 >= o1), "");
-    static_assert((o3 >= o2), "");
-    static_assert((o3 >= o3), "");
-    static_assert(!(o3 >= o4), "");
-    static_assert((o3 >= o5), "");
+    static_assert (  (o3 >= o1), "" );
+    static_assert (  (o3 >= o2), "" );
+    static_assert (  (o3 >= o3), "" );
+    static_assert ( !(o3 >= o4), "" );
+    static_assert (  (o3 >= o5), "" );
 
-    static_assert((o4 >= o1), "");
-    static_assert((o4 >= o2), "");
-    static_assert((o4 >= o3), "");
-    static_assert((o4 >= o4), "");
-    static_assert((o4 >= o5), "");
+    static_assert (  (o4 >= o1), "" );
+    static_assert (  (o4 >= o2), "" );
+    static_assert (  (o4 >= o3), "" );
+    static_assert (  (o4 >= o4), "" );
+    static_assert (  (o4 >= o5), "" );
 
-    static_assert((o5 >= o1), "");
-    static_assert((o5 >= o2), "");
-    static_assert((o5 >= o3), "");
-    static_assert(!(o5 >= o4), "");
-    static_assert((o5 >= o5), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 >= O2(42), "");
-    static_assert(!(O2(11) >= o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 >= O2(42), "");
-    static_assert(!(O2(1) >= o1), "");
-  }
+    static_assert (  (o5 >= o1), "" );
+    static_assert (  (o5 >= o2), "" );
+    static_assert (  (o5 >= o3), "" );
+    static_assert ( !(o5 >= o4), "" );
+    static_assert (  (o5 >= o5), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.relops/greater_than.pass.cpp b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp
index c3f2af9..8a27eb4 100644
--- a/test/std/utilities/optional/optional.relops/greater_than.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/greater_than.pass.cpp
@@ -10,72 +10,61 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator> (const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator>(const X& lhs, const X& rhs) { return lhs.i_ > rhs.i_; }
+constexpr bool operator > ( const X &lhs, const X &rhs )
+    { return lhs.i_ > rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef optional<X> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert(!(o1 > o1), "");
-    static_assert(!(o1 > o2), "");
-    static_assert(!(o1 > o3), "");
-    static_assert(!(o1 > o4), "");
-    static_assert(!(o1 > o5), "");
+    static_assert ( !(o1 > o1), "" );
+    static_assert ( !(o1 > o2), "" );
+    static_assert ( !(o1 > o3), "" );
+    static_assert ( !(o1 > o4), "" );
+    static_assert ( !(o1 > o5), "" );
 
-    static_assert(!(o2 > o1), "");
-    static_assert(!(o2 > o2), "");
-    static_assert(!(o2 > o3), "");
-    static_assert(!(o2 > o4), "");
-    static_assert(!(o2 > o5), "");
+    static_assert ( !(o2 > o1), "" );
+    static_assert ( !(o2 > o2), "" );
+    static_assert ( !(o2 > o3), "" );
+    static_assert ( !(o2 > o4), "" );
+    static_assert ( !(o2 > o5), "" );
 
-    static_assert((o3 > o1), "");
-    static_assert((o3 > o2), "");
-    static_assert(!(o3 > o3), "");
-    static_assert(!(o3 > o4), "");
-    static_assert(!(o3 > o5), "");
+    static_assert (  (o3 > o1), "" );
+    static_assert (  (o3 > o2), "" );
+    static_assert ( !(o3 > o3), "" );
+    static_assert ( !(o3 > o4), "" );
+    static_assert ( !(o3 > o5), "" );
 
-    static_assert((o4 > o1), "");
-    static_assert((o4 > o2), "");
-    static_assert((o4 > o3), "");
-    static_assert(!(o4 > o4), "");
-    static_assert((o4 > o5), "");
+    static_assert (  (o4 > o1), "" );
+    static_assert (  (o4 > o2), "" );
+    static_assert (  (o4 > o3), "" );
+    static_assert ( !(o4 > o4), "" );
+    static_assert (  (o4 > o5), "" );
 
-    static_assert((o5 > o1), "");
-    static_assert((o5 > o2), "");
-    static_assert(!(o5 > o3), "");
-    static_assert(!(o5 > o4), "");
-    static_assert(!(o5 > o5), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 > O2(1), "");
-    static_assert(!(O2(42) > o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 > O2(1), "");
-    static_assert(!(O2(42) > o1), "");
-  }
+    static_assert (  (o5 > o1), "" );
+    static_assert (  (o5 > o2), "" );
+    static_assert ( !(o5 > o3), "" );
+    static_assert ( !(o5 > o4), "" );
+    static_assert ( !(o5 > o5), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.relops/less_equal.pass.cpp b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp
index 35e80d3..a7d594d 100644
--- a/test/std/utilities/optional/optional.relops/less_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/less_equal.pass.cpp
@@ -10,74 +10,61 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator<= (const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator<=(const X& lhs, const X& rhs) {
-  return lhs.i_ <= rhs.i_;
-}
+constexpr bool operator <= ( const X &lhs, const X &rhs )
+    { return lhs.i_ <= rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef optional<X> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert((o1 <= o1), "");
-    static_assert((o1 <= o2), "");
-    static_assert((o1 <= o3), "");
-    static_assert((o1 <= o4), "");
-    static_assert((o1 <= o5), "");
+    static_assert (  (o1 <= o1), "" );
+    static_assert (  (o1 <= o2), "" );
+    static_assert (  (o1 <= o3), "" );
+    static_assert (  (o1 <= o4), "" );
+    static_assert (  (o1 <= o5), "" );
 
-    static_assert((o2 <= o1), "");
-    static_assert((o2 <= o2), "");
-    static_assert((o2 <= o3), "");
-    static_assert((o2 <= o4), "");
-    static_assert((o2 <= o5), "");
+    static_assert (  (o2 <= o1), "" );
+    static_assert (  (o2 <= o2), "" );
+    static_assert (  (o2 <= o3), "" );
+    static_assert (  (o2 <= o4), "" );
+    static_assert (  (o2 <= o5), "" );
 
-    static_assert(!(o3 <= o1), "");
-    static_assert(!(o3 <= o2), "");
-    static_assert((o3 <= o3), "");
-    static_assert((o3 <= o4), "");
-    static_assert((o3 <= o5), "");
+    static_assert ( !(o3 <= o1), "" );
+    static_assert ( !(o3 <= o2), "" );
+    static_assert (  (o3 <= o3), "" );
+    static_assert (  (o3 <= o4), "" );
+    static_assert (  (o3 <= o5), "" );
 
-    static_assert(!(o4 <= o1), "");
-    static_assert(!(o4 <= o2), "");
-    static_assert(!(o4 <= o3), "");
-    static_assert((o4 <= o4), "");
-    static_assert(!(o4 <= o5), "");
+    static_assert ( !(o4 <= o1), "" );
+    static_assert ( !(o4 <= o2), "" );
+    static_assert ( !(o4 <= o3), "" );
+    static_assert (  (o4 <= o4), "" );
+    static_assert ( !(o4 <= o5), "" );
 
-    static_assert(!(o5 <= o1), "");
-    static_assert(!(o5 <= o2), "");
-    static_assert((o5 <= o3), "");
-    static_assert((o5 <= o4), "");
-    static_assert((o5 <= o5), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 <= O2(42), "");
-    static_assert(!(O2(101) <= o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 <= O2(42), "");
-    static_assert(!(O2(101) <= o1), "");
-  }
+    static_assert ( !(o5 <= o1), "" );
+    static_assert ( !(o5 <= o2), "" );
+    static_assert (  (o5 <= o3), "" );
+    static_assert (  (o5 <= o4), "" );
+    static_assert (  (o5 <= o5), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.relops/less_than.pass.cpp b/test/std/utilities/optional/optional.relops/less_than.pass.cpp
index 1dbffbd..deffa5e 100644
--- a/test/std/utilities/optional/optional.relops/less_than.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/less_than.pass.cpp
@@ -10,72 +10,61 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator< (const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator<(const X& lhs, const X& rhs) { return lhs.i_ < rhs.i_; }
+constexpr bool operator < ( const X &lhs, const X &rhs )
+    { return lhs.i_ < rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef optional<X> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert(!(o1 < o1), "");
-    static_assert(!(o1 < o2), "");
-    static_assert((o1 < o3), "");
-    static_assert((o1 < o4), "");
-    static_assert((o1 < o5), "");
+    static_assert ( !(o1 < o1), "" );
+    static_assert ( !(o1 < o2), "" );
+    static_assert (  (o1 < o3), "" );
+    static_assert (  (o1 < o4), "" );
+    static_assert (  (o1 < o5), "" );
 
-    static_assert(!(o2 < o1), "");
-    static_assert(!(o2 < o2), "");
-    static_assert((o2 < o3), "");
-    static_assert((o2 < o4), "");
-    static_assert((o2 < o5), "");
+    static_assert ( !(o2 < o1), "" );
+    static_assert ( !(o2 < o2), "" );
+    static_assert (  (o2 < o3), "" );
+    static_assert (  (o2 < o4), "" );
+    static_assert (  (o2 < o5), "" );
 
-    static_assert(!(o3 < o1), "");
-    static_assert(!(o3 < o2), "");
-    static_assert(!(o3 < o3), "");
-    static_assert((o3 < o4), "");
-    static_assert(!(o3 < o5), "");
+    static_assert ( !(o3 < o1), "" );
+    static_assert ( !(o3 < o2), "" );
+    static_assert ( !(o3 < o3), "" );
+    static_assert (  (o3 < o4), "" );
+    static_assert ( !(o3 < o5), "" );
 
-    static_assert(!(o4 < o1), "");
-    static_assert(!(o4 < o2), "");
-    static_assert(!(o4 < o3), "");
-    static_assert(!(o4 < o4), "");
-    static_assert(!(o4 < o5), "");
+    static_assert ( !(o4 < o1), "" );
+    static_assert ( !(o4 < o2), "" );
+    static_assert ( !(o4 < o3), "" );
+    static_assert ( !(o4 < o4), "" );
+    static_assert ( !(o4 < o5), "" );
 
-    static_assert(!(o5 < o1), "");
-    static_assert(!(o5 < o2), "");
-    static_assert(!(o5 < o3), "");
-    static_assert((o5 < o4), "");
-    static_assert(!(o5 < o5), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 < O2(101), "");
-    static_assert(!(O2(101) < o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 < O2(101), "");
-    static_assert(!(O2(101) < o1), "");
-  }
+    static_assert ( !(o5 < o1), "" );
+    static_assert ( !(o5 < o2), "" );
+    static_assert ( !(o5 < o3), "" );
+    static_assert (  (o5 < o4), "" );
+    static_assert ( !(o5 < o5), "" );
+    }
 }
diff --git a/test/std/utilities/optional/optional.relops/not_equal.pass.cpp b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp
index 12d9922..fd11b2a 100644
--- a/test/std/utilities/optional/optional.relops/not_equal.pass.cpp
+++ b/test/std/utilities/optional/optional.relops/not_equal.pass.cpp
@@ -10,7 +10,7 @@
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 // <optional>
 
-// template <class T, class U> constexpr bool operator!=(const optional<T>& x, const optional<U>& y);
+// template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y);
 
 #include <optional>
 #include <type_traits>
@@ -18,69 +18,57 @@
 
 using std::optional;
 
-struct X {
-  int i_;
+struct X
+{
+    int i_;
 
-  constexpr X(int i) : i_(i) {}
+    constexpr X(int i) : i_(i) {}
 };
 
-constexpr bool operator!=(const X& lhs, const X& rhs) {
-  return lhs.i_ != rhs.i_;
-}
+constexpr bool operator != ( const X &lhs, const X &rhs )
+    { return lhs.i_ != rhs.i_ ; }
 
-int main() {
-  {
+int main()
+{
+    {
     typedef X T;
     typedef optional<T> O;
 
-    constexpr O o1;    // disengaged
-    constexpr O o2;    // disengaged
-    constexpr O o3{1}; // engaged
-    constexpr O o4{2}; // engaged
-    constexpr O o5{1}; // engaged
+    constexpr O o1;     // disengaged
+    constexpr O o2;     // disengaged
+    constexpr O o3{1};  // engaged
+    constexpr O o4{2};  // engaged
+    constexpr O o5{1};  // engaged
 
-    static_assert(!(o1 != o1), "");
-    static_assert(!(o1 != o2), "");
-    static_assert((o1 != o3), "");
-    static_assert((o1 != o4), "");
-    static_assert((o1 != o5), "");
+    static_assert ( !(o1 != o1), "" );
+    static_assert ( !(o1 != o2), "" );
+    static_assert (  (o1 != o3), "" );
+    static_assert (  (o1 != o4), "" );
+    static_assert (  (o1 != o5), "" );
 
-    static_assert(!(o2 != o1), "");
-    static_assert(!(o2 != o2), "");
-    static_assert((o2 != o3), "");
-    static_assert((o2 != o4), "");
-    static_assert((o2 != o5), "");
+    static_assert ( !(o2 != o1), "" );
+    static_assert ( !(o2 != o2), "" );
+    static_assert (  (o2 != o3), "" );
+    static_assert (  (o2 != o4), "" );
+    static_assert (  (o2 != o5), "" );
 
-    static_assert((o3 != o1), "");
-    static_assert((o3 != o2), "");
-    static_assert(!(o3 != o3), "");
-    static_assert((o3 != o4), "");
-    static_assert(!(o3 != o5), "");
+    static_assert (  (o3 != o1), "" );
+    static_assert (  (o3 != o2), "" );
+    static_assert ( !(o3 != o3), "" );
+    static_assert (  (o3 != o4), "" );
+    static_assert ( !(o3 != o5), "" );
 
-    static_assert((o4 != o1), "");
-    static_assert((o4 != o2), "");
-    static_assert((o4 != o3), "");
-    static_assert(!(o4 != o4), "");
-    static_assert((o4 != o5), "");
+    static_assert (  (o4 != o1), "" );
+    static_assert (  (o4 != o2), "" );
+    static_assert (  (o4 != o3), "" );
+    static_assert ( !(o4 != o4), "" );
+    static_assert (  (o4 != o5), "" );
 
-    static_assert((o5 != o1), "");
-    static_assert((o5 != o2), "");
-    static_assert(!(o5 != o3), "");
-    static_assert((o5 != o4), "");
-    static_assert(!(o5 != o5), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<long>;
-    constexpr O1 o1(42);
-    static_assert(o1 != O2(101), "");
-    static_assert(!(O2(42) != o1), "");
-  }
-  {
-    using O1 = optional<int>;
-    using O2 = optional<const int>;
-    constexpr O1 o1(42);
-    static_assert(o1 != O2(101), "");
-    static_assert(!(O2(42) != o1), "");
-  }
+    static_assert (  (o5 != o1), "" );
+    static_assert (  (o5 != o2), "" );
+    static_assert ( !(o5 != o3), "" );
+    static_assert (  (o5 != o4), "" );
+    static_assert ( !(o5 != o5), "" );
+
+    }
 }
diff --git a/test/std/utilities/smartptr/unique.ptr/README.TXT b/test/std/utilities/smartptr/unique.ptr/README.TXT
deleted file mode 100644
index 20f77f6..0000000
--- a/test/std/utilities/smartptr/unique.ptr/README.TXT
+++ /dev/null
@@ -1,16 +0,0 @@
-Test Naming and Directory Structure
-===================================
-
-The directory structure for the unique_ptr class templates differs from the
-normal test directory naming conventions (e.g. matching the stable name in the standard).
-
-Instead of having a [unique.ptr.single] and [unique.ptr.runtime] directory,
-each containing their own tests, a single directory, "unique.ptr.class",
-contains both sets of tests.
-
-This allows the common behavior of the two unique_ptr specializations to be
-tested in the same place without duplication.
-
-Tests specific to [unique.ptr.single] have the suffix ".single.pass.cpp"
-and those specific to [unique.ptr.runtime] are named "*.runtime.pass.cpp".
-Tests for both specializations are named normally.
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/pointer_type.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/pointer_type.pass.cpp
deleted file mode 100644
index 54c2cf1..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/pointer_type.pass.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr::pointer type
-
-#include <memory>
-#include <type_traits>
-
-#include "test_macros.h"
-
-struct Deleter {
-  struct pointer {};
-};
-
-struct D2 {
-private:
-  typedef void pointer;
-};
-
-struct D3 {
-  static long pointer;
-};
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, int[], int>::type VT;
-  {
-    typedef std::unique_ptr<VT> P;
-    static_assert((std::is_same<typename P::pointer, int*>::value), "");
-  }
-  {
-    typedef std::unique_ptr<VT, Deleter> P;
-    static_assert((std::is_same<typename P::pointer, Deleter::pointer>::value),
-                  "");
-  }
-#if TEST_STD_VER >= 11
-  {
-    typedef std::unique_ptr<VT, D2> P;
-    static_assert(std::is_same<typename P::pointer, int*>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, D3> P;
-    static_assert(std::is_same<typename P::pointer, int*>::value, "");
-  }
-#endif
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
deleted file mode 100644
index 5d2f955..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move.pass.cpp
+++ /dev/null
@@ -1,120 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move assignment
-
-// test move assignment.  Should only require a MoveConstructible deleter, or if
-//    deleter is a reference, not even that.
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "deleter_types.h"
-#include "unique_ptr_test_helper.h"
-
-struct GenericDeleter {
-  void operator()(void*) const;
-};
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-  {
-    std::unique_ptr<VT> s1(newValue<VT>(expect_alive));
-    A* p = s1.get();
-    std::unique_ptr<VT> s2(newValue<VT>(expect_alive));
-    assert(A::count == (expect_alive * 2));
-    s2 = std::move(s1);
-    assert(A::count == expect_alive);
-    assert(s2.get() == p);
-    assert(s1.get() == 0);
-  }
-  assert(A::count == 0);
-  {
-    std::unique_ptr<VT, Deleter<VT> > s1(newValue<VT>(expect_alive),
-                                         Deleter<VT>(5));
-    A* p = s1.get();
-    std::unique_ptr<VT, Deleter<VT> > s2(newValue<VT>(expect_alive));
-    assert(A::count == (expect_alive * 2));
-    s2 = std::move(s1);
-    assert(s2.get() == p);
-    assert(s1.get() == 0);
-    assert(A::count == expect_alive);
-    assert(s2.get_deleter().state() == 5);
-    assert(s1.get_deleter().state() == 0);
-  }
-  assert(A::count == 0);
-  {
-    CDeleter<VT> d1(5);
-    std::unique_ptr<VT, CDeleter<VT>&> s1(newValue<VT>(expect_alive), d1);
-    A* p = s1.get();
-    CDeleter<VT> d2(6);
-    std::unique_ptr<VT, CDeleter<VT>&> s2(newValue<VT>(expect_alive), d2);
-    s2 = std::move(s1);
-    assert(s2.get() == p);
-    assert(s1.get() == 0);
-    assert(A::count == expect_alive);
-    assert(d1.state() == 5);
-    assert(d2.state() == 5);
-  }
-  assert(A::count == 0);
-}
-
-template <bool IsArray>
-void test_sfinae() {
-  typedef typename std::conditional<IsArray, int[], int>::type VT;
-  {
-    typedef std::unique_ptr<VT> U;
-    static_assert(!std::is_assignable<U, U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U, U&&>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, GenericDeleter> U;
-    static_assert(!std::is_assignable<U, U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U, U&&>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, NCDeleter<VT>&> U;
-    static_assert(!std::is_assignable<U, U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U, U&&>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, const NCDeleter<VT>&> U;
-    static_assert(!std::is_assignable<U, U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&>::value, "");
-    static_assert(!std::is_assignable<U, const U&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U, U&&>::value, "");
-  }
-}
-
-
-int main() {
-  {
-    test_basic</*IsArray*/ false>();
-    test_sfinae<false>();
-  }
-  {
-    test_basic</*IsArray*/ true>();
-    test_sfinae<true>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp
deleted file mode 100644
index 8d83c3c..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.pass.cpp
+++ /dev/null
@@ -1,420 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-#include "type_id.h"
-
-template <int ID = 0>
-struct GenericDeleter {
-  void operator()(void*) const {}
-};
-
-template <int ID = 0>
-struct GenericConvertingDeleter {
-
-  template <int OID>
-  GenericConvertingDeleter(GenericConvertingDeleter<OID>) {}
-
-  template <int OID>
-  GenericConvertingDeleter& operator=(GenericConvertingDeleter<OID> const&) {
-    return *this;
-  }
-
-  void operator()(void*) const {}
-};
-
-template <class T, class U>
-using EnableIfNotSame = typename std::enable_if<
-    !std::is_same<typename std::decay<T>::type, typename std::decay<U>::type>::value
->::type;
-
-template <class Templ, class Other>
-struct is_specialization;
-
-template <template <int> class Templ, int ID1, class Other>
-struct is_specialization<Templ<ID1>, Other> : std::false_type {};
-
-template <template <int> class Templ, int ID1, int ID2>
-struct is_specialization<Templ<ID1>, Templ<ID2> > : std::true_type {};
-
-template <class Templ, class Other>
-using EnableIfSpecialization = typename std::enable_if<
-    is_specialization<Templ, typename std::decay<Other>::type >::value
-  >::type;
-
-template <int ID> struct TrackingDeleter;
-template <int ID> struct ConstTrackingDeleter;
-
-template <int ID>
-struct TrackingDeleter {
-  TrackingDeleter() : arg_type(&makeArgumentID<>()) {}
-
-  TrackingDeleter(TrackingDeleter const&)
-      : arg_type(&makeArgumentID<TrackingDeleter const&>()) {}
-
-  TrackingDeleter(TrackingDeleter&&)
-      : arg_type(&makeArgumentID<TrackingDeleter &&>()) {}
-
-  template <class T, class = EnableIfSpecialization<TrackingDeleter, T> >
-  TrackingDeleter(T&&) : arg_type(&makeArgumentID<T&&>()) {}
-
-  TrackingDeleter& operator=(TrackingDeleter const&) {
-    arg_type = &makeArgumentID<TrackingDeleter const&>();
-    return *this;
-  }
-
-  TrackingDeleter& operator=(TrackingDeleter &&) {
-    arg_type = &makeArgumentID<TrackingDeleter &&>();
-    return *this;
-  }
-
-  template <class T, class = EnableIfSpecialization<TrackingDeleter, T> >
-  TrackingDeleter& operator=(T&&) {
-    arg_type = &makeArgumentID<T&&>();
-    return *this;
-  }
-
-  void operator()(void*) const {}
-
-public:
-  TypeID const* reset() const {
-    TypeID const* tmp = arg_type;
-    arg_type = nullptr;
-    return tmp;
-  }
-
-  mutable TypeID const* arg_type;
-};
-
-template <int ID>
-struct ConstTrackingDeleter {
-  ConstTrackingDeleter() : arg_type(&makeArgumentID<>()) {}
-
-  ConstTrackingDeleter(ConstTrackingDeleter const&)
-      : arg_type(&makeArgumentID<ConstTrackingDeleter const&>()) {}
-
-  ConstTrackingDeleter(ConstTrackingDeleter&&)
-      : arg_type(&makeArgumentID<ConstTrackingDeleter &&>()) {}
-
-  template <class T, class = EnableIfSpecialization<ConstTrackingDeleter, T> >
-  ConstTrackingDeleter(T&&) : arg_type(&makeArgumentID<T&&>()) {}
-
-  const ConstTrackingDeleter& operator=(ConstTrackingDeleter const&) const {
-    arg_type = &makeArgumentID<ConstTrackingDeleter const&>();
-    return *this;
-  }
-
-  const ConstTrackingDeleter& operator=(ConstTrackingDeleter &&) const {
-    arg_type = &makeArgumentID<ConstTrackingDeleter &&>();
-    return *this;
-  }
-
-  template <class T, class = EnableIfSpecialization<ConstTrackingDeleter, T> >
-  const ConstTrackingDeleter& operator=(T&&) const {
-    arg_type = &makeArgumentID<T&&>();
-    return *this;
-  }
-
-  void operator()(void*) const {}
-
-public:
-  TypeID const* reset() const {
-    TypeID const* tmp = arg_type;
-    arg_type = nullptr;
-    return tmp;
-  }
-
-  mutable TypeID const* arg_type;
-};
-
-template <class ExpectT, int ID>
-bool checkArg(TrackingDeleter<ID> const& d) {
-  return d.arg_type && *d.arg_type == makeArgumentID<ExpectT>();
-}
-
-template <class ExpectT, int ID>
-bool checkArg(ConstTrackingDeleter<ID> const& d) {
-  return d.arg_type && *d.arg_type == makeArgumentID<ExpectT>();
-}
-
-template <class From, bool AssignIsConst = false>
-struct AssignDeleter {
-  AssignDeleter() = default;
-  AssignDeleter(AssignDeleter const&) = default;
-  AssignDeleter(AssignDeleter&&) = default;
-
-  AssignDeleter& operator=(AssignDeleter const&) = delete;
-  AssignDeleter& operator=(AssignDeleter &&) = delete;
-
-  template <class T> AssignDeleter& operator=(T&&) && = delete;
-  template <class T> AssignDeleter& operator=(T&&) const && = delete;
-
-  template <class T, class = typename std::enable_if<
-      std::is_same<T&&, From>::value && !AssignIsConst
-    >::type>
-  AssignDeleter& operator=(T&&) & { return *this; }
-
-  template <class T, class = typename std::enable_if<
-      std::is_same<T&&, From>::value && AssignIsConst
-    >::type>
-  const AssignDeleter& operator=(T&&) const & { return *this; }
-
-  template <class T>
-  void operator()(T) const {}
-};
-
-template <class VT, class DDest, class DSource>
-  void doDeleterTest() {
-    using U1 = std::unique_ptr<VT, DDest>;
-    using U2 = std::unique_ptr<VT, DSource>;
-    static_assert(std::is_nothrow_assignable<U1, U2&&>::value, "");
-    typename std::decay<DDest>::type ddest;
-    typename std::decay<DSource>::type dsource;
-    U1 u1(nullptr, ddest);
-    U2 u2(nullptr, dsource);
-    u1 = std::move(u2);
-}
-
-template <bool IsArray>
-void test_sfinae() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-
-  { // Test that different non-reference deleter types are allowed so long
-    // as they convert to each other.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    static_assert(std::is_assignable<U1, U2&&>::value, "");
-  }
-  { // Test that different non-reference deleter types are disallowed when
-    // they cannot convert.
-    using U1 = std::unique_ptr<VT, GenericDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericDeleter<1> >;
-    static_assert(!std::is_assignable<U1, U2&&>::value, "");
-  }
-  { // Test that if the deleter assignment is not valid the assignment operator
-    // SFINAEs.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> const& >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U3 = std::unique_ptr<VT, GenericConvertingDeleter<0> &>;
-    using U4 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    using U5 = std::unique_ptr<VT, GenericConvertingDeleter<1> const&>;
-    static_assert(!std::is_assignable<U1, U2&&>::value, "");
-    static_assert(!std::is_assignable<U1, U3&&>::value, "");
-    static_assert(!std::is_assignable<U1, U4&&>::value, "");
-    static_assert(!std::is_assignable<U1, U5&&>::value, "");
-
-    using U1C = std::unique_ptr<const VT, GenericConvertingDeleter<0> const&>;
-    static_assert(std::is_nothrow_assignable<U1C, U1&&>::value, "");
-  }
-  { // Test that if the deleter assignment is not valid the assignment operator
-    // SFINAEs.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> & >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U3 = std::unique_ptr<VT, GenericConvertingDeleter<0> &>;
-    using U4 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    using U5 = std::unique_ptr<VT, GenericConvertingDeleter<1> const&>;
-
-    static_assert(std::is_nothrow_assignable<U1, U2&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U1, U3&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U1, U4&&>::value, "");
-    static_assert(std::is_nothrow_assignable<U1, U5&&>::value, "");
-
-    using U1C = std::unique_ptr<const VT, GenericConvertingDeleter<0> &>;
-    static_assert(std::is_nothrow_assignable<U1C, U1&&>::value, "");
-  }
-  { // Test that non-reference destination deleters can be assigned
-    // from any source deleter type with a sutible conversion. Including
-    // reference types.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<0> &>;
-    using U3 = std::unique_ptr<VT, GenericConvertingDeleter<0> const &>;
-    using U4 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    using U5 = std::unique_ptr<VT, GenericConvertingDeleter<1> &>;
-    using U6 = std::unique_ptr<VT, GenericConvertingDeleter<1> const&>;
-    static_assert(std::is_assignable<U1, U2&&>::value, "");
-    static_assert(std::is_assignable<U1, U3&&>::value, "");
-    static_assert(std::is_assignable<U1, U4&&>::value, "");
-    static_assert(std::is_assignable<U1, U5&&>::value, "");
-    static_assert(std::is_assignable<U1, U6&&>::value, "");
-  }
-  /////////////////////////////////////////////////////////////////////////////
-  {
-    using Del = GenericDeleter<0>;
-    using AD = AssignDeleter<Del&&>;
-    using ADC = AssignDeleter<Del&&, /*AllowConstAssign*/true>;
-    doDeleterTest<VT, AD, Del>();
-    doDeleterTest<VT, AD&, Del>();
-    doDeleterTest<VT, ADC const&, Del>();
-  }
-  {
-    using Del = GenericDeleter<0>;
-    using AD = AssignDeleter<Del&>;
-    using ADC = AssignDeleter<Del&, /*AllowConstAssign*/true>;
-    doDeleterTest<VT, AD, Del&>();
-    doDeleterTest<VT, AD&, Del&>();
-    doDeleterTest<VT, ADC const&, Del&>();
-  }
-  {
-    using Del = GenericDeleter<0>;
-    using AD = AssignDeleter<Del const&>;
-    using ADC = AssignDeleter<Del const&, /*AllowConstAssign*/true>;
-    doDeleterTest<VT, AD, Del const&>();
-    doDeleterTest<VT, AD&, Del const&>();
-    doDeleterTest<VT, ADC const&, Del const&>();
-  }
-}
-
-
-template <bool IsArray>
-void test_noexcept() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  {
-    typedef std::unique_ptr<const VT> APtr;
-    typedef std::unique_ptr<VT> BPtr;
-    static_assert(std::is_nothrow_assignable<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, CDeleter<const VT> > APtr;
-    typedef std::unique_ptr<VT, CDeleter<VT> > BPtr;
-    static_assert(std::is_nothrow_assignable<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, NCDeleter<const VT>&> APtr;
-    typedef std::unique_ptr<VT, NCDeleter<const VT>&> BPtr;
-    static_assert(std::is_nothrow_assignable<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, const NCConstDeleter<const VT>&> APtr;
-    typedef std::unique_ptr<VT, const NCConstDeleter<const VT>&> BPtr;
-    static_assert(std::is_nothrow_assignable<APtr, BPtr>::value, "");
-  }
-}
-
-template <bool IsArray>
-void test_deleter_value_category() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  using TD1 = TrackingDeleter<1>;
-  using TD2 = TrackingDeleter<2>;
-  TD1 d1;
-  TD2 d2;
-  using CD1 = ConstTrackingDeleter<1>;
-  using CD2 = ConstTrackingDeleter<2>;
-  CD1 cd1;
-  CD2 cd2;
-
-  { // Test non-reference deleter conversions
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2 >;
-    U1 u1;
-    U2 u2;
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2&&>(u1.get_deleter()));
-  }
-  { // Test assignment to non-const ref
-    using U1 = std::unique_ptr<VT, TD1& >;
-    using U2 = std::unique_ptr<VT, TD2 >;
-    U1 u1(nullptr, d1);
-    U2 u2;
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2&&>(u1.get_deleter()));
-  }
-  { // Test assignment to const&.
-    using U1 = std::unique_ptr<VT, CD1 const& >;
-    using U2 = std::unique_ptr<VT, CD2 >;
-    U1 u1(nullptr, cd1);
-    U2 u2;
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<CD2&&>(u1.get_deleter()));
-  }
-
-  { // Test assignment from non-const ref
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2& >;
-    U1 u1;
-    U2 u2(nullptr, d2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2&>(u1.get_deleter()));
-  }
-  { // Test assignment from const ref
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2 const& >;
-    U1 u1;
-    U2 u2(nullptr, d2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2 const&>(u1.get_deleter()));
-  }
-
-  { // Test assignment from non-const ref
-    using U1 = std::unique_ptr<VT, TD1& >;
-    using U2 = std::unique_ptr<VT, TD2& >;
-    U1 u1(nullptr, d1);
-    U2 u2(nullptr, d2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2&>(u1.get_deleter()));
-  }
-  { // Test assignment from const ref
-    using U1 = std::unique_ptr<VT, TD1& >;
-    using U2 = std::unique_ptr<VT, TD2 const& >;
-    U1 u1(nullptr, d1);
-    U2 u2(nullptr, d2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<TD2 const&>(u1.get_deleter()));
-  }
-
-  { // Test assignment from non-const ref
-    using U1 = std::unique_ptr<VT, CD1 const& >;
-    using U2 = std::unique_ptr<VT, CD2 & >;
-    U1 u1(nullptr, cd1);
-    U2 u2(nullptr, cd2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<CD2 &>(u1.get_deleter()));
-  }
-  { // Test assignment from const ref
-    using U1 = std::unique_ptr<VT, CD1 const& >;
-    using U2 = std::unique_ptr<VT, CD2 const& >;
-    U1 u1(nullptr, cd1);
-    U2 u2(nullptr, cd2);
-    u1.get_deleter().reset();
-    u1 = std::move(u2);
-    assert(checkArg<CD2 const&>(u1.get_deleter()));
-  }
-}
-
-int main() {
-  {
-    test_sfinae</*IsArray*/false>();
-    test_noexcept<false>();
-    test_deleter_value_category<false>();
-  }
-  {
-    test_sfinae</*IsArray*/true>();
-    test_noexcept<true>();
-    test_deleter_value_category<true>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp
deleted file mode 100644
index 716a2b9..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.runtime.pass.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move assignment
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "unique_ptr_test_helper.h"
-
-template <class APtr, class BPtr>
-void testAssign(APtr& aptr, BPtr& bptr) {
-  A* p = bptr.get();
-  assert(A::count == 2);
-  aptr = std::move(bptr);
-  assert(aptr.get() == p);
-  assert(bptr.get() == 0);
-  assert(A::count == 1);
-  assert(B::count == 1);
-}
-
-template <class LHS, class RHS>
-void checkDeleter(LHS& lhs, RHS& rhs, int LHSState, int RHSState) {
-  assert(lhs.get_deleter().state() == LHSState);
-  assert(rhs.get_deleter().state() == RHSState);
-}
-
-template <class T>
-struct NCConvertingDeleter {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-template <class T>
-struct NCConvertingDeleter<T[]> {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-struct GenericDeleter {
-  void operator()(void*) const;
-};
-
-struct NCGenericDeleter {
-  NCGenericDeleter() = default;
-  NCGenericDeleter(NCGenericDeleter const&) = delete;
-  NCGenericDeleter(NCGenericDeleter&&) = default;
-
-  void operator()(void*) const {}
-};
-
-void test_sfinae() {
-  using DA = NCConvertingDeleter<A[]>;        // non-copyable deleters
-  using DAC = NCConvertingDeleter<const A[]>; // non-copyable deleters
-
-  using UA = std::unique_ptr<A[]>;
-  using UAC = std::unique_ptr<const A[]>;
-  using UAD = std::unique_ptr<A[], DA>;
-  using UACD = std::unique_ptr<const A[], DAC>;
-
-  { // cannot move from an lvalue
-    static_assert(std::is_assignable<UAC, UA&&>::value, "");
-    static_assert(!std::is_assignable<UAC, UA&>::value, "");
-    static_assert(!std::is_assignable<UAC, const UA&>::value, "");
-  }
-  { // cannot move if the deleter-types cannot convert
-    static_assert(std::is_assignable<UACD, UAD&&>::value, "");
-    static_assert(!std::is_assignable<UACD, UAC&&>::value, "");
-    static_assert(!std::is_assignable<UAC, UACD&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A[], DA&>;
-    using UA2 = std::unique_ptr<A[], DAC&>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A[], const DA&>;
-    using UA2 = std::unique_ptr<A[], const DAC&>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Single>
-    using UA1 = std::unique_ptr<A[]>;
-    using UA2 = std::unique_ptr<A>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Array[]>
-    using UA1 = std::unique_ptr<A[], NCGenericDeleter>;
-    using UA2 = std::unique_ptr<A, NCGenericDeleter>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-  }
-}
-
-int main() {
-  test_sfinae();
-  // FIXME: add tests
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.single.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.single.pass.cpp
deleted file mode 100644
index 3f2ea42..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/move_convert.single.pass.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move assignment
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "deleter_types.h"
-#include "unique_ptr_test_helper.h"
-
-template <class APtr, class BPtr>
-void testAssign(APtr& aptr, BPtr& bptr) {
-  A* p = bptr.get();
-  assert(A::count == 2);
-  aptr = std::move(bptr);
-  assert(aptr.get() == p);
-  assert(bptr.get() == 0);
-  assert(A::count == 1);
-  assert(B::count == 1);
-}
-
-template <class LHS, class RHS>
-void checkDeleter(LHS& lhs, RHS& rhs, int LHSState, int RHSState) {
-  assert(lhs.get_deleter().state() == LHSState);
-  assert(rhs.get_deleter().state() == RHSState);
-}
-
-template <class T>
-struct NCConvertingDeleter {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-template <class T>
-struct NCConvertingDeleter<T[]> {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-struct NCGenericDeleter {
-  NCGenericDeleter() = default;
-  NCGenericDeleter(NCGenericDeleter const&) = delete;
-  NCGenericDeleter(NCGenericDeleter&&) = default;
-
-  void operator()(void*) const {}
-};
-
-void test_sfinae() {
-  using DA = NCConvertingDeleter<A>; // non-copyable deleters
-  using DB = NCConvertingDeleter<B>;
-  using UA = std::unique_ptr<A>;
-  using UB = std::unique_ptr<B>;
-  using UAD = std::unique_ptr<A, DA>;
-  using UBD = std::unique_ptr<B, DB>;
-  { // cannot move from an lvalue
-    static_assert(std::is_assignable<UA, UB&&>::value, "");
-    static_assert(!std::is_assignable<UA, UB&>::value, "");
-    static_assert(!std::is_assignable<UA, const UB&>::value, "");
-  }
-  { // cannot move if the deleter-types cannot convert
-    static_assert(std::is_assignable<UAD, UBD&&>::value, "");
-    static_assert(!std::is_assignable<UAD, UB&&>::value, "");
-    static_assert(!std::is_assignable<UA, UBD&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A, DA&>;
-    using UB1 = std::unique_ptr<B, DB&>;
-    static_assert(!std::is_assignable<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A, const DA&>;
-    using UB1 = std::unique_ptr<B, const DB&>;
-    static_assert(!std::is_assignable<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Array[]>
-    using UA1 = std::unique_ptr<A>;
-    using UA2 = std::unique_ptr<A[]>;
-    using UB1 = std::unique_ptr<B[]>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-    static_assert(!std::is_assignable<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Array[]>
-    using UA1 = std::unique_ptr<A, NCGenericDeleter>;
-    using UA2 = std::unique_ptr<A[], NCGenericDeleter>;
-    using UB1 = std::unique_ptr<B[], NCGenericDeleter>;
-    static_assert(!std::is_assignable<UA1, UA2&&>::value, "");
-    static_assert(!std::is_assignable<UA1, UB1&&>::value, "");
-  }
-}
-
-int main() {
-  test_sfinae();
-  {
-    std::unique_ptr<B> bptr(new B);
-    std::unique_ptr<A> aptr(new A);
-    testAssign(aptr, bptr);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
-    Deleter<B> del(42);
-    std::unique_ptr<B, Deleter<B> > bptr(new B, std::move(del));
-    std::unique_ptr<A, Deleter<A> > aptr(new A);
-    testAssign(aptr, bptr);
-    checkDeleter(aptr, bptr, 42, 0);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
-    CDeleter<A> adel(6);
-    CDeleter<B> bdel(42);
-    std::unique_ptr<B, CDeleter<B>&> bptr(new B, bdel);
-    std::unique_ptr<A, CDeleter<A>&> aptr(new A, adel);
-    testAssign(aptr, bptr);
-    checkDeleter(aptr, bptr, 42, 42);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/null.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/null.pass.cpp
deleted file mode 100644
index 165d48a..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/null.pass.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move assignment
-
-#include <memory>
-#include <cassert>
-
-#include "unique_ptr_test_helper.h"
-
-// test assignment from null
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-  {
-    std::unique_ptr<VT> s2(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    s2 = NULL;
-    assert(A::count == 0);
-    assert(s2.get() == 0);
-  }
-  assert(A::count == 0);
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/nullptr.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/nullptr.pass.cpp
deleted file mode 100644
index e1e2e32..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.asgn/nullptr.pass.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move assignment
-
-#include <memory>
-#include <cassert>
-
-#include "unique_ptr_test_helper.h"
-
-// test assignment from null
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-  {
-    std::unique_ptr<VT> s2(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    s2 = nullptr;
-    assert(A::count == 0);
-    assert(s2.get() == 0);
-  }
-  assert(A::count == 0);
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
deleted file mode 100644
index 7d5e9bc..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/auto_pointer.pass.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// libc++ cannot safely provide the auto_ptr constructor without rvalue
-// references.
-// REQUIRES: c++11 || c++14
-
-// <memory>
-
-// unique_ptr
-
-// template <class U> unique_ptr(auto_ptr<U>&&) noexcept
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "test_macros.h"
-
-struct A {
-  static int count;
-  A() { ++count; }
-  A(const A&) { ++count; }
-  virtual ~A() { --count; }
-};
-
-int A::count = 0;
-
-struct B : public A {
-  static int count;
-  B() { ++count; }
-  B(const B&) { ++count; }
-  virtual ~B() { --count; }
-};
-
-int B::count = 0;
-
-struct C {};
-
-struct Deleter {
-  void operator()(void*) {}
-};
-
-void test_sfinae() {
-  {
-    // the auto_ptr constructor should be disable with a non-default deleter.
-    using AP = std::auto_ptr<int>;
-    using U = std::unique_ptr<int, Deleter>;
-    static_assert(!std::is_constructible<U, AP&&>::value, "");
-  }
-  {
-    // the auto_ptr constructor should be disabled when the pointer types are incompatible.
-    using AP = std::auto_ptr<A>;
-    using U = std::unique_ptr<C>;
-    static_assert(!std::is_constructible<U, AP&&>::value, "");
-  }
-}
-
-int main() {
-  {
-    B* p = new B;
-    std::auto_ptr<B> ap(p);
-    std::unique_ptr<A> up(std::move(ap));
-    assert(up.get() == p);
-    assert(ap.get() == 0);
-    assert(A::count == 1);
-    assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
-    B* p = new B;
-    std::auto_ptr<B> ap(p);
-    std::unique_ptr<A> up;
-    up = std::move(ap);
-    assert(up.get() == p);
-    assert(ap.get() == 0);
-    assert(A::count == 1);
-    assert(B::count == 1);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-#if TEST_STD_VER >= 11
-  {
-    static_assert(std::is_nothrow_constructible<std::unique_ptr<A>,
-                                                std::auto_ptr<B>&&>::value,
-                  "");
-  }
-#endif
-  test_sfinae();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp
deleted file mode 100644
index 2a7949f..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/default.pass.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-//=============================================================================
-// TESTING std::unique_ptr::unique_ptr()
-//
-// Concerns:
-//   1 The default constructor works for any default constructible deleter types.
-//   2 The stored type 'T' is allowed to be incomplete.
-//
-// Plan
-//  1 Default construct unique_ptr's with various deleter types (C-1)
-//  2 Default construct a unique_ptr with an incomplete element_type and
-//    various deleter types (C-1,2)
-
-#include <memory>
-#include <cassert>
-#include "test_macros.h"
-
-#include "test_macros.h"
-#include "deleter_types.h"
-#include "unique_ptr_test_helper.h"
-
-#if defined(_LIBCPP_VERSION) && TEST_STD_VER >= 11
-_LIBCPP_SAFE_STATIC std::unique_ptr<int> global_static_unique_ptr_single;
-_LIBCPP_SAFE_STATIC std::unique_ptr<int[]> global_static_unique_ptr_runtime;
-#endif
-
-#if TEST_STD_VER >= 11
-struct NonDefaultDeleter {
-  NonDefaultDeleter() = delete;
-  void operator()(void*) const {}
-};
-#endif
-
-template <class ElemType>
-void test_sfinae() {
-#if TEST_STD_VER >= 11
-  { // the constructor does not participate in overload resolution when
-    // the deleter is a pointer type
-    using U = std::unique_ptr<ElemType, void (*)(void*)>;
-    static_assert(!std::is_default_constructible<U>::value, "");
-  }
-  { // the constructor does not participate in overload resolution when
-    // the deleter is not default constructible
-    using Del = CDeleter<ElemType>;
-    using U1 = std::unique_ptr<ElemType, NonDefaultDeleter>;
-    using U2 = std::unique_ptr<ElemType, Del&>;
-    using U3 = std::unique_ptr<ElemType, Del const&>;
-    static_assert(!std::is_default_constructible<U1>::value, "");
-    static_assert(!std::is_default_constructible<U2>::value, "");
-    static_assert(!std::is_default_constructible<U3>::value, "");
-  }
-#endif
-}
-
-template <class ElemType>
-void test_basic() {
-#if TEST_STD_VER >= 11
-  {
-    using U1 = std::unique_ptr<ElemType>;
-    using U2 = std::unique_ptr<ElemType, Deleter<ElemType> >;
-    static_assert(std::is_nothrow_default_constructible<U1>::value, "");
-    static_assert(std::is_nothrow_default_constructible<U2>::value, "");
-  }
-#endif
-  {
-    std::unique_ptr<ElemType> p;
-    assert(p.get() == 0);
-  }
-  {
-    std::unique_ptr<ElemType, NCDeleter<ElemType> > p;
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 0);
-    p.get_deleter().set_state(5);
-    assert(p.get_deleter().state() == 5);
-  }
-}
-
-DEFINE_AND_RUN_IS_INCOMPLETE_TEST({
-  doIncompleteTypeTest(0);
-  doIncompleteTypeTest<IncompleteType, Deleter<IncompleteType> >(0);
-} {
-  doIncompleteTypeTest<IncompleteType[]>(0);
-  doIncompleteTypeTest<IncompleteType[], Deleter<IncompleteType[]> >(0);
-})
-
-int main() {
-  {
-    test_sfinae<int>();
-    test_basic<int>();
-  }
-  {
-    test_sfinae<int[]>();
-    test_basic<int[]>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move.pass.cpp
deleted file mode 100644
index c102f27..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move.pass.cpp
+++ /dev/null
@@ -1,174 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr move ctor
-
-#include <memory>
-#include <utility>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-//=============================================================================
-// TESTING unique_ptr(unique_ptr&&)
-//
-// Concerns
-//   1 The moved from pointer is empty and the new pointer stores the old value.
-//   2 The only requirement on the deleter is that it is MoveConstructible
-//     or a reference.
-//   3 The constructor works for explicitly moved values (ie std::move(x))
-//   4 The constructor works for true temporaries (ie a return value)
-//
-// Plan
-//  1 Explicitly construct unique_ptr<T, D> for various deleter types 'D'.
-//    check that the value and deleter have been properly moved. (C-1,2,3)
-//
-//  2 Use the expression 'sink(source())' to move construct a unique_ptr<T, D>
-//    from a temporary. 'source' should return the unique_ptr by value and
-//    'sink' should accept the unique_ptr by value. (C-1,2,4)
-
-template <class VT>
-std::unique_ptr<VT> source1() {
-  return std::unique_ptr<VT>(newValue<VT>(1));
-}
-
-template <class VT>
-std::unique_ptr<VT, Deleter<VT> > source2() {
-  return std::unique_ptr<VT, Deleter<VT> >(newValue<VT>(1), Deleter<VT>(5));
-}
-
-template <class VT>
-std::unique_ptr<VT, NCDeleter<VT>&> source3() {
-  static NCDeleter<VT> d(5);
-  return std::unique_ptr<VT, NCDeleter<VT>&>(newValue<VT>(1), d);
-}
-
-template <class VT>
-void sink1(std::unique_ptr<VT> p) {
-  assert(p.get() != nullptr);
-}
-
-template <class VT>
-void sink2(std::unique_ptr<VT, Deleter<VT> > p) {
-  assert(p.get() != nullptr);
-  assert(p.get_deleter().state() == 5);
-}
-
-template <class VT>
-void sink3(std::unique_ptr<VT, NCDeleter<VT>&> p) {
-  assert(p.get() != nullptr);
-  assert(p.get_deleter().state() == 5);
-  assert(&p.get_deleter() == &source3<VT>().get_deleter());
-}
-
-template <class ValueT>
-void test_sfinae() {
-  typedef std::unique_ptr<ValueT> U;
-  { // Ensure unique_ptr is non-copyable
-    static_assert((!std::is_constructible<U, U const&>::value), "");
-    static_assert((!std::is_constructible<U, U&>::value), "");
-  }
-}
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<!IsArray, A, A[]>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-  {
-    typedef std::unique_ptr<VT> APtr;
-    APtr s(newValue<VT>(expect_alive));
-    A* p = s.get();
-    APtr s2 = std::move(s);
-    assert(s2.get() == p);
-    assert(s.get() == 0);
-    assert(A::count == expect_alive);
-  }
-  assert(A::count == 0);
-  {
-    typedef Deleter<VT> MoveDel;
-    typedef std::unique_ptr<VT, MoveDel> APtr;
-    MoveDel d(5);
-    APtr s(newValue<VT>(expect_alive), std::move(d));
-    assert(d.state() == 0);
-    assert(s.get_deleter().state() == 5);
-    A* p = s.get();
-    APtr s2 = std::move(s);
-    assert(s2.get() == p);
-    assert(s.get() == 0);
-    assert(A::count == expect_alive);
-    assert(s2.get_deleter().state() == 5);
-    assert(s.get_deleter().state() == 0);
-  }
-  assert(A::count == 0);
-  {
-    typedef NCDeleter<VT> NonCopyDel;
-    typedef std::unique_ptr<VT, NonCopyDel&> APtr;
-
-    NonCopyDel d;
-    APtr s(newValue<VT>(expect_alive), d);
-    A* p = s.get();
-    APtr s2 = std::move(s);
-    assert(s2.get() == p);
-    assert(s.get() == 0);
-    assert(A::count == expect_alive);
-    d.set_state(6);
-    assert(s2.get_deleter().state() == d.state());
-    assert(s.get_deleter().state() == d.state());
-  }
-  assert(A::count == 0);
-  {
-    sink1<VT>(source1<VT>());
-    assert(A::count == 0);
-    sink2<VT>(source2<VT>());
-    assert(A::count == 0);
-    sink3<VT>(source3<VT>());
-    assert(A::count == 0);
-  }
-  assert(A::count == 0);
-}
-
-template <class VT>
-void test_noexcept() {
-#if TEST_STD_VER >= 11
-  {
-    typedef std::unique_ptr<VT> U;
-    static_assert(std::is_nothrow_move_constructible<U>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, Deleter<VT> > U;
-    static_assert(std::is_nothrow_move_constructible<U>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, NCDeleter<VT> &> U;
-    static_assert(std::is_nothrow_move_constructible<U>::value, "");
-  }
-  {
-    typedef std::unique_ptr<VT, const NCConstDeleter<VT> &> U;
-    static_assert(std::is_nothrow_move_constructible<U>::value, "");
-  }
-#endif
-}
-
-int main() {
-  {
-    test_basic</*IsArray*/ false>();
-    test_sfinae<int>();
-    test_noexcept<int>();
-  }
-  {
-    test_basic</*IsArray*/ true>();
-    test_sfinae<int[]>();
-    test_noexcept<int[]>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp
deleted file mode 100644
index 769deea..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.pass.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "type_id.h"
-#include "unique_ptr_test_helper.h"
-
-template <int ID = 0>
-struct GenericDeleter {
-  void operator()(void*) const {}
-};
-
-template <int ID = 0>
-struct GenericConvertingDeleter {
-  template <int OID>
-  GenericConvertingDeleter(GenericConvertingDeleter<OID>) {}
-  void operator()(void*) const {}
-};
-
-template <class Templ, class Other>
-struct is_specialization;
-
-template <template <int> class Templ, int ID1, class Other>
-struct is_specialization<Templ<ID1>, Other> : std::false_type {};
-
-template <template <int> class Templ, int ID1, int ID2>
-struct is_specialization<Templ<ID1>, Templ<ID2> > : std::true_type {};
-
-template <class Templ, class Other>
-using EnableIfSpecialization = typename std::enable_if<
-    is_specialization<Templ, typename std::decay<Other>::type >::value
-  >::type;
-
-
-template <int ID>
-struct TrackingDeleter {
-  TrackingDeleter() : arg_type(&makeArgumentID<>()) {}
-
-  TrackingDeleter(TrackingDeleter const&)
-      : arg_type(&makeArgumentID<TrackingDeleter const&>()) {}
-
-  TrackingDeleter(TrackingDeleter&&)
-      : arg_type(&makeArgumentID<TrackingDeleter &&>()) {}
-
-  template <class T, class = EnableIfSpecialization<TrackingDeleter, T> >
-  TrackingDeleter(T&&) : arg_type(&makeArgumentID<T&&>()) {}
-
-  TrackingDeleter& operator=(TrackingDeleter const&) {
-    arg_type = &makeArgumentID<TrackingDeleter const&>();
-    return *this;
-  }
-
-  TrackingDeleter& operator=(TrackingDeleter &&) {
-    arg_type = &makeArgumentID<TrackingDeleter &&>();
-    return *this;
-  }
-
-  template <class T, class = EnableIfSpecialization<TrackingDeleter, T> >
-  TrackingDeleter& operator=(T&&) {
-    arg_type = &makeArgumentID<T&&>();
-    return *this;
-  }
-
-  void operator()(void*) const {}
-
-public:
-  TypeID const* reset() const {
-    TypeID const* tmp = arg_type;
-    arg_type = nullptr;
-    return tmp;
-  }
-
-  mutable TypeID const* arg_type;
-};
-
-
-template <class ExpectT, int ID>
-bool checkArg(TrackingDeleter<ID> const& d) {
-  return d.arg_type && *d.arg_type == makeArgumentID<ExpectT>();
-}
-
-
-template <bool IsArray>
-void test_sfinae() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-
-  { // Test that different non-reference deleter types are allowed so long
-    // as they convert to each other.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    static_assert(std::is_constructible<U1, U2&&>::value, "");
-  }
-  { // Test that different non-reference deleter types are disallowed when
-    // they cannot convert.
-    using U1 = std::unique_ptr<VT, GenericDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericDeleter<1> >;
-    static_assert(!std::is_constructible<U1, U2&&>::value, "");
-  }
-  { // Test that if the destination deleter is a reference type then only
-    // exact matches are allowed.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> const& >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U3 = std::unique_ptr<VT, GenericConvertingDeleter<0> &>;
-    using U4 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    using U5 = std::unique_ptr<VT, GenericConvertingDeleter<1> const&>;
-    static_assert(!std::is_constructible<U1, U2&&>::value, "");
-    static_assert(!std::is_constructible<U1, U3&&>::value, "");
-    static_assert(!std::is_constructible<U1, U4&&>::value, "");
-    static_assert(!std::is_constructible<U1, U5&&>::value, "");
-
-    using U1C = std::unique_ptr<const VT, GenericConvertingDeleter<0> const&>;
-    static_assert(std::is_nothrow_constructible<U1C, U1&&>::value, "");
-  }
-  { // Test that non-reference destination deleters can be constructed
-    // from any source deleter type with a sutible conversion. Including
-    // reference types.
-    using U1 = std::unique_ptr<VT, GenericConvertingDeleter<0> >;
-    using U2 = std::unique_ptr<VT, GenericConvertingDeleter<0> &>;
-    using U3 = std::unique_ptr<VT, GenericConvertingDeleter<0> const &>;
-    using U4 = std::unique_ptr<VT, GenericConvertingDeleter<1> >;
-    using U5 = std::unique_ptr<VT, GenericConvertingDeleter<1> &>;
-    using U6 = std::unique_ptr<VT, GenericConvertingDeleter<1> const&>;
-    static_assert(std::is_constructible<U1, U2&&>::value, "");
-    static_assert(std::is_constructible<U1, U3&&>::value, "");
-    static_assert(std::is_constructible<U1, U4&&>::value, "");
-    static_assert(std::is_constructible<U1, U5&&>::value, "");
-    static_assert(std::is_constructible<U1, U6&&>::value, "");
-  }
-}
-
-
-template <bool IsArray>
-void test_noexcept() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  {
-    typedef std::unique_ptr<const VT> APtr;
-    typedef std::unique_ptr<VT> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, CDeleter<const VT> > APtr;
-    typedef std::unique_ptr<VT, CDeleter<VT> > BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, NCDeleter<const VT>&> APtr;
-    typedef std::unique_ptr<VT, NCDeleter<const VT>&> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<const VT, const NCConstDeleter<const VT>&> APtr;
-    typedef std::unique_ptr<VT, const NCConstDeleter<const VT>&> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-}
-
-
-template <bool IsArray>
-void test_deleter_value_category() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  using TD1 = TrackingDeleter<1>;
-  using TD2 = TrackingDeleter<2>;
-  TD1 d1;
-  TD2 d2;
-
-  { // Test non-reference deleter conversions
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2 >;
-    U2 u2;
-    u2.get_deleter().reset();
-    U1 u1(std::move(u2));
-    assert(checkArg<TD2&&>(u1.get_deleter()));
-  }
-  { // Test assignment from non-const ref
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2& >;
-    U2 u2(nullptr, d2);
-    U1 u1(std::move(u2));
-    assert(checkArg<TD2&>(u1.get_deleter()));
-  }
-  { // Test assignment from const ref
-    using U1 = std::unique_ptr<VT, TD1 >;
-    using U2 = std::unique_ptr<VT, TD2 const& >;
-    U2 u2(nullptr, d2);
-    U1 u1(std::move(u2));
-    assert(checkArg<TD2 const&>(u1.get_deleter()));
-  }
-}
-
-
-int main() {
-  {
-    test_sfinae</*IsArray*/false>();
-    test_noexcept<false>();
-    test_deleter_value_category<false>();
-  }
-  {
-    test_sfinae</*IsArray*/true>();
-    test_noexcept<true>();
-    test_deleter_value_category<true>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.runtime.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.runtime.pass.cpp
deleted file mode 100644
index 09e842b..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.runtime.pass.cpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-#include <memory>
-#include <cassert>
-
-#include "deleter_types.h"
-#include "unique_ptr_test_helper.h"
-
-template <int ID = 0>
-struct GenericDeleter {
-  void operator()(void*) const {}
-};
-
-template <int ID = 0>
-struct GenericConvertingDeleter {
-  template <int OID>
-  GenericConvertingDeleter(GenericConvertingDeleter<OID>) {}
-  void operator()(void*) const {}
-};
-
-void test_sfinae() {
-  { // Disallow copying
-    using U1 = std::unique_ptr<A[], GenericConvertingDeleter<0> >;
-    using U2 = std::unique_ptr<A[], GenericConvertingDeleter<1> >;
-    static_assert(std::is_constructible<U1, U2&&>::value, "");
-    static_assert(!std::is_constructible<U1, U2&>::value, "");
-    static_assert(!std::is_constructible<U1, const U2&>::value, "");
-    static_assert(!std::is_constructible<U1, const U2&&>::value, "");
-  }
-  { // Disallow illegal qualified conversions
-    using U1 = std::unique_ptr<const A[]>;
-    using U2 = std::unique_ptr<A[]>;
-    static_assert(std::is_constructible<U1, U2&&>::value, "");
-    static_assert(!std::is_constructible<U2, U1&&>::value, "");
-  }
-  { // Disallow base-to-derived conversions.
-    using UA = std::unique_ptr<A[]>;
-    using UB = std::unique_ptr<B[]>;
-    static_assert(!std::is_constructible<UA, UB&&>::value, "");
-  }
-  { // Disallow base-to-derived conversions.
-    using UA = std::unique_ptr<A[], GenericConvertingDeleter<0> >;
-    using UB = std::unique_ptr<B[], GenericConvertingDeleter<1> >;
-    static_assert(!std::is_constructible<UA, UB&&>::value, "");
-  }
-  { // Disallow invalid deleter initialization
-    using U1 = std::unique_ptr<A[], GenericDeleter<0> >;
-    using U2 = std::unique_ptr<A[], GenericDeleter<1> >;
-    static_assert(!std::is_constructible<U1, U2&&>::value, "");
-  }
-  { // Disallow reference deleters with different qualifiers
-    using U1 = std::unique_ptr<A[], Deleter<A[]>&>;
-    using U2 = std::unique_ptr<A[], const Deleter<A[]>&>;
-    static_assert(!std::is_constructible<U1, U2&&>::value, "");
-    static_assert(!std::is_constructible<U2, U1&&>::value, "");
-  }
-  {
-    using U1 = std::unique_ptr<A[]>;
-    using U2 = std::unique_ptr<A>;
-    static_assert(!std::is_constructible<U1, U2&&>::value, "");
-    static_assert(!std::is_constructible<U2, U1&&>::value, "");
-  }
-}
-
-
-int main() {
-  test_sfinae();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.single.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.single.pass.cpp
deleted file mode 100644
index 4e2a6df..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/move_convert.single.pass.cpp
+++ /dev/null
@@ -1,248 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// Test unique_ptr converting move ctor
-
-// NOTE: unique_ptr does not provide converting constructors in c++03
-// UNSUPPORTED: c++98, c++03
-
-#include <memory>
-#include <type_traits>
-#include <utility>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-// test converting move ctor.  Should only require a MoveConstructible deleter, or if
-//    deleter is a reference, not even that.
-// Explicit version
-
-template <class LHS, class RHS>
-void checkReferenceDeleter(LHS& lhs, RHS& rhs) {
-  typedef typename LHS::deleter_type NewDel;
-  static_assert(std::is_reference<NewDel>::value, "");
-  rhs.get_deleter().set_state(42);
-  assert(rhs.get_deleter().state() == 42);
-  assert(lhs.get_deleter().state() == 42);
-  lhs.get_deleter().set_state(99);
-  assert(lhs.get_deleter().state() == 99);
-  assert(rhs.get_deleter().state() == 99);
-}
-
-template <class LHS, class RHS>
-void checkDeleter(LHS& lhs, RHS& rhs, int LHSVal, int RHSVal) {
-  assert(lhs.get_deleter().state() == LHSVal);
-  assert(rhs.get_deleter().state() == RHSVal);
-}
-
-template <class LHS, class RHS>
-void checkCtor(LHS& lhs, RHS& rhs, A* RHSVal) {
-  assert(lhs.get() == RHSVal);
-  assert(rhs.get() == nullptr);
-  assert(A::count == 1);
-  assert(B::count == 1);
-}
-
-void checkNoneAlive() {
-  assert(A::count == 0);
-  assert(B::count == 0);
-}
-
-template <class T>
-struct NCConvertingDeleter {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-template <class T>
-struct NCConvertingDeleter<T[]> {
-  NCConvertingDeleter() = default;
-  NCConvertingDeleter(NCConvertingDeleter const&) = delete;
-  NCConvertingDeleter(NCConvertingDeleter&&) = default;
-
-  template <class U>
-  NCConvertingDeleter(NCConvertingDeleter<U>&&) {}
-
-  void operator()(T*) const {}
-};
-
-struct NCGenericDeleter {
-  NCGenericDeleter() = default;
-  NCGenericDeleter(NCGenericDeleter const&) = delete;
-  NCGenericDeleter(NCGenericDeleter&&) = default;
-
-  void operator()(void*) const {}
-};
-
-void test_sfinae() {
-  using DA = NCConvertingDeleter<A>; // non-copyable deleters
-  using DB = NCConvertingDeleter<B>;
-  using UA = std::unique_ptr<A>;
-  using UB = std::unique_ptr<B>;
-  using UAD = std::unique_ptr<A, DA>;
-  using UBD = std::unique_ptr<B, DB>;
-  { // cannot move from an lvalue
-    static_assert(std::is_constructible<UA, UB&&>::value, "");
-    static_assert(!std::is_constructible<UA, UB&>::value, "");
-    static_assert(!std::is_constructible<UA, const UB&>::value, "");
-  }
-  { // cannot move if the deleter-types cannot convert
-    static_assert(std::is_constructible<UAD, UBD&&>::value, "");
-    static_assert(!std::is_constructible<UAD, UB&&>::value, "");
-    static_assert(!std::is_constructible<UA, UBD&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A, DA&>;
-    using UB1 = std::unique_ptr<B, DB&>;
-    static_assert(!std::is_constructible<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert with reference deleters of different types
-    using UA1 = std::unique_ptr<A, const DA&>;
-    using UB1 = std::unique_ptr<B, const DB&>;
-    static_assert(!std::is_constructible<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Array[]>
-    using UA1 = std::unique_ptr<A>;
-    using UA2 = std::unique_ptr<A[]>;
-    using UB1 = std::unique_ptr<B[]>;
-    static_assert(!std::is_constructible<UA1, UA2&&>::value, "");
-    static_assert(!std::is_constructible<UA1, UB1&&>::value, "");
-  }
-  { // cannot move-convert from unique_ptr<Array[]>
-    using UA1 = std::unique_ptr<A, NCGenericDeleter>;
-    using UA2 = std::unique_ptr<A[], NCGenericDeleter>;
-    using UB1 = std::unique_ptr<B[], NCGenericDeleter>;
-    static_assert(!std::is_constructible<UA1, UA2&&>::value, "");
-    static_assert(!std::is_constructible<UA1, UB1&&>::value, "");
-  }
-}
-
-void test_noexcept() {
-  {
-    typedef std::unique_ptr<A> APtr;
-    typedef std::unique_ptr<B> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<A, Deleter<A> > APtr;
-    typedef std::unique_ptr<B, Deleter<B> > BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<A, NCDeleter<A>&> APtr;
-    typedef std::unique_ptr<B, NCDeleter<A>&> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-  {
-    typedef std::unique_ptr<A, const NCConstDeleter<A>&> APtr;
-    typedef std::unique_ptr<B, const NCConstDeleter<A>&> BPtr;
-    static_assert(std::is_nothrow_constructible<APtr, BPtr>::value, "");
-  }
-}
-
-int main() {
-  {
-    test_sfinae();
-    test_noexcept();
-  }
-  {
-    typedef std::unique_ptr<A> APtr;
-    typedef std::unique_ptr<B> BPtr;
-    { // explicit
-      BPtr b(new B);
-      A* p = b.get();
-      APtr a(std::move(b));
-      checkCtor(a, b, p);
-    }
-    checkNoneAlive();
-    { // implicit
-      BPtr b(new B);
-      A* p = b.get();
-      APtr a = std::move(b);
-      checkCtor(a, b, p);
-    }
-    checkNoneAlive();
-  }
-  { // test with moveable deleters
-    typedef std::unique_ptr<A, Deleter<A> > APtr;
-    typedef std::unique_ptr<B, Deleter<B> > BPtr;
-    {
-      Deleter<B> del(5);
-      BPtr b(new B, std::move(del));
-      A* p = b.get();
-      APtr a(std::move(b));
-      checkCtor(a, b, p);
-      checkDeleter(a, b, 5, 0);
-    }
-    checkNoneAlive();
-    {
-      Deleter<B> del(5);
-      BPtr b(new B, std::move(del));
-      A* p = b.get();
-      APtr a = std::move(b);
-      checkCtor(a, b, p);
-      checkDeleter(a, b, 5, 0);
-    }
-    checkNoneAlive();
-  }
-  { // test with reference deleters
-    typedef std::unique_ptr<A, NCDeleter<A>&> APtr;
-    typedef std::unique_ptr<B, NCDeleter<A>&> BPtr;
-    NCDeleter<A> del(5);
-    {
-      BPtr b(new B, del);
-      A* p = b.get();
-      APtr a(std::move(b));
-      checkCtor(a, b, p);
-      checkReferenceDeleter(a, b);
-    }
-    checkNoneAlive();
-    {
-      BPtr b(new B, del);
-      A* p = b.get();
-      APtr a = std::move(b);
-      checkCtor(a, b, p);
-      checkReferenceDeleter(a, b);
-    }
-    checkNoneAlive();
-  }
-  {
-    typedef std::unique_ptr<A, CDeleter<A> > APtr;
-    typedef std::unique_ptr<B, CDeleter<B>&> BPtr;
-    CDeleter<B> del(5);
-    {
-      BPtr b(new B, del);
-      A* p = b.get();
-      APtr a(std::move(b));
-      checkCtor(a, b, p);
-      checkDeleter(a, b, 5, 5);
-    }
-    checkNoneAlive();
-    {
-      BPtr b(new B, del);
-      A* p = b.get();
-      APtr a = std::move(b);
-      checkCtor(a, b, p);
-      checkDeleter(a, b, 5, 5);
-    }
-    checkNoneAlive();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/null.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/null.pass.cpp
deleted file mode 100644
index 8bc8a57..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/null.pass.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// <memory>
-
-// unique_ptr
-
-// FIXME(EricWF): This test contains tests for constructing a unique_ptr from NULL.
-// The behavior demonstrated in this test is not meant to be standard; It simply
-// tests the current status quo in libc++.
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-template <class VT>
-void test_pointer_ctor() {
-  {
-    std::unique_ptr<VT> p(0);
-    assert(p.get() == 0);
-  }
-  {
-    std::unique_ptr<VT, Deleter<VT> > p(0);
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 0);
-  }
-}
-
-template <class VT>
-void test_pointer_deleter_ctor() {
-  {
-    std::default_delete<VT> d;
-    std::unique_ptr<VT> p(0, d);
-    assert(p.get() == 0);
-  }
-  {
-    std::unique_ptr<VT, Deleter<VT> > p(0, Deleter<VT>(5));
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 5);
-  }
-  {
-    NCDeleter<VT> d(5);
-    std::unique_ptr<VT, NCDeleter<VT>&> p(0, d);
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 5);
-  }
-  {
-    NCConstDeleter<VT> d(5);
-    std::unique_ptr<VT, NCConstDeleter<VT> const&> p(0, d);
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 5);
-  }
-}
-
-int main() {
-  {
-    // test_pointer_ctor<int>();
-    test_pointer_deleter_ctor<int>();
-  }
-  {
-    test_pointer_ctor<int[]>();
-    test_pointer_deleter_ctor<int[]>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/nullptr.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/nullptr.pass.cpp
deleted file mode 100644
index 6764935..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/nullptr.pass.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// unique_ptr(nullptr_t);
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-
-#if defined(_LIBCPP_VERSION) && TEST_STD_VER >= 11
-_LIBCPP_SAFE_STATIC std::unique_ptr<int> global_static_unique_ptr_single(nullptr);
-_LIBCPP_SAFE_STATIC std::unique_ptr<int[]> global_static_unique_ptr_runtime(nullptr);
-#endif
-
-
-#if TEST_STD_VER >= 11
-struct NonDefaultDeleter {
-  NonDefaultDeleter() = delete;
-  void operator()(void*) const {}
-};
-#endif
-
-template <class VT>
-void test_basic() {
-#if TEST_STD_VER >= 11
-  {
-    using U1 = std::unique_ptr<VT>;
-    using U2 = std::unique_ptr<VT, Deleter<VT> >;
-    static_assert(std::is_nothrow_constructible<U1, decltype(nullptr)>::value,
-                  "");
-    static_assert(std::is_nothrow_constructible<U2, decltype(nullptr)>::value,
-                  "");
-  }
-#endif
-  {
-    std::unique_ptr<VT> p(nullptr);
-    assert(p.get() == 0);
-  }
-  {
-    std::unique_ptr<VT, NCDeleter<VT> > p(nullptr);
-    assert(p.get() == 0);
-    assert(p.get_deleter().state() == 0);
-  }
-}
-
-template <class VT>
-void test_sfinae() {
-#if TEST_STD_VER >= 11
-  { // the constructor does not participate in overload resultion when
-    // the deleter is a pointer type
-    using U = std::unique_ptr<VT, void (*)(void*)>;
-    static_assert(!std::is_constructible<U, decltype(nullptr)>::value, "");
-  }
-  { // the constructor does not participate in overload resolution when
-    // the deleter is not default constructible
-    using Del = CDeleter<VT>;
-    using U1 = std::unique_ptr<VT, NonDefaultDeleter>;
-    using U2 = std::unique_ptr<VT, Del&>;
-    using U3 = std::unique_ptr<VT, Del const&>;
-    static_assert(!std::is_constructible<U1, decltype(nullptr)>::value, "");
-    static_assert(!std::is_constructible<U2, decltype(nullptr)>::value, "");
-    static_assert(!std::is_constructible<U3, decltype(nullptr)>::value, "");
-  }
-#endif
-}
-
-DEFINE_AND_RUN_IS_INCOMPLETE_TEST({
-  { doIncompleteTypeTest(0, nullptr); }
-  checkNumIncompleteTypeAlive(0);
-  {
-    doIncompleteTypeTest<IncompleteType, NCDeleter<IncompleteType> >(0,
-                                                                     nullptr);
-  }
-  checkNumIncompleteTypeAlive(0);
-  { doIncompleteTypeTest<IncompleteType[]>(0, nullptr); }
-  checkNumIncompleteTypeAlive(0);
-  {
-    doIncompleteTypeTest<IncompleteType[], NCDeleter<IncompleteType[]> >(
-        0, nullptr);
-  }
-  checkNumIncompleteTypeAlive(0);
-})
-
-int main() {
-  {
-    test_basic<int>();
-    test_sfinae<int>();
-  }
-  {
-    test_basic<int[]>();
-    test_sfinae<int[]>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer.pass.cpp
deleted file mode 100644
index 8df259b..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer.pass.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-//=============================================================================
-// TESTING std::unique_ptr::unique_ptr(pointer)
-//
-// Concerns:
-//   1 The pointer constructor works for any default constructible deleter types.
-//   2 The pointer constructor accepts pointers to derived types.
-//   2 The stored type 'T' is allowed to be incomplete.
-//
-// Plan
-//  1 Construct unique_ptr<T, D>'s with a pointer to 'T' and various deleter
-//   types (C-1)
-//  2 Construct unique_ptr<T, D>'s with a pointer to 'D' and various deleter
-//    types where 'D' is derived from 'T'. (C-1,2)
-//  3 Construct a unique_ptr<T, D> with a pointer to 'T' and various deleter
-//    types where 'T' is an incomplete type (C-1,3)
-
-// Test unique_ptr(pointer) ctor
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-// unique_ptr(pointer) ctor should only require default Deleter ctor
-
-template <bool IsArray>
-void test_pointer() {
-  typedef typename std::conditional<!IsArray, A, A[]>::type ValueT;
-  const int expect_alive = IsArray ? 5 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U1 = std::unique_ptr<ValueT>;
-    using U2 = std::unique_ptr<ValueT, Deleter<ValueT> >;
-
-    // Test for noexcept
-    static_assert(std::is_nothrow_constructible<U1, A*>::value, "");
-    static_assert(std::is_nothrow_constructible<U2, A*>::value, "");
-
-    // Test for explicit
-    static_assert(!std::is_convertible<A*, U1>::value, "");
-    static_assert(!std::is_convertible<A*, U2>::value, "");
-  }
-#endif
-  {
-    A* p = newValue<ValueT>(expect_alive);
-    assert(A::count == expect_alive);
-    std::unique_ptr<ValueT> s(p);
-    assert(s.get() == p);
-  }
-  assert(A::count == 0);
-  {
-    A* p = newValue<ValueT>(expect_alive);
-    assert(A::count == expect_alive);
-    std::unique_ptr<ValueT, NCDeleter<ValueT> > s(p);
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 0);
-  }
-  assert(A::count == 0);
-}
-
-void test_derived() {
-  {
-    B* p = new B;
-    assert(A::count == 1);
-    assert(B::count == 1);
-    std::unique_ptr<A> s(p);
-    assert(s.get() == p);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  {
-    B* p = new B;
-    assert(A::count == 1);
-    assert(B::count == 1);
-    std::unique_ptr<A, NCDeleter<A> > s(p);
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 0);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-}
-
-#if TEST_STD_VER >= 11
-struct NonDefaultDeleter {
-  NonDefaultDeleter() = delete;
-  void operator()(void*) const {}
-};
-
-struct GenericDeleter {
-  void operator()(void*) const;
-};
-#endif
-
-template <class T>
-void test_sfinae() {
-#if TEST_STD_VER >= 11
-  { // the constructor does not participate in overload resultion when
-    // the deleter is a pointer type
-    using U = std::unique_ptr<T, void (*)(void*)>;
-    static_assert(!std::is_constructible<U, T*>::value, "");
-  }
-  { // the constructor does not participate in overload resolution when
-    // the deleter is not default constructible
-    using Del = CDeleter<T>;
-    using U1 = std::unique_ptr<T, NonDefaultDeleter>;
-    using U2 = std::unique_ptr<T, Del&>;
-    using U3 = std::unique_ptr<T, Del const&>;
-    static_assert(!std::is_constructible<U1, T*>::value, "");
-    static_assert(!std::is_constructible<U2, T*>::value, "");
-    static_assert(!std::is_constructible<U3, T*>::value, "");
-  }
-#endif
-}
-
-static void test_sfinae_runtime() {
-#if TEST_STD_VER >= 11
-  { // the constructor does not participate in overload resolution when
-    // a base <-> derived conversion would occur.
-    using UA = std::unique_ptr<A[]>;
-    using UAD = std::unique_ptr<A[], GenericDeleter>;
-    using UAC = std::unique_ptr<const A[]>;
-    using UB = std::unique_ptr<B[]>;
-    using UBD = std::unique_ptr<B[], GenericDeleter>;
-    using UBC = std::unique_ptr<const B[]>;
-
-    static_assert(!std::is_constructible<UA, B*>::value, "");
-    static_assert(!std::is_constructible<UB, A*>::value, "");
-    static_assert(!std::is_constructible<UAD, B*>::value, "");
-    static_assert(!std::is_constructible<UBD, A*>::value, "");
-    static_assert(!std::is_constructible<UAC, const B*>::value, "");
-    static_assert(!std::is_constructible<UBC, const A*>::value, "");
-  }
-#endif
-}
-
-DEFINE_AND_RUN_IS_INCOMPLETE_TEST({
-  { doIncompleteTypeTest(1, getNewIncomplete()); }
-  checkNumIncompleteTypeAlive(0);
-  {
-    doIncompleteTypeTest<IncompleteType, NCDeleter<IncompleteType> >(
-        1, getNewIncomplete());
-  }
-  checkNumIncompleteTypeAlive(0);
-})
-
-int main() {
-  {
-    test_pointer</*IsArray*/ false>();
-    test_derived();
-    test_sfinae<int>();
-  }
-  {
-    test_pointer</*IsArray*/ true>();
-    test_sfinae<int[]>();
-    test_sfinae_runtime();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp
deleted file mode 100644
index 781794d..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.ctor/pointer_deleter.pass.cpp
+++ /dev/null
@@ -1,328 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-//=============================================================================
-// TESTING unique_ptr(pointer, deleter)
-//
-// Concerns:
-//   1 unique_ptr(pointer, deleter&&) only requires a MoveConstructible deleter.
-//   2 unique_ptr(pointer, deleter&) requires a CopyConstructible deleter.
-//   3 unique_ptr<T, D&>(pointer, deleter) does not require a CopyConstructible deleter.
-//   4 unique_ptr<T, D const&>(pointer, deleter) does not require a CopyConstructible deleter.
-//   5 unique_ptr(pointer, deleter) should work for derived pointers.
-//   6 unique_ptr(pointer, deleter) should work with function pointers.
-//   7 unique_ptr<void> should work.
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-bool my_free_called = false;
-
-void my_free(void*) { my_free_called = true; }
-
-#if TEST_STD_VER >= 11
-struct DeleterBase {
-  void operator()(void*) const {}
-};
-struct CopyOnlyDeleter : DeleterBase {
-  CopyOnlyDeleter() = default;
-  CopyOnlyDeleter(CopyOnlyDeleter const&) = default;
-  CopyOnlyDeleter(CopyOnlyDeleter&&) = delete;
-};
-struct MoveOnlyDeleter : DeleterBase {
-  MoveOnlyDeleter() = default;
-  MoveOnlyDeleter(MoveOnlyDeleter&&) = default;
-};
-struct NoCopyMoveDeleter : DeleterBase {
-  NoCopyMoveDeleter() = default;
-  NoCopyMoveDeleter(NoCopyMoveDeleter const&) = delete;
-};
-#endif
-
-template <bool IsArray>
-void test_sfinae() {
-#if TEST_STD_VER >= 11
-  typedef typename std::conditional<!IsArray, int, int[]>::type VT;
-  {
-    using D = CopyOnlyDeleter;
-    using U = std::unique_ptr<VT, D>;
-    static_assert(std::is_constructible<U, int*, D const&>::value, "");
-    static_assert(std::is_constructible<U, int*, D&>::value, "");
-    static_assert(std::is_constructible<U, int*, D&&>::value, "");
-    // FIXME: __libcpp_compressed_pair attempts to perform a move even though
-    // it should only copy.
-    //D d;
-    //U u(nullptr, std::move(d));
-  }
-  {
-    using D = MoveOnlyDeleter;
-    using U = std::unique_ptr<VT, D>;
-    static_assert(!std::is_constructible<U, int*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, int*, D&>::value, "");
-    static_assert(std::is_constructible<U, int*, D&&>::value, "");
-    D d;
-    U u(nullptr, std::move(d));
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<VT, D>;
-    static_assert(!std::is_constructible<U, int*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, int*, D&>::value, "");
-    static_assert(!std::is_constructible<U, int*, D&&>::value, "");
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<VT, D&>;
-    static_assert(!std::is_constructible<U, int*, D const&>::value, "");
-    static_assert(std::is_constructible<U, int*, D&>::value, "");
-    static_assert(!std::is_constructible<U, int*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, int*, const D&&>::value, "");
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<VT, const D&>;
-    static_assert(std::is_constructible<U, int*, D const&>::value, "");
-    static_assert(std::is_constructible<U, int*, D&>::value, "");
-    static_assert(!std::is_constructible<U, int*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, int*, const D&&>::value, "");
-  }
-#endif
-}
-
-template <bool IsArray>
-void test_noexcept() {
-#if TEST_STD_VER >= 11
-  typedef typename std::conditional<!IsArray, int, int[]>::type VT;
-  {
-    using D = CopyOnlyDeleter;
-    using U = std::unique_ptr<VT, D>;
-    static_assert(std::is_nothrow_constructible<U, int*, D const&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, int*, D&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, int*, D&&>::value, "");
-  }
-  {
-    using D = MoveOnlyDeleter;
-    using U = std::unique_ptr<VT, D>;
-    static_assert(std::is_nothrow_constructible<U, int*, D&&>::value, "");
-    D d;
-    U u(nullptr, std::move(d));
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<VT, D&>;
-    static_assert(std::is_nothrow_constructible<U, int*, D&>::value, "");
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<VT, const D&>;
-    static_assert(std::is_nothrow_constructible<U, int*, D const&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, int*, D&>::value, "");
-  }
-#endif
-}
-
-void test_sfinae_runtime() {
-#if TEST_STD_VER >= 11
-  {
-    using D = CopyOnlyDeleter;
-    using U = std::unique_ptr<A[], D>;
-    static_assert(std::is_nothrow_constructible<U, A*, D const&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, A*, D&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, A*, D&&>::value, "");
-
-    static_assert(!std::is_constructible<U, B*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&&>::value, "");
-    // FIXME: __libcpp_compressed_pair attempts to perform a move even though
-    // it should only copy.
-    //D d;
-    //U u(nullptr, std::move(d));
-  }
-  {
-    using D = MoveOnlyDeleter;
-    using U = std::unique_ptr<A[], D>;
-    static_assert(!std::is_constructible<U, A*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, A*, D&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, A*, D&&>::value, "");
-
-    static_assert(!std::is_constructible<U, B*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&&>::value, "");
-    D d;
-    U u(nullptr, std::move(d));
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<A[], D>;
-    static_assert(!std::is_constructible<U, A*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, A*, D&>::value, "");
-    static_assert(!std::is_constructible<U, A*, D&&>::value, "");
-
-    static_assert(!std::is_constructible<U, B*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&&>::value, "");
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<A[], D&>;
-    static_assert(!std::is_constructible<U, A*, D const&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, A*, D&>::value, "");
-    static_assert(!std::is_constructible<U, A*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, A*, const D&&>::value, "");
-
-    static_assert(!std::is_constructible<U, B*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, B*, const D&&>::value, "");
-  }
-  {
-    using D = NoCopyMoveDeleter;
-    using U = std::unique_ptr<A[], const D&>;
-    static_assert(std::is_nothrow_constructible<U, A*, D const&>::value, "");
-    static_assert(std::is_nothrow_constructible<U, A*, D&>::value, "");
-    static_assert(!std::is_constructible<U, A*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, A*, const D&&>::value, "");
-
-    static_assert(!std::is_constructible<U, B*, D const&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&>::value, "");
-    static_assert(!std::is_constructible<U, B*, D&&>::value, "");
-    static_assert(!std::is_constructible<U, B*, const D&&>::value, "");
-  }
-#endif
-}
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<!IsArray, A, A[]>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-  { // MoveConstructible deleter (C-1)
-    A* p = newValue<VT>(expect_alive);
-    assert(A::count == expect_alive);
-    std::unique_ptr<VT, Deleter<VT> > s(p, Deleter<VT>(5));
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 5);
-  }
-  assert(A::count == 0);
-  { // CopyConstructible deleter (C-2)
-    A* p = newValue<VT>(expect_alive);
-    assert(A::count == expect_alive);
-    CopyDeleter<VT> d(5);
-    std::unique_ptr<VT, CopyDeleter<VT> > s(p, d);
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 5);
-    d.set_state(6);
-    assert(s.get_deleter().state() == 5);
-  }
-  assert(A::count == 0);
-  { // Reference deleter (C-3)
-    A* p = newValue<VT>(expect_alive);
-    assert(A::count == expect_alive);
-    NCDeleter<VT> d(5);
-    std::unique_ptr<VT, NCDeleter<VT>&> s(p, d);
-    assert(s.get() == p);
-    assert(&s.get_deleter() == &d);
-    assert(s.get_deleter().state() == 5);
-    d.set_state(6);
-    assert(s.get_deleter().state() == 6);
-  }
-  assert(A::count == 0);
-  { // Const Reference deleter (C-4)
-    A* p = newValue<VT>(expect_alive);
-    assert(A::count == expect_alive);
-    NCConstDeleter<VT> d(5);
-    std::unique_ptr<VT, NCConstDeleter<VT> const&> s(p, d);
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 5);
-    assert(&s.get_deleter() == &d);
-  }
-  assert(A::count == 0);
-  { // Void and function pointers (C-6,7)
-    typedef typename std::conditional<IsArray, int[], int>::type VT2;
-    my_free_called = false;
-    {
-      int i = 0;
-      std::unique_ptr<VT2, void (*)(void*)> s(&i, my_free);
-      assert(s.get() == &i);
-      assert(s.get_deleter() == my_free);
-      assert(!my_free_called);
-    }
-    assert(my_free_called);
-  }
-}
-
-void test_basic_single() {
-  assert(A::count == 0);
-  assert(B::count == 0);
-  { // Derived pointers (C-5)
-    B* p = new B;
-    assert(A::count == 1);
-    assert(B::count == 1);
-    std::unique_ptr<A, Deleter<A> > s(p, Deleter<A>(5));
-    assert(s.get() == p);
-    assert(s.get_deleter().state() == 5);
-  }
-  assert(A::count == 0);
-  assert(B::count == 0);
-  { // Void and function pointers (C-6,7)
-    my_free_called = false;
-    {
-      int i = 0;
-      std::unique_ptr<void, void (*)(void*)> s(&i, my_free);
-      assert(s.get() == &i);
-      assert(s.get_deleter() == my_free);
-      assert(!my_free_called);
-    }
-    assert(my_free_called);
-  }
-}
-
-template <bool IsArray>
-void test_nullptr() {
-#if TEST_STD_VER >= 11
-  typedef typename std::conditional<!IsArray, A, A[]>::type VT;
-  {
-    std::unique_ptr<VT, Deleter<VT> > u(nullptr, Deleter<VT>{});
-    assert(u.get() == nullptr);
-  }
-  {
-    NCDeleter<VT> d;
-    std::unique_ptr<VT, NCDeleter<VT>& > u(nullptr, d);
-    assert(u.get() == nullptr);
-  }
-  {
-    NCConstDeleter<VT> d;
-    std::unique_ptr<VT, NCConstDeleter<VT> const& > u(nullptr, d);
-    assert(u.get() == nullptr);
-  }
-#endif
-}
-
-int main() {
-  {
-    test_basic</*IsArray*/ false>();
-    test_nullptr<false>();
-    test_basic_single();
-    test_sfinae<false>();
-    test_noexcept<false>();
-  }
-  {
-    test_basic</*IsArray*/ true>();
-    test_nullptr<true>();
-    test_sfinae<true>();
-    test_sfinae_runtime();
-    test_noexcept<true>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.dtor/null.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.dtor/null.pass.cpp
deleted file mode 100644
index fa10ade..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.dtor/null.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// The deleter is not called if get() == 0
-
-#include <memory>
-#include <cassert>
-
-class Deleter {
-  int state_;
-
-  Deleter(Deleter&);
-  Deleter& operator=(Deleter&);
-
-public:
-  Deleter() : state_(0) {}
-
-  int state() const { return state_; }
-
-  void operator()(void*) { ++state_; }
-};
-
-template <class T>
-void test_basic() {
-  Deleter d;
-  assert(d.state() == 0);
-  {
-    std::unique_ptr<T, Deleter&> p(nullptr, d);
-    assert(p.get() == nullptr);
-    assert(&p.get_deleter() == &d);
-  }
-  assert(d.state() == 0);
-}
-
-int main() {
-  test_basic<int>();
-  test_basic<int[]>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/release.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/release.pass.cpp
deleted file mode 100644
index f7f2094..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/release.pass.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test release
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 3 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U = std::unique_ptr<VT>;
-    U u; ((void)u);
-    ASSERT_NOEXCEPT(u.release());
-  }
-#endif
-  {
-    std::unique_ptr<VT> p(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    A* ap = p.get();
-    A* a = p.release();
-    assert(A::count == expect_alive);
-    assert(p.get() == nullptr);
-    assert(ap == a);
-    assert(a != nullptr);
-
-    if (IsArray)
-      delete[] a;
-    else
-      delete a;
-
-    assert(A::count == 0);
-  }
-  assert(A::count == 0);
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.pass.cpp
deleted file mode 100644
index c95c55b..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.pass.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test reset
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-template <bool IsArray>
-void test_reset_pointer() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 3 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U = std::unique_ptr<VT>;
-    U u; ((void)u);
-    ASSERT_NOEXCEPT(u.reset((A*)nullptr));
-  }
-#endif
-  {
-    std::unique_ptr<VT> p(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    A* i = p.get();
-    assert(i != nullptr);
-    A* new_value = newValue<VT>(expect_alive);
-    assert(A::count == (expect_alive * 2));
-    p.reset(new_value);
-    assert(A::count == expect_alive);
-    assert(p.get() == new_value);
-  }
-  assert(A::count == 0);
-  {
-    std::unique_ptr<const VT> p(newValue<const VT>(expect_alive));
-    assert(A::count == expect_alive);
-    const A* i = p.get();
-    assert(i != nullptr);
-    A* new_value = newValue<VT>(expect_alive);
-    assert(A::count == (expect_alive * 2));
-    p.reset(new_value);
-    assert(A::count == expect_alive);
-    assert(p.get() == new_value);
-  }
-  assert(A::count == 0);
-}
-
-template <bool IsArray>
-void test_reset_nullptr() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 3 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U = std::unique_ptr<VT>;
-    U u; ((void)u);
-    ASSERT_NOEXCEPT(u.reset(nullptr));
-  }
-#endif
-  {
-    std::unique_ptr<VT> p(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    A* i = p.get();
-    assert(i != nullptr);
-    p.reset(nullptr);
-    assert(A::count == 0);
-    assert(p.get() == nullptr);
-  }
-  assert(A::count == 0);
-}
-
-
-template <bool IsArray>
-void test_reset_no_arg() {
-  typedef typename std::conditional<IsArray, A[], A>::type VT;
-  const int expect_alive = IsArray ? 3 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U = std::unique_ptr<VT>;
-    U u; ((void)u);
-    ASSERT_NOEXCEPT(u.reset());
-  }
-#endif
-  {
-    std::unique_ptr<VT> p(newValue<VT>(expect_alive));
-    assert(A::count == expect_alive);
-    A* i = p.get();
-    assert(i != nullptr);
-    p.reset();
-    assert(A::count == 0);
-    assert(p.get() == nullptr);
-  }
-  assert(A::count == 0);
-}
-
-int main() {
-  {
-    test_reset_pointer</*IsArray*/ false>();
-    test_reset_nullptr<false>();
-    test_reset_no_arg<false>();
-  }
-  {
-    test_reset_pointer</*IsArray*/true>();
-    test_reset_nullptr<true>();
-    test_reset_no_arg<true>();
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
deleted file mode 100644
index 0d067b9..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test reset
-
-#include <memory>
-#include <cassert>
-
-#include "unique_ptr_test_helper.h"
-
-int main() {
-  {
-    std::unique_ptr<A[]> p;
-    p.reset(static_cast<B*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}}
-  }
-  {
-    std::unique_ptr<int[]> p;
-    p.reset(static_cast<const int*>(nullptr)); // expected-error {{no matching member function for call to 'reset'}}
-  }
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/swap.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/swap.pass.cpp
deleted file mode 100644
index de18865..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/swap.pass.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test swap
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-struct TT {
-  int state_;
-  static int count;
-  TT() : state_(-1) { ++count; }
-  explicit TT(int i) : state_(i) { ++count; }
-  TT(const TT& a) : state_(a.state_) { ++count; }
-  TT& operator=(const TT& a) {
-    state_ = a.state_;
-    return *this;
-  }
-  ~TT() { --count; }
-
-  friend bool operator==(const TT& x, const TT& y) {
-    return x.state_ == y.state_;
-  }
-};
-
-int TT::count = 0;
-
-template <class T>
-typename std::remove_all_extents<T>::type* newValueInit(int size,
-                                                        int new_value) {
-  typedef typename std::remove_all_extents<T>::type VT;
-  VT* p = newValue<T>(size);
-  for (int i = 0; i < size; ++i)
-    (p + i)->state_ = new_value;
-  return p;
-}
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, TT[], TT>::type VT;
-  const int expect_alive = IsArray ? 5 : 1;
-#if TEST_STD_VER >= 11
-  {
-    using U = std::unique_ptr<VT, Deleter<VT> >;
-    U u; ((void)u);
-    ASSERT_NOEXCEPT(u.swap(u));
-  }
-#endif
-  {
-    TT* p1 = newValueInit<VT>(expect_alive, 1);
-    std::unique_ptr<VT, Deleter<VT> > s1(p1, Deleter<VT>(1));
-    TT* p2 = newValueInit<VT>(expect_alive, 2);
-    std::unique_ptr<VT, Deleter<VT> > s2(p2, Deleter<VT>(2));
-    assert(s1.get() == p1);
-    assert(*s1.get() == TT(1));
-    assert(s1.get_deleter().state() == 1);
-    assert(s2.get() == p2);
-    assert(*s2.get() == TT(2));
-    assert(s2.get_deleter().state() == 2);
-    s1.swap(s2);
-    assert(s1.get() == p2);
-    assert(*s1.get() == TT(2));
-    assert(s1.get_deleter().state() == 2);
-    assert(s2.get() == p1);
-    assert(*s2.get() == TT(1));
-    assert(s2.get_deleter().state() == 1);
-    assert(TT::count == (expect_alive * 2));
-  }
-  assert(TT::count == 0);
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
deleted file mode 100644
index b05fb71..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/dereference.runtime.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test op*()
-
-#include <memory>
-#include <cassert>
-
-int main() {
-  std::unique_ptr<int[]> p(new int(3));
-  const std::unique_ptr<int[]>& cp = p;
-  (void)(*p);  // expected-error {{indirection requires pointer operand ('std::unique_ptr<int []>' invalid)}}
-  (void)(*cp); // expected-error {{indirection requires pointer operand ('const std::unique_ptr<int []>' invalid)}}
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/explicit_bool.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/explicit_bool.pass.cpp
deleted file mode 100644
index 9a6d6c6..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/explicit_bool.pass.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test op*()
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-template <class UPtr>
-void doTest(UPtr& p, bool ExpectTrue) {
-  if (p)
-    assert(ExpectTrue);
-  else
-    assert(!ExpectTrue);
-
-  if (!p)
-    assert(!ExpectTrue);
-  else
-    assert(ExpectTrue);
-}
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, int[], int>::type VT;
-  typedef std::unique_ptr<VT> U;
-  {
-    static_assert((std::is_constructible<bool, U>::value), "");
-    static_assert((std::is_constructible<bool, U const&>::value), "");
-  }
-#if TEST_STD_VER >= 11
-  {
-    static_assert(!std::is_convertible<U, bool>::value, "");
-    static_assert(!std::is_convertible<U const&, bool>::value, "");
-  }
-#endif
-  {
-    U p(newValue<VT>(1));
-    U const& cp = p;
-    doTest(p, true);
-    doTest(cp, true);
-  }
-  {
-    U p;
-    const U& cp = p;
-    doTest(p, false);
-    doTest(cp, false);
-  }
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get.pass.cpp
deleted file mode 100644
index 518e31c..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get.pass.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test get
-
-#include <memory>
-#include <cassert>
-
-#include "test_macros.h"
-#include "unique_ptr_test_helper.h"
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, int[], int>::type VT;
-  typedef const VT CVT;
-  {
-    typedef std::unique_ptr<VT> U;
-    int* p = newValue<VT>(1);
-    U s(p);
-    U const& sc = s;
-    ASSERT_SAME_TYPE(decltype(s.get()), int*);
-    ASSERT_SAME_TYPE(decltype(sc.get()), int*);
-    assert(s.get() == p);
-    assert(sc.get() == s.get());
-  }
-  {
-    typedef std::unique_ptr<CVT> U;
-    const int* p = newValue<VT>(1);
-    U s(p);
-    U const& sc = s;
-    ASSERT_SAME_TYPE(decltype(s.get()), const int*);
-    ASSERT_SAME_TYPE(decltype(sc.get()), const int*);
-    assert(s.get() == p);
-    assert(sc.get() == s.get());
-  }
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp
deleted file mode 100644
index 6a00d14..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/get_deleter.pass.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test get_deleter()
-
-#include <memory>
-#include <cassert>
-#include "test_macros.h"
-
-struct Deleter {
-  Deleter() {}
-
-  void operator()(void*) const {}
-
-  int test() { return 5; }
-  int test() const { return 6; }
-};
-
-template <bool IsArray>
-void test_basic() {
-  typedef typename std::conditional<IsArray, int[], int>::type VT;
-  {
-    std::unique_ptr<int, Deleter> p;
-    assert(p.get_deleter().test() == 5);
-  }
-  {
-    const std::unique_ptr<VT, Deleter> p;
-    assert(p.get_deleter().test() == 6);
-  }
-  {
-    typedef std::unique_ptr<VT, const Deleter&> UPtr;
-    const Deleter d;
-    UPtr p(nullptr, d);
-    const UPtr& cp = p;
-    ASSERT_SAME_TYPE(decltype(p.get_deleter()), const Deleter&);
-    ASSERT_SAME_TYPE(decltype(cp.get_deleter()), const Deleter&);
-    assert(p.get_deleter().test() == 6);
-    assert(cp.get_deleter().test() == 6);
-  }
-  {
-    typedef std::unique_ptr<VT, Deleter&> UPtr;
-    Deleter d;
-    UPtr p(nullptr, d);
-    const UPtr& cp = p;
-    ASSERT_SAME_TYPE(decltype(p.get_deleter()), Deleter&);
-    ASSERT_SAME_TYPE(decltype(cp.get_deleter()), Deleter&);
-    assert(p.get_deleter().test() == 5);
-    assert(cp.get_deleter().test() == 5);
-  }
-}
-
-int main() {
-  test_basic</*IsArray*/ false>();
-  test_basic<true>();
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.runtime.fail.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.runtime.fail.cpp
deleted file mode 100644
index d66af05..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_arrow.runtime.fail.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test op->()
-
-#include <memory>
-#include <cassert>
-
-struct V {
-  int member;
-};
-
-int main() {
-  std::unique_ptr<V[]> p;
-  std::unique_ptr<V[]> const& cp = p;
-
-  p->member; // expected-error {{member reference type 'std::unique_ptr<V []>' is not a pointer}}
-  // expected-error@-1 {{no member named 'member'}}
-
-  cp->member; // expected-error {{member reference type 'const std::unique_ptr<V []>' is not a pointer}}
-              // expected-error@-1 {{no member named 'member'}}
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.runtime.pass.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.runtime.pass.cpp
deleted file mode 100644
index b47c35a..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.runtime.pass.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test op[](size_t)
-
-#include <memory>
-#include <cassert>
-
-class A {
-  int state_;
-  static int next_;
-
-public:
-  A() : state_(++next_) {}
-  int get() const { return state_; }
-
-  friend bool operator==(const A& x, int y) { return x.state_ == y; }
-
-  A& operator=(int i) {
-    state_ = i;
-    return *this;
-  }
-};
-
-int A::next_ = 0;
-
-int main() {
-  std::unique_ptr<A[]> p(new A[3]);
-  assert(p[0] == 1);
-  assert(p[1] == 2);
-  assert(p[2] == 3);
-  p[0] = 3;
-  p[1] = 2;
-  p[2] = 1;
-  assert(p[0] == 3);
-  assert(p[1] == 2);
-  assert(p[2] == 1);
-}
diff --git a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.single.fail.cpp b/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.single.fail.cpp
deleted file mode 100644
index 529749d..0000000
--- a/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.observers/op_subscript.single.fail.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// <memory>
-
-// unique_ptr
-
-// test op[](size_t)
-
-#include <memory>
-#include <cassert>
-
-int main() {
-  std::unique_ptr<int> p(new int[3]);
-  std::unique_ptr<int> const& cp = p;
-  p[0];  // expected-error {{type 'std::unique_ptr<int>' does not provide a subscript operator}}
-  cp[1]; // expected-error {{type 'const std::unique_ptr<int>' does not provide a subscript operator}}
-}
diff --git a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
index 8830bf9..ab623bb 100644
--- a/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/char_ptr_ctor.pass.cpp
@@ -19,10 +19,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 void test_char_pointer_ctor()
 {
diff --git a/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
index 0ebf9b0..f4f8d39 100644
--- a/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/default.pass.cpp
@@ -14,10 +14,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 void test_default_ctor()
 {
diff --git a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
index 91e9441..0e47930 100644
--- a/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/string_ctor.pass.cpp
@@ -16,10 +16,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 void test_string_ctor()
 {
diff --git a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
index be9d547..3ba88ee 100644
--- a/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.cons/ull_ctor.pass.cpp
@@ -16,10 +16,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 void test_val_ctor()
 {
diff --git a/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp b/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
index 97ab0c4..bc65078 100644
--- a/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.hash/bitset.pass.cpp
@@ -30,8 +30,6 @@
     typedef std::hash<T> H;
     static_assert((std::is_same<typename H::argument_type, T>::value), "" );
     static_assert((std::is_same<typename H::result_type, std::size_t>::value), "" );
-    ASSERT_NOEXCEPT(H()(T()));
-
     H h;
     T bs(static_cast<unsigned long long>(N));
     const std::size_t result = h(bs);
diff --git a/test/std/utilities/template.bitset/bitset.members/count.pass.cpp b/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
index f6730a4..c8a14c9 100644
--- a/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/count.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
index 6d6bcd7..a25e5bd 100644
--- a/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/flip_all.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
index 9908811..18a64a2 100644
--- a/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/flip_one.pass.cpp
@@ -15,10 +15,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 std::bitset<N>
 make_bitset()
diff --git a/test/std/utilities/template.bitset/bitset.members/index.pass.cpp b/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
index c29ba31..f352475 100644
--- a/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/index.pass.cpp
@@ -14,12 +14,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp b/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
index 1ac0495..fbde548 100644
--- a/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/index_const.pass.cpp
@@ -14,12 +14,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp b/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
index 9d630b9..57b77d2 100644
--- a/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/left_shift.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
index bbbddb9..3adab77 100644
--- a/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/left_shift_eq.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
index 4f152e3..d9fbb3e 100644
--- a/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/not_all.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
index eaac191..64ca15f 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_and_eq.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
index 5215769..5b7e10d 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_eq_eq.pass.cpp
@@ -17,12 +17,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
index 98c7ce5..f2880f6 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_or_eq.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
index a707a7f..4209967 100644
--- a/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/op_xor_eq.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
index 69de45e..eed25e2 100644
--- a/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/reset_all.pass.cpp
@@ -12,12 +12,8 @@
 #include <bitset>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp b/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
index 554abde..180fa84 100644
--- a/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/right_shift.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp b/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
index 8e5edbe..47494fc 100644
--- a/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/right_shift_eq.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp b/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
index 45bc2b9..e5c3e25 100644
--- a/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/set_all.pass.cpp
@@ -12,12 +12,8 @@
 #include <bitset>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
index 084dc9f..1a2d706 100644
--- a/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/test.pass.cpp
@@ -15,10 +15,6 @@
 
 #include "test_macros.h"
 
-#if defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
-#endif
-
 template <std::size_t N>
 std::bitset<N>
 make_bitset()
diff --git a/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp b/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
index 37824d8..5b2958c 100644
--- a/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.members/to_string.pass.cpp
@@ -26,12 +26,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
index e58c720..d86a10c 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_and.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
index 244a2ba..0a8024d 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_not.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
index e601b26..449115e 100644
--- a/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
+++ b/test/std/utilities/template.bitset/bitset.operators/op_or.pass.cpp
@@ -13,12 +13,8 @@
 #include <cstdlib>
 #include <cassert>
 
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_CLANG)
+#if defined(__clang__)
 #pragma clang diagnostic ignored "-Wtautological-compare"
-#elif defined(TEST_COMPILER_C1XX)
-#pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
 #endif
 
 template <std::size_t N>
diff --git a/test/std/utilities/template.bitset/includes.pass.cpp b/test/std/utilities/template.bitset/includes.pass.cpp
index e640a1b..2e3c281 100644
--- a/test/std/utilities/template.bitset/includes.pass.cpp
+++ b/test/std/utilities/template.bitset/includes.pass.cpp
@@ -11,27 +11,22 @@
 
 #include <bitset>
 
-template <class> void test_typedef() {}
+#ifndef _LIBCPP_CSTDDEF
+#error <cstddef> has not been included
+#endif
+
+#ifndef _LIBCPP_STRING
+#error <string> has not been included
+#endif
+
+#ifndef _LIBCPP_STDEXCEPT
+#error <stdexcept> has not been included
+#endif
+
+#ifndef _LIBCPP_IOSFWD
+#error <iosfwd> has not been included
+#endif
 
 int main()
 {
-  { // test for <cstddef>
-    std::ptrdiff_t p; ((void)p);
-    std::size_t s; ((void)s);
-    std::nullptr_t np; ((void)np);
-  }
-  { // test for <string>
-    std::string s; ((void)s);
-  }
-  { // test for <stdexcept>
-    std::logic_error le("blah"); ((void)le);
-    std::runtime_error re("blah"); ((void)re);
-  }
-  { // test for <iosfwd>
-    test_typedef<std::ios>();
-    test_typedef<std::wios>();
-    test_typedef<std::istream>();
-    test_typedef<std::ostream>();
-    test_typedef<std::iostream>();
-  }
 }
diff --git a/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp b/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
index 24847dd..b6b3aee 100644
--- a/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
+++ b/test/std/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp
@@ -7,15 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 //
+// This test uses new symbols that were not defined in the libc++ shipped on
+// darwin11 and darwin12:
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 // Due to C++17 inline variables ASAN flags this test as containing an ODR
 // violation because Clock::is_steady is defined in both the dylib and this TU.
 // UNSUPPORTED: asan
 
-// Starting with C++17, Clock::is_steady is inlined (but not before LLVM-3.9!),
-// but before C++17 it requires the symbol to be present in the dylib.
-// XFAIL: availability=macosx10.7 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-// XFAIL: availability=macosx10.8 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-
 // <chrono>
 
 // high_resolution_clock
diff --git a/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp b/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
index cdb38df..6302ce6 100644
--- a/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
+++ b/test/std/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp
@@ -7,17 +7,16 @@
 //
 //===----------------------------------------------------------------------===//
 //
+// This test uses new symbols that were not defined in the libc++ shipped on
+// darwin11 and darwin12:
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
 // UNSUPPORTED: libcpp-has-no-monotonic-clock
 
 // Due to C++17 inline variables ASAN flags this test as containing an ODR
 // violation because Clock::is_steady is defined in both the dylib and this TU.
 // UNSUPPORTED: asan
 
-// Starting with C++17, Clock::is_steady is inlined (but not before LLVM-3.9!),
-// but before C++17 it requires the symbol to be present in the dylib.
-// XFAIL: availability=macosx10.7 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-// XFAIL: availability=macosx10.8 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-
 // <chrono>
 
 // steady_clock
diff --git a/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp b/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
index dfc08a3..cfbe9bd 100644
--- a/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
+++ b/test/std/utilities/time/time.clock/time.clock.system/consistency.pass.cpp
@@ -7,15 +7,15 @@
 //
 //===----------------------------------------------------------------------===//
 //
+// This test uses new symbols that were not defined in the libc++ shipped on
+// darwin11 and darwin12:
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin11
+// XFAIL: with_system_cxx_lib=x86_64-apple-darwin12
+
 // Due to C++17 inline variables ASAN flags this test as containing an ODR
 // violation because Clock::is_steady is defined in both the dylib and this TU.
 // UNSUPPORTED: asan
 
-// Starting with C++17, Clock::is_steady is inlined (but not before LLVM-3.9!),
-// but before C++17 it requires the symbol to be present in the dylib.
-// XFAIL: availability=macosx10.7 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-// XFAIL: availability=macosx10.8 && (c++98 || c++03 || c++11 || c++14 || apple-clang-7 || apple-clang-8.0)
-
 // <chrono>
 
 // system_clock
diff --git a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp
index 37753bc..c0f1014 100644
--- a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_+.pass.cpp
@@ -11,13 +11,11 @@
 
 // duration
 
-// constexpr common_type_t<duration> operator+() const;
+// duration operator+() const;
 
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -25,22 +23,11 @@
     std::chrono::minutes m2 = +m;
     assert(m.count() == m2.count());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::minutes m(3);
     constexpr std::chrono::minutes m2 = +m;
     static_assert(m.count() == m2.count(), "");
     }
 #endif
-
-// P0548
-    {
-    typedef std::chrono::duration<int, std::ratio<10,10> > D10;
-    typedef std::chrono::duration<int, std::ratio< 1, 1> > D1;
-    D10 zero(0);
-    D10 one(1);
-    static_assert( (std::is_same< decltype(+one), decltype(zero-one) >::value), "");
-    static_assert( (std::is_same< decltype(zero+one), D1>::value), "");
-    static_assert( (std::is_same< decltype(+one),     D1>::value), "");
-    }
 }
diff --git a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp
index f932eb5..00da6f6 100644
--- a/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.arithmetic/op_-.pass.cpp
@@ -11,13 +11,11 @@
 
 // duration
 
-// constexpr common_type_t<duration> operator-() const;
+// duration operator-() const;
 
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -25,23 +23,11 @@
     std::chrono::minutes m2 = -m;
     assert(m2.count() == -m.count());
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::minutes m(3);
     constexpr std::chrono::minutes m2 = -m;
     static_assert(m2.count() == -m.count(), "");
     }
 #endif
-
-// P0548
-    {
-    typedef std::chrono::duration<int, std::ratio<10,10> > D10;
-    typedef std::chrono::duration<int, std::ratio< 1, 1> > D1;
-    D10 zero(0);
-    D10 one(1);
-    static_assert( (std::is_same< decltype(-one), decltype(zero-one) >::value), "");
-    static_assert( (std::is_same< decltype(zero-one), D1>::value), "");
-    static_assert( (std::is_same< decltype(-one),     D1>::value), "");
-    static_assert( (std::is_same< decltype(+one),     D1>::value), "");
-    }
 }
diff --git a/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp
index 9ecdfc7..1c87fcd 100644
--- a/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cast/duration_cast.pass.cpp
@@ -20,8 +20,6 @@
 #include <type_traits>
 #include <cassert>
 
-#include "test_macros.h"
-
 template <class ToDuration, class FromDuration>
 void
 test(const FromDuration& f, const ToDuration& d)
@@ -45,7 +43,7 @@
          std::chrono::duration<double, std::ratio<3600> >(7265./3600));
     test(std::chrono::duration<int, std::ratio<2, 3> >(9),
          std::chrono::duration<int, std::ratio<3, 5> >(10));
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::hours h = std::chrono::duration_cast<std::chrono::hours>(std::chrono::milliseconds(7265000));
     static_assert(h.count() == 2, "");
diff --git a/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp b/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp
index 5adc62f..2d0dd94 100644
--- a/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.comparisons/op_equal.pass.cpp
@@ -24,8 +24,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -70,7 +68,7 @@
     assert(s1 == s2);
     assert(!(s1 != s2));
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::seconds s1(3);
     constexpr std::chrono::seconds s2(3);
diff --git a/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp b/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp
index 42e7982..9d87557 100644
--- a/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.comparisons/op_less.pass.cpp
@@ -34,8 +34,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -94,7 +92,7 @@
     assert( (s1 <= s2));
     assert( (s1 >= s2));
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::seconds s1(3);
     constexpr std::chrono::seconds s2(3);
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp
index c237fd7..152227d 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_exact.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     std::chrono::microseconds us = ms;
     assert(us.count() == 1000);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::milliseconds ms(1);
     constexpr std::chrono::microseconds us = ms;
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp
index 4b5042d..519b2b1 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_inexact.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     std::chrono::duration<double, std::milli> ms = us;
     assert(ms.count() == 1./1000);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::duration<double, std::micro> us(1);
     constexpr std::chrono::duration<double, std::milli> ms = us;
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp
index 8e5938b..59fefe2 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/convert_int_to_float.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     std::chrono::duration<double, std::milli> d = i;
     assert(d.count() == 3000);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::duration<int> i(3);
     constexpr std::chrono::duration<double, std::milli> d = i;
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp
index 4f7d67b..c529909 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/default.pass.cpp
@@ -18,7 +18,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 template <class D>
@@ -27,7 +26,7 @@
 {
     D d;
     assert(d.count() == typename D::rep());
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr D d2 = D();
     static_assert(d2.count() == typename D::rep(), "");
 #endif
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp
index 6ad743e..20f8161 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/rep.pass.cpp
@@ -17,7 +17,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 template <class D, class R>
@@ -26,7 +25,7 @@
 {
     D d(r);
     assert(d.count() == r);
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr D d2(R(2));
     static_assert(d2.count() == 2, "");
 #endif
diff --git a/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp b/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp
index ae745a7..b3ba9f7 100644
--- a/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.cons/rep02.pass.cpp
@@ -19,13 +19,11 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     std::chrono::duration<double> d(5);
     assert(d.count() == 5);
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     constexpr std::chrono::duration<double> d2(5);
     static_assert(d2.count() == 5, "");
 #endif
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp
index 6859ffc..6585351 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_+.pass.cpp
@@ -18,8 +18,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -46,7 +44,7 @@
     std::chrono::duration<double, std::ratio<1, 15> > r = s1 + s2;
     assert(r.count() == 75);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::seconds s1(3);
     constexpr std::chrono::seconds s2(5);
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp
index 4bf26e4..fac58b9 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_-.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -47,7 +45,7 @@
     std::chrono::duration<double, std::ratio<1, 15> > r = s1 - s2;
     assert(r.count() == -15);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::seconds s1(3);
     constexpr std::chrono::seconds s2(5);
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp
index 561516b..6b24676 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_duration.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -43,7 +41,7 @@
     std::chrono::duration<double, std::ratio<3, 5> > s2(5);
     assert(s1 / s2 == 20./3);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::nanoseconds ns1(15);
     constexpr std::chrono::nanoseconds ns2(5);
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp
index 8b667e8..3036cde 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_divide_rep.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     ns = ns / 5;
     assert(ns.count() == 3);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::nanoseconds ns(15);
     constexpr std::chrono::nanoseconds ns2 = ns / 5;
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp
index 441b053..e69f320 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_duration.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -41,7 +39,7 @@
     std::chrono::duration<int, std::ratio<1, 15> > r = s1 % s2;
     assert(r.count() == 24);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::nanoseconds ns1(15);
     constexpr std::chrono::nanoseconds ns2(6);
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp
index 537fae3..1acbe34 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_mod_rep.pass.cpp
@@ -19,8 +19,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -28,7 +26,7 @@
     ns = ns % 6;
     assert(ns.count() == 3);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::nanoseconds ns(15);
     constexpr std::chrono::nanoseconds ns2 = ns % 6;
diff --git a/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp b/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp
index 6b8c837..190e74b 100644
--- a/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.nonmember/op_times_rep.pass.cpp
@@ -24,8 +24,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
-
 int main()
 {
     {
@@ -35,7 +33,7 @@
     ns = 6 * ns;
     assert(ns.count() == 90);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     constexpr std::chrono::nanoseconds ns(3);
     constexpr std::chrono::nanoseconds ns2 = ns * 5;
diff --git a/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp
index 48c3e86..405461e 100644
--- a/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.special/max.pass.cpp
@@ -17,7 +17,6 @@
 #include <limits>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 template <class D>
@@ -28,7 +27,7 @@
     Rep max_rep = std::chrono::duration_values<Rep>::max();
     assert(D::max().count() == max_rep);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     typedef typename D::rep Rep;
     constexpr Rep max_rep = std::chrono::duration_values<Rep>::max();
diff --git a/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp
index 0d94aaa..44cd64e 100644
--- a/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.special/min.pass.cpp
@@ -17,7 +17,6 @@
 #include <limits>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 template <class D>
@@ -28,7 +27,7 @@
     Rep min_rep = std::chrono::duration_values<Rep>::min();
     assert(D::min().count() == min_rep);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     typedef typename D::rep Rep;
     constexpr Rep min_rep = std::chrono::duration_values<Rep>::min();
diff --git a/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp b/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp
index 7b312c5..18350fe 100644
--- a/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp
+++ b/test/std/utilities/time/time.duration/time.duration.special/zero.pass.cpp
@@ -16,7 +16,6 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 template <class D>
@@ -27,7 +26,7 @@
     Rep zero_rep = std::chrono::duration_values<Rep>::zero();
     assert(D::zero().count() == zero_rep);
     }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
     typedef typename D::rep Rep;
     constexpr Rep zero_rep = std::chrono::duration_values<Rep>::zero();
diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp
index e3754c1..89dc1dc 100644
--- a/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp
+++ b/test/std/utilities/time/time.traits/time.traits.duration_values/max.pass.cpp
@@ -15,7 +15,6 @@
 #include <limits>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 int main()
@@ -26,7 +25,7 @@
            std::numeric_limits<double>::max());
     assert(std::chrono::duration_values<Rep>::max() ==
            std::numeric_limits<Rep>::max());
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert(std::chrono::duration_values<int>::max() ==
            std::numeric_limits<int>::max(), "");
     static_assert(std::chrono::duration_values<double>::max() ==
diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp
index 5088373..69812bb 100644
--- a/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp
+++ b/test/std/utilities/time/time.traits/time.traits.duration_values/min.pass.cpp
@@ -15,7 +15,6 @@
 #include <limits>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 int main()
@@ -26,7 +25,7 @@
            std::numeric_limits<double>::lowest());
     assert(std::chrono::duration_values<Rep>::min() ==
            std::numeric_limits<Rep>::lowest());
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert(std::chrono::duration_values<int>::min() ==
            std::numeric_limits<int>::lowest(), "");
     static_assert(std::chrono::duration_values<double>::min() ==
diff --git a/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp b/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp
index b84a676..234b4bc 100644
--- a/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp
+++ b/test/std/utilities/time/time.traits/time.traits.duration_values/zero.pass.cpp
@@ -14,14 +14,13 @@
 #include <chrono>
 #include <cassert>
 
-#include "test_macros.h"
 #include "../../rep.h"
 
 int main()
 {
     assert(std::chrono::duration_values<int>::zero() == 0);
     assert(std::chrono::duration_values<Rep>::zero() == 0);
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     static_assert(std::chrono::duration_values<int>::zero() == 0, "");
     static_assert(std::chrono::duration_values<Rep>::zero() == 0, "");
 #endif
diff --git a/test/libcxx/utilities/tuple/tuple.tuple/empty_member.pass.cpp b/test/std/utilities/tuple/tuple.tuple/empty_member.pass.cpp
similarity index 100%
rename from test/libcxx/utilities/tuple/tuple.tuple/empty_member.pass.cpp
rename to test/std/utilities/tuple/tuple.tuple/empty_member.pass.cpp
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
index fa2f116..eeaa8a2 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp
@@ -86,6 +86,7 @@
         static_assert(!noexcept(std::tuple<NoExceptDefault, ThrowingDefault>()), "");
         static_assert(!noexcept(std::tuple<ThrowingDefault, ThrowingDefault>()), "");
     }
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
     {
         constexpr std::tuple<> t;
     }
@@ -105,4 +106,5 @@
         IllFormedDefault v(0);
         std::tuple<IllFormedDefault> t(v);
     }
+#endif
 }
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
index d7b184f..fbcda44 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/dtor.pass.cpp
@@ -15,10 +15,6 @@
 
 // ~tuple();
 
-// C++17 added:
-//   The destructor of tuple shall be a trivial destructor 
-//     if (is_trivially_destructible_v<Types> && ...) is true.
-
 #include <tuple>
 #include <string>
 #include <cassert>
diff --git a/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp b/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp
index 12968de..90476bc 100644
--- a/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp
+++ b/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <utility>
 
 // template <class T1, class T2> struct pair
@@ -44,6 +42,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     std::pair<A, B> p(std::piecewise_construct,
                       std::make_tuple(4, 'a'),
                       std::make_tuple(3.5, 6u, 2u));
@@ -52,4 +51,5 @@
     assert(p.second.get_d() == 3.5);
     assert(p.second.get_u1() == 6u);
     assert(p.second.get_u2() == 2u);
+#endif
 }
diff --git a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
index 83c55e7..2d87e7a 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/dtor.pass.cpp
@@ -15,10 +15,6 @@
 
 // ~pair()
 
-// C++17 added:
-//   The destructor of pair shall be a trivial destructor 
-//     if (is_trivially_destructible_v<T1> && is_trivially_destructible_v<T2>) is true.
-
 
 #include <utility>
 #include <type_traits>
diff --git a/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp b/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp
index c738ada..42a2666 100644
--- a/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp
+++ b/test/std/utilities/utility/pairs/pairs.pair/piecewise.pass.cpp
@@ -7,8 +7,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// UNSUPPORTED: c++98, c++03
-
 // <utility>
 
 // template <class T1, class T2> struct pair
@@ -23,6 +21,7 @@
 
 int main()
 {
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     {
         typedef std::pair<int, int*> P1;
         typedef std::pair<int*, int> P2;
@@ -32,4 +31,5 @@
         assert(p3.first == P1(3, nullptr));
         assert(p3.second == P2(nullptr, 4));
     }
+#endif  // _LIBCPP_HAS_NO_VARIADICS
 }
diff --git a/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp b/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
index 5b0f15e..77fd171 100644
--- a/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
+++ b/test/std/utilities/variant/variant.bad_variant_access/bad_variant_access.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 /*
diff --git a/test/std/utilities/variant/variant.get/get_index.pass.cpp b/test/std/utilities/variant/variant.get/get_index.pass.cpp
index 4f04f4a..bc7a566 100644
--- a/test/std/utilities/variant/variant.get/get_index.pass.cpp
+++ b/test/std/utilities/variant/variant.get/get_index.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <size_t I, class... Types>
diff --git a/test/std/utilities/variant/variant.get/get_type.pass.cpp b/test/std/utilities/variant/variant.get/get_type.pass.cpp
index 63221f6..013a081 100644
--- a/test/std/utilities/variant/variant.get/get_type.pass.cpp
+++ b/test/std/utilities/variant/variant.get/get_type.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class T, class... Types> constexpr T& get(variant<Types...>& v);
diff --git a/test/std/utilities/variant/variant.hash/hash.pass.cpp b/test/std/utilities/variant/variant.hash/hash.pass.cpp
index 2ad2184..96ef967 100644
--- a/test/std/utilities/variant/variant.hash/hash.pass.cpp
+++ b/test/std/utilities/variant/variant.hash/hash.pass.cpp
@@ -102,7 +102,6 @@
   assert(h(m1) == h(m2));
   {
     ASSERT_SAME_TYPE(decltype(h(m1)), std::size_t);
-    ASSERT_NOEXCEPT(h(m1));
     static_assert(std::is_copy_constructible<H>::value, "");
   }
   {
@@ -125,17 +124,13 @@
 struct A {};
 struct B {};
 
-namespace std {
-
 template <>
-struct hash<B> {
+struct std::hash<B> {
   size_t operator()(B const&) const {
     return 0;
   }
 };
 
-}
-
 void test_hash_variant_enabled() {
   {
     test_hash_enabled_for_type<std::variant<int> >();
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
index 29228e5..10022b1 100644
--- a/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.assign/T.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
@@ -68,28 +61,6 @@
   }
 };
 
-struct MoveCrashes {
-  int value;
-  MoveCrashes(int v = 0) noexcept : value{v} {}
-  MoveCrashes(MoveCrashes &&) noexcept { assert(false); }
-  MoveCrashes &operator=(MoveCrashes &&) noexcept { assert(false); return *this; }
-  MoveCrashes &operator=(int v) noexcept {
-    value = v;
-    return *this;
-  }
-};
-
-struct ThrowsCtorTandMove {
-  int value;
-  ThrowsCtorTandMove() : value(0) {}
-  ThrowsCtorTandMove(int) noexcept(false) { throw 42; }
-  ThrowsCtorTandMove(ThrowsCtorTandMove &&) noexcept(false) { assert(false); }
-  ThrowsCtorTandMove &operator=(int v) noexcept {
-    value = v;
-    return *this;
-  }
-};
-
 struct ThrowsAssignT {
   int value;
   ThrowsAssignT() : value(0) {}
@@ -148,7 +119,7 @@
     using V = std::variant<int, const int &>;
     static_assert(!std::is_assignable<V, int>::value, "ambiguous");
   }
-#endif // TEST_VARIANT_HAS_NO_REFERENCES
+#endif
 }
 
 void test_T_assignment_basic() {
@@ -185,7 +156,7 @@
     assert(v.index() == 2);
     assert(std::get<2>(v) == 42);
   }
-#endif // TEST_VARIANT_HAS_NO_REFERENCES
+#endif
 }
 
 void test_T_assignment_performs_construction() {
@@ -196,11 +167,9 @@
     V v(std::in_place_type<std::string>, "hello");
     try {
       v = 42;
-      assert(false);
     } catch (...) { /* ... */
     }
-    assert(v.index() == 0);
-    assert(std::get<0>(v) == "hello");
+    assert(v.valueless_by_exception());
   }
   {
     using V = std::variant<ThrowsAssignT, std::string>;
@@ -209,7 +178,7 @@
     assert(v.index() == 0);
     assert(std::get<0>(v).value == 42);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 void test_T_assignment_performs_assignment() {
@@ -251,7 +220,7 @@
     assert(v.index() == 1);
     assert(std::get<1>(v).value == 100);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 int main() {
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
index 068b9a2..d92f16f 100644
--- a/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.assign/copy.pass.cpp
@@ -10,17 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// The following compilers don't generate constexpr special members correctly.
-// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
@@ -39,6 +28,11 @@
   NoCopy &operator=(const NoCopy &) = default;
 };
 
+struct NothrowCopy {
+  NothrowCopy(const NothrowCopy &) noexcept = default;
+  NothrowCopy &operator=(const NothrowCopy &) noexcept = default;
+};
+
 struct CopyOnly {
   CopyOnly(const CopyOnly &) = default;
   CopyOnly(CopyOnly &&) = delete;
@@ -72,7 +66,7 @@
     ++alive;
     ++copy_construct;
   }
-  CopyAssign(CopyAssign &&o) noexcept : value(o.value) {
+  CopyAssign(CopyAssign &&o) : value(o.value) {
     o.value = -1;
     ++alive;
     ++move_construct;
@@ -82,7 +76,7 @@
     ++copy_assign;
     return *this;
   }
-  CopyAssign &operator=(CopyAssign &&o) noexcept {
+  CopyAssign &operator=(CopyAssign &&o) {
     value = o.value;
     o.value = -1;
     ++move_assign;
@@ -107,48 +101,6 @@
   CopyDoesThrow &operator=(const CopyDoesThrow &) noexcept(false);
 };
 
-
-struct NTCopyAssign {
-  constexpr NTCopyAssign(int v) : value(v) {}
-  NTCopyAssign(const NTCopyAssign &) = default;
-  NTCopyAssign(NTCopyAssign &&) = default;
-  NTCopyAssign &operator=(const NTCopyAssign &that) {
-    value = that.value;
-    return *this;
-  };
-  NTCopyAssign &operator=(NTCopyAssign &&) = delete;
-  int value;
-};
-
-static_assert(!std::is_trivially_copy_assignable<NTCopyAssign>::value, "");
-static_assert(std::is_copy_assignable<NTCopyAssign>::value, "");
-
-struct TCopyAssign {
-  constexpr TCopyAssign(int v) : value(v) {}
-  TCopyAssign(const TCopyAssign &) = default;
-  TCopyAssign(TCopyAssign &&) = default;
-  TCopyAssign &operator=(const TCopyAssign &) = default;
-  TCopyAssign &operator=(TCopyAssign &&) = delete;
-  int value;
-};
-
-static_assert(std::is_trivially_copy_assignable<TCopyAssign>::value, "");
-
-struct TCopyAssignNTMoveAssign {
-  constexpr TCopyAssignNTMoveAssign(int v) : value(v) {}
-  TCopyAssignNTMoveAssign(const TCopyAssignNTMoveAssign &) = default;
-  TCopyAssignNTMoveAssign(TCopyAssignNTMoveAssign &&) = default;
-  TCopyAssignNTMoveAssign &operator=(const TCopyAssignNTMoveAssign &) = default;
-  TCopyAssignNTMoveAssign &operator=(TCopyAssignNTMoveAssign &&that) {
-    value = that.value;
-    that.value = -1;
-    return *this;
-  }
-  int value;
-};
-
-static_assert(std::is_trivially_copy_assignable_v<TCopyAssignNTMoveAssign>, "");
-
 #ifndef TEST_HAS_NO_EXCEPTIONS
 struct CopyThrows {
   CopyThrows() = default;
@@ -156,17 +108,6 @@
   CopyThrows &operator=(const CopyThrows &) { throw 42; }
 };
 
-struct CopyCannotThrow {
-  static int alive;
-  CopyCannotThrow() { ++alive; }
-  CopyCannotThrow(const CopyCannotThrow &) noexcept { ++alive; }
-  CopyCannotThrow(CopyCannotThrow &&) noexcept { assert(false); }
-  CopyCannotThrow &operator=(const CopyCannotThrow &) noexcept = default;
-  CopyCannotThrow &operator=(CopyCannotThrow &&) noexcept { assert(false); return *this; }
-};
-
-int CopyCannotThrow::alive = 0;
-
 struct MoveThrows {
   static int alive;
   MoveThrows() { ++alive; }
@@ -198,7 +139,7 @@
 template <class Variant> void makeEmpty(Variant &v) {
   Variant v2(std::in_place_type<MakeEmptyT>);
   try {
-    v = std::move(v2);
+    v = v2;
     assert(false);
   } catch (...) {
     assert(v.valueless_by_exception());
@@ -223,8 +164,10 @@
     static_assert(std::is_copy_assignable<V>::value, "");
   }
   {
+    // variant only provides copy assignment when both the copy and move
+    // constructors are well formed
     using V = std::variant<int, CopyOnly>;
-    static_assert(std::is_copy_assignable<V>::value, "");
+    static_assert(!std::is_copy_assignable<V>::value, "");
   }
   {
     using V = std::variant<int, NoCopy>;
@@ -238,29 +181,6 @@
     using V = std::variant<int, MoveOnlyNT>;
     static_assert(!std::is_copy_assignable<V>::value, "");
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    using V = std::variant<int, long>;
-    static_assert(std::is_trivially_copy_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, NTCopyAssign>;
-    static_assert(!std::is_trivially_copy_assignable<V>::value, "");
-    static_assert(std::is_copy_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TCopyAssign>;
-    static_assert(std::is_trivially_copy_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TCopyAssignNTMoveAssign>;
-    static_assert(std::is_trivially_copy_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, CopyOnly>;
-    static_assert(std::is_trivially_copy_assignable<V>::value, "");
-  }
 }
 
 void test_copy_assignment_empty_empty() {
@@ -277,7 +197,7 @@
     assert(v1.valueless_by_exception());
     assert(v1.index() == std::variant_npos);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 void test_copy_assignment_non_empty_empty() {
@@ -303,7 +223,7 @@
     assert(v1.valueless_by_exception());
     assert(v1.index() == std::variant_npos);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 void test_copy_assignment_empty_non_empty() {
@@ -329,11 +249,9 @@
     assert(v1.index() == 2);
     assert(std::get<2>(v1) == "hello");
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
-template <typename T> struct Result { size_t index; T value; };
-
 void test_copy_assignment_same_index() {
   {
     using V = std::variant<int>;
@@ -381,65 +299,7 @@
     assert(v1.index() == 1);
     assert(&std::get<1>(v1) == &mref);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int>;
-        V v(43);
-        V v2(42);
-        v = v2;
-        return {v.index(), std::get<0>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 0, "");
-    static_assert(result.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        using V = std::variant<int, long, unsigned>;
-        V v(43l);
-        V v2(42l);
-        v = v2;
-        return {v.index(), std::get<1>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42l, "");
-  }
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int, TCopyAssign, unsigned>;
-        V v(std::in_place_type<TCopyAssign>, 43);
-        V v2(std::in_place_type<TCopyAssign>, 42);
-        v = v2;
-        return {v.index(), std::get<1>(v).value};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int, TCopyAssignNTMoveAssign, unsigned>;
-        V v(std::in_place_type<TCopyAssignNTMoveAssign>, 43);
-        V v2(std::in_place_type<TCopyAssignNTMoveAssign>, 42);
-        v = v2;
-        return {v.index(), std::get<1>(v).value};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
+#endif
 }
 
 void test_copy_assignment_different_index() {
@@ -471,6 +331,8 @@
   }
 #ifndef TEST_HAS_NO_EXCEPTIONS
   {
+    // Test that if copy construction throws then original value is
+    // unchanged.
     using V = std::variant<int, CopyThrows, std::string>;
     V v1(std::in_place_type<std::string>, "hello");
     V v2(std::in_place_type<CopyThrows>);
@@ -479,31 +341,24 @@
       assert(false);
     } catch (...) { /* ... */
     }
-    // Test that copy construction is used directly if move construction may throw,
-    // resulting in a valueless variant if copy throws.
-    assert(v1.valueless_by_exception());
+    assert(v1.index() == 2);
+    assert(std::get<2>(v1) == "hello");
   }
   {
+    // Test that if move construction throws then the variant is left
+    // valueless by exception.
     using V = std::variant<int, MoveThrows, std::string>;
     V v1(std::in_place_type<std::string>, "hello");
     V v2(std::in_place_type<MoveThrows>);
     assert(MoveThrows::alive == 1);
-    // Test that copy construction is used directly if move construction may throw.
-    v1 = v2;
-    assert(v1.index() == 1);
+    try {
+      v1 = v2;
+      assert(false);
+    } catch (...) { /* ... */
+    }
+    assert(v1.valueless_by_exception());
     assert(v2.index() == 1);
-    assert(MoveThrows::alive == 2);
-  }
-  {
-    // Test that direct copy construction is preferred when it cannot throw.
-    using V = std::variant<int, CopyCannotThrow, std::string>;
-    V v1(std::in_place_type<std::string>, "hello");
-    V v2(std::in_place_type<CopyCannotThrow>);
-    assert(CopyCannotThrow::alive == 1);
-    v1 = v2;
-    assert(v1.index() == 1);
-    assert(v2.index() == 1);
-    assert(CopyCannotThrow::alive == 2);
+    assert(MoveThrows::alive == 1);
   }
   {
     using V = std::variant<int, CopyThrows, std::string>;
@@ -527,60 +382,9 @@
     assert(v2.index() == 2);
     assert(std::get<2>(v2) == "hello");
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        using V = std::variant<int, long, unsigned>;
-        V v(43);
-        V v2(42l);
-        v = v2;
-        return {v.index(), std::get<1>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42l, "");
-  }
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int, TCopyAssign, unsigned>;
-        V v(std::in_place_type<unsigned>, 43);
-        V v2(std::in_place_type<TCopyAssign>, 42);
-        v = v2;
-        return {v.index(), std::get<1>(v).value};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
+#endif
 }
 
-template <size_t NewIdx, class ValueType>
-constexpr bool test_constexpr_assign_extension_imp(
-    std::variant<long, void*, int>&& v, ValueType&& new_value)
-{
-  const std::variant<long, void*, int> cp(
-      std::forward<ValueType>(new_value));
-  v = cp;
-  return v.index() == NewIdx &&
-        std::get<NewIdx>(v) == std::get<NewIdx>(cp);
-}
-
-void test_constexpr_copy_assignment_extension() {
-  // The following tests are for not-yet-standardized behavior (P0602):
-  using V = std::variant<long, void*, int>;
-  static_assert(std::is_trivially_copyable<V>::value, "");
-  static_assert(std::is_trivially_copy_assignable<V>::value, "");
-  static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
-  static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
-  static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
-  static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
-}
 
 int main() {
   test_copy_assignment_empty_empty();
@@ -590,5 +394,4 @@
   test_copy_assignment_different_index();
   test_copy_assignment_sfinae();
   test_copy_assignment_not_noexcept();
-  test_constexpr_copy_assignment_extension();
 }
diff --git a/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp b/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
index c410b4b..232d77c 100644
--- a/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.assign/move.pass.cpp
@@ -10,17 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// The following compilers don't generate constexpr special members correctly.
-// XFAIL: clang-3.5, clang-3.6, clang-3.7, clang-3.8
-// XFAIL: apple-clang-6, apple-clang-7, apple-clang-8.0
-
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
@@ -95,60 +84,6 @@
 int MoveAssign::move_construct = 0;
 int MoveAssign::move_assign = 0;
 
-struct NTMoveAssign {
-  constexpr NTMoveAssign(int v) : value(v) {}
-  NTMoveAssign(const NTMoveAssign &) = default;
-  NTMoveAssign(NTMoveAssign &&) = default;
-  NTMoveAssign &operator=(const NTMoveAssign &that) = default;
-  NTMoveAssign &operator=(NTMoveAssign &&that) {
-    value = that.value;
-    that.value = -1;
-    return *this;
-  };
-  int value;
-};
-
-static_assert(!std::is_trivially_move_assignable<NTMoveAssign>::value, "");
-static_assert(std::is_move_assignable<NTMoveAssign>::value, "");
-
-struct TMoveAssign {
-  constexpr TMoveAssign(int v) : value(v) {}
-  TMoveAssign(const TMoveAssign &) = delete;
-  TMoveAssign(TMoveAssign &&) = default;
-  TMoveAssign &operator=(const TMoveAssign &) = delete;
-  TMoveAssign &operator=(TMoveAssign &&) = default;
-  int value;
-};
-
-static_assert(std::is_trivially_move_assignable<TMoveAssign>::value, "");
-
-struct TMoveAssignNTCopyAssign {
-  constexpr TMoveAssignNTCopyAssign(int v) : value(v) {}
-  TMoveAssignNTCopyAssign(const TMoveAssignNTCopyAssign &) = default;
-  TMoveAssignNTCopyAssign(TMoveAssignNTCopyAssign &&) = default;
-  TMoveAssignNTCopyAssign &operator=(const TMoveAssignNTCopyAssign &that) {
-    value = that.value;
-    return *this;
-  }
-  TMoveAssignNTCopyAssign &operator=(TMoveAssignNTCopyAssign &&) = default;
-  int value;
-};
-
-static_assert(std::is_trivially_move_assignable_v<TMoveAssignNTCopyAssign>, "");
-
-struct TrivialCopyNontrivialMove {
-  TrivialCopyNontrivialMove(TrivialCopyNontrivialMove const&) = default;
-  TrivialCopyNontrivialMove(TrivialCopyNontrivialMove&&) noexcept {}
-  TrivialCopyNontrivialMove& operator=(TrivialCopyNontrivialMove const&) = default;
-  TrivialCopyNontrivialMove& operator=(TrivialCopyNontrivialMove&&) noexcept {
-    return *this;
-  }
-};
-
-static_assert(std::is_trivially_copy_assignable_v<TrivialCopyNontrivialMove>, "");
-static_assert(!std::is_trivially_move_assignable_v<TrivialCopyNontrivialMove>, "");
-
-
 void test_move_assignment_noexcept() {
   {
     using V = std::variant<int>;
@@ -182,8 +117,10 @@
     static_assert(std::is_move_assignable<V>::value, "");
   }
   {
+    // variant only provides move assignment when both the move constructor
+    // and move assignment operator are well formed.
     using V = std::variant<int, CopyOnly>;
-    static_assert(std::is_move_assignable<V>::value, "");
+    static_assert(!std::is_move_assignable<V>::value, "");
   }
   {
     using V = std::variant<int, NoCopy>;
@@ -203,33 +140,6 @@
     using V = std::variant<int, MoveAssignOnly>;
     static_assert(!std::is_move_assignable<V>::value, "");
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    using V = std::variant<int, long>;
-    static_assert(std::is_trivially_move_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, NTMoveAssign>;
-    static_assert(!std::is_trivially_move_assignable<V>::value, "");
-    static_assert(std::is_move_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TMoveAssign>;
-    static_assert(std::is_trivially_move_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TMoveAssignNTCopyAssign>;
-    static_assert(std::is_trivially_move_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TrivialCopyNontrivialMove>;
-    static_assert(!std::is_trivially_move_assignable<V>::value, "");
-  }
-  {
-    using V = std::variant<int, CopyOnly>;
-    static_assert(std::is_trivially_move_assignable<V>::value, "");
-  }
 }
 
 void test_move_assignment_empty_empty() {
@@ -246,7 +156,7 @@
     assert(v1.valueless_by_exception());
     assert(v1.index() == std::variant_npos);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 void test_move_assignment_non_empty_empty() {
@@ -272,7 +182,7 @@
     assert(v1.valueless_by_exception());
     assert(v1.index() == std::variant_npos);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 void test_move_assignment_empty_non_empty() {
@@ -298,11 +208,9 @@
     assert(v1.index() == 2);
     assert(std::get<2>(v1) == "hello");
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
-template <typename T> struct Result { size_t index; T value; };
-
 void test_move_assignment_same_index() {
   {
     using V = std::variant<int>;
@@ -349,51 +257,7 @@
     assert(v1.index() == 1);
     assert(&std::get<1>(v1) == &mref);
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int>;
-        V v(43);
-        V v2(42);
-        v = std::move(v2);
-        return {v.index(), std::get<0>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 0, "");
-    static_assert(result.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        using V = std::variant<int, long, unsigned>;
-        V v(43l);
-        V v2(42l);
-        v = std::move(v2);
-        return {v.index(), std::get<1>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42l, "");
-  }
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        using V = std::variant<int, TMoveAssign, unsigned>;
-        V v(std::in_place_type<TMoveAssign>, 43);
-        V v2(std::in_place_type<TMoveAssign>, 42);
-        v = std::move(v2);
-        return {v.index(), std::get<1>(v).value};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
+#endif
 }
 
 void test_move_assignment_different_index() {
@@ -441,60 +305,7 @@
     assert(v1.index() == 2);
     assert(std::get<2>(v1) == "hello");
   }
-#endif // TEST_HAS_NO_EXCEPTIONS
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        using V = std::variant<int, long, unsigned>;
-        V v(43);
-        V v2(42l);
-        v = std::move(v2);
-        return {v.index(), std::get<1>(v)};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42l, "");
-  }
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        using V = std::variant<int, TMoveAssign, unsigned>;
-        V v(std::in_place_type<unsigned>, 43);
-        V v2(std::in_place_type<TMoveAssign>, 42);
-        v = std::move(v2);
-        return {v.index(), std::get<1>(v).value};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
-}
-
-template <size_t NewIdx, class ValueType>
-constexpr bool test_constexpr_assign_extension_imp(
-    std::variant<long, void*, int>&& v, ValueType&& new_value)
-{
-  std::variant<long, void*, int> v2(
-      std::forward<ValueType>(new_value));
-  const auto cp = v2;
-  v = std::move(v2);
-  return v.index() == NewIdx &&
-        std::get<NewIdx>(v) == std::get<NewIdx>(cp);
-}
-
-void test_constexpr_move_assignment_extension() {
-  // The following tests are for not-yet-standardized behavior (P0602):
-  using V = std::variant<long, void*, int>;
-  static_assert(std::is_trivially_copyable<V>::value, "");
-  static_assert(std::is_trivially_move_assignable<V>::value, "");
-  static_assert(test_constexpr_assign_extension_imp<0>(V(42l), 101l), "");
-  static_assert(test_constexpr_assign_extension_imp<0>(V(nullptr), 101l), "");
-  static_assert(test_constexpr_assign_extension_imp<1>(V(42l), nullptr), "");
-  static_assert(test_constexpr_assign_extension_imp<2>(V(42l), 101), "");
+#endif
 }
 
 int main() {
@@ -505,5 +316,4 @@
   test_move_assignment_different_index();
   test_move_assignment_sfinae();
   test_move_assignment_noexcept();
-  test_constexpr_move_assignment_extension();
 }
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 f311343..18216c6 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
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
@@ -28,7 +21,6 @@
 #include <variant>
 
 #include "test_macros.h"
-#include "test_workarounds.h"
 
 struct NonT {
   NonT(int v) : value(v) {}
@@ -51,34 +43,6 @@
   MoveOnlyNT(MoveOnlyNT &&) {}
 };
 
-struct NTCopy {
-  constexpr NTCopy(int v) : value(v) {}
-  NTCopy(const NTCopy &that) : value(that.value) {}
-  NTCopy(NTCopy &&) = delete;
-  int value;
-};
-
-static_assert(!std::is_trivially_copy_constructible<NTCopy>::value, "");
-static_assert(std::is_copy_constructible<NTCopy>::value, "");
-
-struct TCopy {
-  constexpr TCopy(int v) : value(v) {}
-  TCopy(TCopy const &) = default;
-  TCopy(TCopy &&) = delete;
-  int value;
-};
-
-static_assert(std::is_trivially_copy_constructible<TCopy>::value, "");
-
-struct TCopyNTMove {
-  constexpr TCopyNTMove(int v) : value(v) {}
-  TCopyNTMove(const TCopyNTMove&) = default;
-  TCopyNTMove(TCopyNTMove&& that) : value(that.value) { that.value = -1; }
-  int value;
-};
-
-static_assert(std::is_trivially_copy_constructible<TCopyNTMove>::value, "");
-
 #ifndef TEST_HAS_NO_EXCEPTIONS
 struct MakeEmptyT {
   static int alive;
@@ -99,7 +63,7 @@
 template <class Variant> void makeEmpty(Variant &v) {
   Variant v2(std::in_place_type<MakeEmptyT>);
   try {
-    v = std::move(v2);
+    v = v2;
     assert(false);
   } catch (...) {
     assert(v.valueless_by_exception());
@@ -124,25 +88,6 @@
     using V = std::variant<int, MoveOnlyNT>;
     static_assert(!std::is_copy_constructible<V>::value, "");
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    using V = std::variant<int, long>;
-    static_assert(std::is_trivially_copy_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, NTCopy>;
-    static_assert(!std::is_trivially_copy_constructible<V>::value, "");
-    static_assert(std::is_copy_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TCopy>;
-    static_assert(std::is_trivially_copy_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TCopyNTMove>;
-    static_assert(std::is_trivially_copy_constructible<V>::value, "");
-  }
 }
 
 void test_copy_ctor_basic() {
@@ -172,50 +117,6 @@
     assert(v2.index() == 1);
     assert(std::get<1>(v2).value == 42);
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    constexpr std::variant<int> v(std::in_place_index<0>, 42);
-    static_assert(v.index() == 0, "");
-    constexpr std::variant<int> v2 = v;
-    static_assert(v2.index() == 0, "");
-    static_assert(std::get<0>(v2) == 42, "");
-  }
-  {
-    constexpr std::variant<int, long> v(std::in_place_index<1>, 42);
-    static_assert(v.index() == 1, "");
-    constexpr std::variant<int, long> v2 = v;
-    static_assert(v2.index() == 1, "");
-    static_assert(std::get<1>(v2) == 42, "");
-  }
-  {
-    constexpr std::variant<TCopy> v(std::in_place_index<0>, 42);
-    static_assert(v.index() == 0, "");
-    constexpr std::variant<TCopy> v2(v);
-    static_assert(v2.index() == 0, "");
-    static_assert(std::get<0>(v2).value == 42, "");
-  }
-  {
-    constexpr std::variant<int, TCopy> v(std::in_place_index<1>, 42);
-    static_assert(v.index() == 1, "");
-    constexpr std::variant<int, TCopy> v2(v);
-    static_assert(v2.index() == 1, "");
-    static_assert(std::get<1>(v2).value == 42, "");
-  }
-  {
-    constexpr std::variant<TCopyNTMove> v(std::in_place_index<0>, 42);
-    static_assert(v.index() == 0, "");
-    constexpr std::variant<TCopyNTMove> v2(v);
-    static_assert(v2.index() == 0, "");
-    static_assert(std::get<0>(v2).value == 42, "");
-  }
-  {
-    constexpr std::variant<int, TCopyNTMove> v(std::in_place_index<1>, 42);
-    static_assert(v.index() == 1, "");
-    constexpr std::variant<int, TCopyNTMove> v2(v);
-    static_assert(v2.index() == 1, "");
-    static_assert(std::get<1>(v2).value == 42, "");
-  }
 }
 
 void test_copy_ctor_valueless_by_exception() {
@@ -226,7 +127,7 @@
   const V &cv1 = v1;
   V v(cv1);
   assert(v.valueless_by_exception());
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 template <size_t Idx>
@@ -236,24 +137,18 @@
   auto v2 = v;
   return v2.index() == v.index() &&
          v2.index() == Idx &&
-         std::get<Idx>(v2) == std::get<Idx>(v);
+        std::get<Idx>(v2) == std::get<Idx>(v);
 }
 
 void test_constexpr_copy_ctor_extension() {
-  // NOTE: This test is for not yet standardized behavior. (P0602)
+#ifdef _LIBCPP_VERSION
   using V = std::variant<long, void*, const int>;
-#ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
-  static_assert(std::is_trivially_destructible<V>::value, "");
-  static_assert(std::is_trivially_copy_constructible<V>::value, "");
-  static_assert(std::is_trivially_move_constructible<V>::value, "");
-  static_assert(!std::is_copy_assignable<V>::value, "");
-  static_assert(!std::is_move_assignable<V>::value, "");
-#else // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_copyable<V>::value, "");
-#endif // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
+  static_assert(std::is_trivially_copy_constructible<V>::value, "");
   static_assert(test_constexpr_copy_ctor_extension_imp<0>(V(42l)), "");
   static_assert(test_constexpr_copy_ctor_extension_imp<1>(V(nullptr)), "");
   static_assert(test_constexpr_copy_ctor_extension_imp<2>(V(101)), "");
+#endif
 }
 
 int main() {
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
index 05a09db..a4a86ff 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/default.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
index af6c662..1811572 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_index_args.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
index ec2730e..a023f02 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/in_place_type_args.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
diff --git a/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp b/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
index 6b39206..66f67fe 100644
--- a/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.ctor/move.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
@@ -29,7 +22,6 @@
 #include <variant>
 
 #include "test_macros.h"
-#include "test_workarounds.h"
 
 struct ThrowsMove {
   ThrowsMove(ThrowsMove &&) noexcept(false) {}
@@ -53,34 +45,6 @@
   MoveOnlyNT(MoveOnlyNT &&other) : value(other.value) { other.value = -1; }
 };
 
-struct NTMove {
-  constexpr NTMove(int v) : value(v) {}
-  NTMove(const NTMove &) = delete;
-  NTMove(NTMove &&that) : value(that.value) { that.value = -1; }
-  int value;
-};
-
-static_assert(!std::is_trivially_move_constructible<NTMove>::value, "");
-static_assert(std::is_move_constructible<NTMove>::value, "");
-
-struct TMove {
-  constexpr TMove(int v) : value(v) {}
-  TMove(const TMove &) = delete;
-  TMove(TMove &&) = default;
-  int value;
-};
-
-static_assert(std::is_trivially_move_constructible<TMove>::value, "");
-
-struct TMoveNTCopy {
-  constexpr TMoveNTCopy(int v) : value(v) {}
-  TMoveNTCopy(const TMoveNTCopy& that) : value(that.value) {}
-  TMoveNTCopy(TMoveNTCopy&&) = default;
-  int value;
-};
-
-static_assert(std::is_trivially_move_constructible<TMoveNTCopy>::value, "");
-
 #ifndef TEST_HAS_NO_EXCEPTIONS
 struct MakeEmptyT {
   static int alive;
@@ -101,7 +65,7 @@
 template <class Variant> void makeEmpty(Variant &v) {
   Variant v2(std::in_place_type<MakeEmptyT>);
   try {
-    v = std::move(v2);
+    v = v2;
     assert(false);
   } catch (...) {
     assert(v.valueless_by_exception());
@@ -145,30 +109,8 @@
     using V = std::variant<int, NoCopy>;
     static_assert(!std::is_move_constructible<V>::value, "");
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    using V = std::variant<int, long>;
-    static_assert(std::is_trivially_move_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, NTMove>;
-    static_assert(!std::is_trivially_move_constructible<V>::value, "");
-    static_assert(std::is_move_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TMove>;
-    static_assert(std::is_trivially_move_constructible<V>::value, "");
-  }
-  {
-    using V = std::variant<int, TMoveNTCopy>;
-    static_assert(std::is_trivially_move_constructible<V>::value, "");
-  }
 }
 
-template <typename T>
-struct Result { size_t index; T value; };
-
 void test_move_ctor_basic() {
   {
     std::variant<int> v(std::in_place_index<0>, 42);
@@ -212,80 +154,6 @@
     assert(std::get<1>(v).value == -1);
     assert(std::get<1>(v2).value == 42);
   }
-
-  // The following tests are for not-yet-standardized behavior (P0602):
-  {
-    struct {
-      constexpr Result<int> operator()() const {
-        std::variant<int> v(std::in_place_index<0>, 42);
-        std::variant<int> v2 = std::move(v);
-        return {v2.index(), std::get<0>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 0, "");
-    static_assert(result.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<long> operator()() const {
-        std::variant<int, long> v(std::in_place_index<1>, 42);
-        std::variant<int, long> v2 = std::move(v);
-        return {v2.index(), std::get<1>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<TMove> operator()() const {
-        std::variant<TMove> v(std::in_place_index<0>, 42);
-        std::variant<TMove> v2(std::move(v));
-        return {v2.index(), std::get<0>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 0, "");
-    static_assert(result.value.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<TMove> operator()() const {
-        std::variant<int, TMove> v(std::in_place_index<1>, 42);
-        std::variant<int, TMove> v2(std::move(v));
-        return {v2.index(), std::get<1>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<TMoveNTCopy> operator()() const {
-        std::variant<TMoveNTCopy> v(std::in_place_index<0>, 42);
-        std::variant<TMoveNTCopy> v2(std::move(v));
-        return {v2.index(), std::get<0>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 0, "");
-    static_assert(result.value.value == 42, "");
-  }
-  {
-    struct {
-      constexpr Result<TMoveNTCopy> operator()() const {
-        std::variant<int, TMoveNTCopy> v(std::in_place_index<1>, 42);
-        std::variant<int, TMoveNTCopy> v2(std::move(v));
-        return {v2.index(), std::get<1>(std::move(v2))};
-      }
-    } test;
-    constexpr auto result = test();
-    static_assert(result.index == 1, "");
-    static_assert(result.value.value == 42, "");
-  }
 }
 
 void test_move_ctor_valueless_by_exception() {
@@ -295,7 +163,7 @@
   makeEmpty(v1);
   V v(std::move(v1));
   assert(v.valueless_by_exception());
-#endif // TEST_HAS_NO_EXCEPTIONS
+#endif
 }
 
 template <size_t Idx>
@@ -310,21 +178,14 @@
 }
 
 void test_constexpr_move_ctor_extension() {
-  // NOTE: This test is for not yet standardized behavior. (P0602)
+#ifdef _LIBCPP_VERSION
   using V = std::variant<long, void*, const int>;
-#ifdef TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
-  static_assert(std::is_trivially_destructible<V>::value, "");
-  static_assert(std::is_trivially_copy_constructible<V>::value, "");
-  static_assert(std::is_trivially_move_constructible<V>::value, "");
-  static_assert(!std::is_copy_assignable<V>::value, "");
-  static_assert(!std::is_move_assignable<V>::value, "");
-#else // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_copyable<V>::value, "");
-#endif // TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE
   static_assert(std::is_trivially_move_constructible<V>::value, "");
   static_assert(test_constexpr_ctor_extension_imp<0>(V(42l)), "");
   static_assert(test_constexpr_ctor_extension_imp<1>(V(nullptr)), "");
   static_assert(test_constexpr_ctor_extension_imp<2>(V(101)), "");
+#endif
 }
 
 int main() {
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
index 20848db..8f694cf 100644
--- a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_args.pass.cpp
@@ -10,19 +10,11 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
 
-// template <size_t I, class ...Args>
-//   variant_alternative_t<I, variant<Types...>>& emplace(Args&&... args);
+// template <size_t I, class ...Args> void emplace(Args&&... args);
 
 #include <cassert>
 #include <string>
@@ -93,14 +85,10 @@
   {
     using V = std::variant<int>;
     V v(42);
-    auto& ref1 = v.emplace<0>();
-    static_assert(std::is_same_v<int&, decltype(ref1)>, "");
+    v.emplace<0>();
     assert(std::get<0>(v) == 0);
-    assert(&ref1 == &std::get<0>(v));
-    auto& ref2 = v.emplace<0>(42);
-    static_assert(std::is_same_v<int&, decltype(ref2)>, "");
+    v.emplace<0>(42);
     assert(std::get<0>(v) == 42);
-    assert(&ref2 == &std::get<0>(v));
   }
   {
     using V =
@@ -108,19 +96,13 @@
     const int x = 100;
     V v(std::in_place_index<0>, -1);
     // default emplace a value
-    auto& ref1 = v.emplace<1>();
-    static_assert(std::is_same_v<long&, decltype(ref1)>, "");
+    v.emplace<1>();
     assert(std::get<1>(v) == 0);
-    assert(&ref1 == &std::get<1>(v));
-    auto& ref2 = v.emplace<2>(&x);
-    static_assert(std::is_same_v<const void*&, decltype(ref2)>, "");
+    v.emplace<2>(&x);
     assert(std::get<2>(v) == &x);
-    assert(&ref2 == &std::get<2>(v));
     // emplace with multiple args
-    auto& ref3 = v.emplace<4>(3, 'a');
-    static_assert(std::is_same_v<std::string&, decltype(ref3)>, "");
+    v.emplace<4>(3, 'a');
     assert(std::get<4>(v) == "aaa");
-    assert(&ref3 == &std::get<4>(v));
   }
 #if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
   {
@@ -131,30 +113,20 @@
     int z = 43;
     V v(std::in_place_index<0>, -1);
     // default emplace a value
-    auto& ref1 = v.emplace<1>();
-    static_assert(std::is_same_v<long&, decltype(ref1)>, "");
+    v.emplace<1>();
     assert(std::get<1>(v) == 0);
-    assert(&ref1 == &std::get<1>(v));
     // emplace a reference
-    auto& ref2 = v.emplace<2>(x);
-    static_assert(std::is_same_v<&, decltype(ref)>, "");
+    v.emplace<2>(x);
     assert(&std::get<2>(v) == &x);
-    assert(&ref2 == &std::get<2>(v));
     // emplace an rvalue reference
-    auto& ref3 = v.emplace<3>(std::move(y));
-    static_assert(std::is_same_v<&, decltype(ref)>, "");
+    v.emplace<3>(std::move(y));
     assert(&std::get<3>(v) == &y);
-    assert(&ref3 == &std::get<3>(v));
     // re-emplace a new reference over the active member
-    auto& ref4 = v.emplace<3>(std::move(z));
-    static_assert(std::is_same_v<&, decltype(ref)>, "");
+    v.emplace<3>(std::move(z));
     assert(&std::get<3>(v) == &z);
-    assert(&ref4 == &std::get<3>(v));
     // emplace with multiple args
-    auto& ref5 = v.emplace<5>(3, 'a');
-    static_assert(std::is_same_v<std::string&, decltype(ref5)>, "");
+    v.emplace<5>(3, 'a');
     assert(std::get<5>(v) == "aaa");
-    assert(&ref5 == &std::get<5>(v));
   }
 #endif
 }
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
index 28a0c58..f466b16 100644
--- a/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_index_init_list_args.pass.cpp
@@ -10,19 +10,12 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
 
 // template <size_t I, class U, class ...Args>
-//   variant_alternative_t<I, variant<Types...>>& emplace(initializer_list<U> il,Args&&... args);
+// void emplace(initializer_list<U> il,Args&&... args);
 
 #include <cassert>
 #include <string>
@@ -77,19 +70,13 @@
 void test_basic() {
   using V = std::variant<int, InitList, InitListArg, TestTypes::NoCtors>;
   V v;
-  auto& ref1 = v.emplace<1>({1, 2, 3});
-  static_assert(std::is_same_v<InitList&, decltype(ref1)>, "");
+  v.emplace<1>({1, 2, 3});
   assert(std::get<1>(v).size == 3);
-  assert(&ref1 == &std::get<1>(v));
-  auto& ref2 = v.emplace<2>({1, 2, 3, 4}, 42);
-  static_assert(std::is_same_v<InitListArg&, decltype(ref2)>, "");
+  v.emplace<2>({1, 2, 3, 4}, 42);
   assert(std::get<2>(v).size == 4);
   assert(std::get<2>(v).value == 42);
-  assert(&ref2 == &std::get<2>(v));
-  auto& ref3 = v.emplace<1>({1});
-  static_assert(std::is_same_v<InitList&, decltype(ref3)>, "");
+  v.emplace<1>({1});
   assert(std::get<1>(v).size == 1);
-  assert(&ref3 == &std::get<1>(v));
 }
 
 int main() {
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
index 923ffd3..4ca2cc4 100644
--- a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_args.pass.cpp
@@ -10,18 +10,11 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
 
-// template <class T, class ...Args> T& emplace(Args&&... args);
+// template <class T, class ...Args> void emplace(Args&&... args);
 
 #include <cassert>
 #include <string>
@@ -93,14 +86,10 @@
   {
     using V = std::variant<int>;
     V v(42);
-    auto& ref1 = v.emplace<int>();
-    static_assert(std::is_same_v<int&, decltype(ref1)>, "");
+    v.emplace<int>();
     assert(std::get<0>(v) == 0);
-    assert(&ref1 == &std::get<0>(v));
-    auto& ref2 = v.emplace<int>(42);
-    static_assert(std::is_same_v<int&, decltype(ref2)>, "");
+    v.emplace<int>(42);
     assert(std::get<0>(v) == 42);
-    assert(&ref2 == &std::get<0>(v));
   }
   {
     using V =
@@ -108,19 +97,13 @@
     const int x = 100;
     V v(std::in_place_type<int>, -1);
     // default emplace a value
-    auto& ref1 = v.emplace<long>();
-    static_assert(std::is_same_v<long&, decltype(ref1)>, "");
+    v.emplace<long>();
     assert(std::get<1>(v) == 0);
-    assert(&ref1 == &std::get<1>(v));
-    auto& ref2 = v.emplace<const void *>(&x);
-    static_assert(std::is_same_v<const void *&, decltype(ref2)>, "");
+    v.emplace<const void *>(&x);
     assert(std::get<2>(v) == &x);
-    assert(&ref2 == &std::get<2>(v));
     // emplace with multiple args
-    auto& ref3 = v.emplace<std::string>(3, 'a');
-    static_assert(std::is_same_v<std::string&, decltype(ref3)>, "");
+    v.emplace<std::string>(3, 'a');
     assert(std::get<4>(v) == "aaa");
-    assert(&ref3 == &std::get<4>(v));
   }
 #if !defined(TEST_VARIANT_HAS_NO_REFERENCES)
   {
@@ -131,30 +114,20 @@
     int z = 43;
     V v(std::in_place_index<0>, -1);
     // default emplace a value
-    auto& ref1 = v.emplace<long>();
-    static_assert(std::is_same_v<long&, decltype(ref1)>, "");
+    v.emplace<long>();
     assert(std::get<long>(v) == 0);
-    assert(&ref1 == &std::get<long>(v));
     // emplace a reference
-    auto& ref2 = v.emplace<const int &>(x);
-    static_assert(std::is_same_v<const int&, decltype(ref2)>, "");
+    v.emplace<const int &>(x);
     assert(&std::get<const int &>(v) == &x);
-    assert(&ref2 == &std::get<const int &>(v));
     // emplace an rvalue reference
-    auto& ref3 = v.emplace<int &&>(std::move(y));
-    static_assert(std::is_same_v<int &&, decltype(ref3)>, "");
+    v.emplace<int &&>(std::move(y));
     assert(&std::get<int &&>(v) == &y);
-    assert(&ref3 == &std::get<int &&>(v));
     // re-emplace a new reference over the active member
-    auto& ref4 = v.emplace<int &&>(std::move(z));
-    static_assert(std::is_same_v<int &, decltype(ref4)>, "");
+    v.emplace<int &&>(std::move(z));
     assert(&std::get<int &&>(v) == &z);
-    assert(&ref4 == &std::get<int &&>(v));
     // emplace with multiple args
-    auto& ref5 = v.emplace<std::string>(3, 'a');
-    static_assert(std::is_same_v<std::string&, decltype(ref5)>, "");
+    v.emplace<std::string>(3, 'a');
     assert(std::get<std::string>(v) == "aaa");
-    assert(&ref5 == &std::get<std::string>(v));
   }
 #endif
 }
diff --git a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
index c01d333..b2be8ac 100644
--- a/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.mod/emplace_type_init_list_args.pass.cpp
@@ -10,19 +10,12 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
 
 // template <class T, class U, class ...Args>
-//   T& emplace(initializer_list<U> il,Args&&... args);
+// void emplace(initializer_list<U> il,Args&&... args);
 
 #include <cassert>
 #include <string>
@@ -77,19 +70,13 @@
 void test_basic() {
   using V = std::variant<int, InitList, InitListArg, TestTypes::NoCtors>;
   V v;
-  auto& ref1 = v.emplace<InitList>({1, 2, 3});
-  static_assert(std::is_same_v<InitList&,decltype(ref1)>, "");
+  v.emplace<InitList>({1, 2, 3});
   assert(std::get<InitList>(v).size == 3);
-  assert(&ref1 == &std::get<InitList>(v));
-  auto& ref2 = v.emplace<InitListArg>({1, 2, 3, 4}, 42);
-  static_assert(std::is_same_v<InitListArg&,decltype(ref2)>, "");
+  v.emplace<InitListArg>({1, 2, 3, 4}, 42);
   assert(std::get<InitListArg>(v).size == 4);
   assert(std::get<InitListArg>(v).value == 42);
-  assert(&ref2 == &std::get<InitListArg>(v));
-  auto& ref3 = v.emplace<InitList>({1});
-  static_assert(std::is_same_v<InitList&,decltype(ref3)>, "");
+  v.emplace<InitList>({1});
   assert(std::get<InitList>(v).size == 1);
-  assert(&ref3 == &std::get<InitList>(v));
 }
 
 int main() {
diff --git a/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp b/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
index b81b3ff..48cda22 100644
--- a/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
+++ b/test/std/utilities/variant/variant.variant/variant.swap/swap.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 
 // template <class ...Types> class variant;
diff --git a/test/std/utilities/variant/variant.visit/visit.pass.cpp b/test/std/utilities/variant/variant.visit/visit.pass.cpp
index 316f2d2..408a65c 100644
--- a/test/std/utilities/variant/variant.visit/visit.pass.cpp
+++ b/test/std/utilities/variant/variant.visit/visit.pass.cpp
@@ -10,13 +10,6 @@
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14
 
-// XFAIL: with_system_cxx_lib=macosx10.12
-// XFAIL: with_system_cxx_lib=macosx10.11
-// XFAIL: with_system_cxx_lib=macosx10.10
-// XFAIL: with_system_cxx_lib=macosx10.9
-// XFAIL: with_system_cxx_lib=macosx10.7
-// XFAIL: with_system_cxx_lib=macosx10.8
-
 // <variant>
 // template <class Visitor, class... Variants>
 // constexpr see below visit(Visitor&& vis, Variants&&... vars);
@@ -94,16 +87,6 @@
   using Fn = ForwardingCallObject;
   Fn obj{};
   const Fn &cobj = obj;
-  { // test call operator forwarding - no variant
-    std::visit(obj);
-    assert(Fn::check_call<>(CT_NonConst | CT_LValue));
-    std::visit(cobj);
-    assert(Fn::check_call<>(CT_Const | CT_LValue));
-    std::visit(std::move(obj));
-    assert(Fn::check_call<>(CT_NonConst | CT_RValue));
-    std::visit(std::move(cobj));
-    assert(Fn::check_call<>(CT_Const | CT_RValue));
-  }
   { // test call operator forwarding - single variant, single arg
     using V = std::variant<int>;
     V v(42);
diff --git a/test/support/Counter.h b/test/support/Counter.h
index 602f35f..eb6e04e 100644
--- a/test/support/Counter.h
+++ b/test/support/Counter.h
@@ -12,8 +12,6 @@
 
 #include <functional> // for std::hash
 
-#include "test_macros.h"
-
 struct Counter_base { static int gConstructed; };
 
 template <typename T>
@@ -24,7 +22,7 @@
     Counter(const T &data) : data_(data)            { ++gConstructed; }
     Counter(const Counter& rhs) : data_(rhs.data_)  { ++gConstructed; }
     Counter& operator=(const Counter& rhs)          { ++gConstructed; data_ = rhs.data_; return *this; }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     Counter(Counter&& rhs) : data_(std::move(rhs.data_))  { ++gConstructed; }
     Counter& operator=(Counter&& rhs) { ++gConstructed; data_ = std::move(rhs.data_); return *this; }
 #endif
diff --git a/test/support/MoveOnly.h b/test/support/MoveOnly.h
index 4afa8ae..0ffb4ff 100644
--- a/test/support/MoveOnly.h
+++ b/test/support/MoveOnly.h
@@ -12,7 +12,7 @@
 
 #include "test_macros.h"
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 #include <cstddef>
 #include <functional>
@@ -49,6 +49,6 @@
 
 }
 
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 #endif  // MOVEONLY_H
diff --git a/test/support/allocators.h b/test/support/allocators.h
index b1eea8d..4aa467f 100644
--- a/test/support/allocators.h
+++ b/test/support/allocators.h
@@ -15,7 +15,7 @@
 
 #include "test_macros.h"
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 template <class T>
 class A1
@@ -186,6 +186,6 @@
     return !(x == y);
 }
 
-#endif  // TEST_STD_VER >= 11
+#endif  // _LIBCPP_HAS_NO_RVALUE_REFERENCES
 
 #endif  // ALLOCATORS_H
diff --git a/test/support/archetypes.hpp b/test/support/archetypes.hpp
index 533f586..f442b59 100644
--- a/test/support/archetypes.hpp
+++ b/test/support/archetypes.hpp
@@ -5,7 +5,6 @@
 #include <cassert>
 
 #include "test_macros.h"
-#include "test_workarounds.h"
 
 #if TEST_STD_VER >= 11
 
@@ -15,9 +14,7 @@
 struct DepType : T {};
 
 struct NullBase {
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
   NullBase() = default;
   NullBase(NullBase const&) = default;
   NullBase& operator=(NullBase const&) = default;
@@ -84,9 +81,7 @@
       ++assigned; ++value_assigned;
       return *this;
     }
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
     ~TestBase() {
       assert(value != -999); assert(alive > 0);
       --alive; ++destroyed; value = -999;
@@ -149,9 +144,7 @@
     }
     //~ValueBase() { assert(value != -999); value = -999; }
     int value;
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
     constexpr static int check_value(int const& val) {
 #if TEST_STD_VER < 14
       return val == -1 || val == 999 ? (TEST_THROW(42), 0) : val;
@@ -204,9 +197,7 @@
     template <bool Dummy = true, typename std::enable_if<Dummy && !Explicit, bool>::type = true>
     constexpr TrivialValueBase(std::initializer_list<int>& il, int = 0) : value(static_cast<int>(il.size())) {}
     int value;
-#ifndef TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
 protected:
-#endif // !TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK
     constexpr TrivialValueBase() noexcept : value(0) {}
 };
 
diff --git a/test/support/archetypes.ipp b/test/support/archetypes.ipp
index 3604501..d8d1e5a 100644
--- a/test/support/archetypes.ipp
+++ b/test/support/archetypes.ipp
@@ -6,11 +6,7 @@
 #define DEFINE_EXPLICIT
 #endif
 #ifndef DEFINE_CONSTEXPR
-#ifdef TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR
-#define DEFINE_CONSTEXPR
-#else // TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR
 #define DEFINE_CONSTEXPR constexpr
-#endif // TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR
 #endif
 #ifndef DEFINE_ASSIGN_CONSTEXPR
 #if TEST_STD_VER >= 14
diff --git a/test/support/coroutine_types.h b/test/support/coroutine_types.h
deleted file mode 100644
index f592bed..0000000
--- a/test/support/coroutine_types.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUPPORT_COROUTINE_TYPES_H
-#define SUPPORT_COROUTINE_TYPES_H
-
-#include <experimental/coroutine>
-
-template <typename Ty> struct generator {
-  struct promise_type {
-    Ty current_value;
-    std::experimental::suspend_always yield_value(Ty value) {
-      this->current_value = value;
-      return {};
-    }
-    std::experimental::suspend_always initial_suspend() { return {}; }
-    std::experimental::suspend_always final_suspend() { return {}; }
-    generator get_return_object() { return generator{this}; };
-    void return_void() {}
-    void unhandled_exception() {}
-  };
-
-  struct iterator {
-    std::experimental::coroutine_handle<promise_type> _Coro;
-    bool _Done;
-
-    iterator(std::experimental::coroutine_handle<promise_type> Coro, bool Done)
-        : _Coro(Coro), _Done(Done) {}
-
-    iterator &operator++() {
-      _Coro.resume();
-      _Done = _Coro.done();
-      return *this;
-    }
-
-    bool operator==(iterator const &_Right) const {
-      return _Done == _Right._Done;
-    }
-
-    bool operator!=(iterator const &_Right) const { return !(*this == _Right); }
-
-    Ty const &operator*() const { return _Coro.promise().current_value; }
-
-    Ty const *operator->() const { return &(operator*()); }
-  };
-
-  iterator begin() {
-    p.resume();
-    return {p, p.done()};
-  }
-
-  iterator end() { return {p, true}; }
-
-  generator(generator &&rhs) : p(rhs.p) { rhs.p = nullptr; }
-
-  ~generator() {
-    if (p)
-      p.destroy();
-  }
-
-private:
-  explicit generator(promise_type *p)
-      : p(std::experimental::coroutine_handle<promise_type>::from_promise(*p)) {}
-
-  std::experimental::coroutine_handle<promise_type> p;
-};
-
-#endif // SUPPORT_COROUTINE_TYPES_H
diff --git a/test/support/deleter_types.h b/test/support/deleter_types.h
index ec70168..f7cdb62 100644
--- a/test/support/deleter_types.h
+++ b/test/support/deleter_types.h
@@ -193,10 +193,6 @@
 
     CDeleter() : state_(0) {}
     explicit CDeleter(int s) : state_(s) {}
-    template <class U>
-        CDeleter(const CDeleter<U>& d)
-            : state_(d.state()) {}
-
     ~CDeleter() {assert(state_ >= 0); state_ = -1;}
 
     int state() const {return state_;}
diff --git a/test/support/filesystem_dynamic_test_helper.py b/test/support/filesystem_dynamic_test_helper.py
index 081e678..d2b2810 100644
--- a/test/support/filesystem_dynamic_test_helper.py
+++ b/test/support/filesystem_dynamic_test_helper.py
@@ -25,7 +25,7 @@
 
 """
 Some of the tests restrict permissions to induce failures.
-Before we delete the test environment, we have to walk it and re-raise the
+Before we delete the test enviroment, we have to walk it and re-raise the
 permissions.
 """
 def clean_recursive(root_p):
diff --git a/test/support/filesystem_test_helper.hpp b/test/support/filesystem_test_helper.hpp
index 755be90..6cc0e37 100644
--- a/test/support/filesystem_test_helper.hpp
+++ b/test/support/filesystem_test_helper.hpp
@@ -227,7 +227,7 @@
     }
 
     static inline void fs_helper_run(std::string const& raw_cmd) {
-        // check that the fs test root in the environment matches what we were
+        // check that the fs test root in the enviroment matches what we were
         // compiled with.
         static bool checked = checkDynamicTestRoot();
         ((void)checked);
@@ -246,7 +246,7 @@
             std::abort();
         }
         if (std::string(fs_root) != LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT) {
-            std::printf("ERROR: LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT environment variable"
+            std::printf("ERROR: LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT enviroment variable"
                         " must have the same value as when the test was compiled.\n");
             std::printf("   Current Value:  '%s'\n", fs_root);
             std::printf("   Expected Value: '%s'\n", LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT);
diff --git a/test/support/msvc_stdlib_force_include.hpp b/test/support/msvc_stdlib_force_include.hpp
index e23e5ff..6606456 100644
--- a/test/support/msvc_stdlib_force_include.hpp
+++ b/test/support/msvc_stdlib_force_include.hpp
@@ -13,13 +13,11 @@
 // This header is force-included when running the libc++ tests against the
 // MSVC standard library.
 
-#ifndef _LIBCXX_IN_DEVCRT
-    // Silence warnings about CRT machinery.
-    #define _CRT_SECURE_NO_WARNINGS
+// Silence warnings about CRT machinery.
+#define _CRT_SECURE_NO_WARNINGS
 
-    // Avoid assertion dialogs.
-    #define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()
-#endif // _LIBCXX_IN_DEVCRT
+// Avoid assertion dialogs.
+#define _CRT_SECURE_INVALID_PARAMETER(EXPR) ::abort()
 
 #include <crtdbg.h>
 #include <stdlib.h>
@@ -28,12 +26,6 @@
     #error This header may not be used when targeting libc++
 #endif
 
-// Indicates that we are using the MSVC standard library.
-#ifndef _MSVC_STL_VER
-    #define _MSVC_STL_VER 42
-#endif
-
-#ifndef _LIBCXX_IN_DEVCRT
 struct AssertionDialogAvoider {
     AssertionDialogAvoider() {
         _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE);
@@ -45,10 +37,11 @@
 };
 
 const AssertionDialogAvoider assertion_dialog_avoider{};
-#endif // _LIBCXX_IN_DEVCRT
 
 // MSVC frontend only configurations
 #if !defined(__clang__)
+    #define TEST_STD_VER 17
+
     // Simulate feature-test macros.
     #define __has_feature(X) _MSVC_HAS_FEATURE_ ## X
     #define _MSVC_HAS_FEATURE_cxx_exceptions    1
@@ -61,6 +54,7 @@
     #pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
     #pragma warning(disable: 4521) // multiple copy constructors specified
     #pragma warning(disable: 4702) // unreachable code
+    #pragma warning(disable: 6294) // Ill-defined for-loop:  initial condition does not satisfy test.  Loop body not executed.
     #pragma warning(disable: 28251) // Inconsistent annotation for 'new': this instance has no annotations.
 #endif // !defined(__clang__)
 
@@ -70,28 +64,15 @@
 // MSVC has quick_exit() and at_quick_exit().
 #define _LIBCPP_HAS_QUICK_EXIT
 
-#ifndef _LIBCXX_IN_DEVCRT
-    // atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix.
-    #define _ENABLE_ATOMIC_ALIGNMENT_FIX
+// atomic_is_lock_free.pass.cpp needs this VS 2015 Update 2 fix.
+#define _ENABLE_ATOMIC_ALIGNMENT_FIX
 
-    // Enable features that /std:c++latest removes by default.
-    #define _HAS_AUTO_PTR_ETC          1
-    #define _HAS_FUNCTION_ASSIGN       1
-    #define _HAS_OLD_IOSTREAMS_MEMBERS 1
+// Enable features that /std:c++latest removes by default.
+#define _HAS_AUTO_PTR_ETC          1
+#define _HAS_FUNCTION_ASSIGN       1
+#define _HAS_OLD_IOSTREAMS_MEMBERS 1
 
-    // Silence warnings about raw pointers and other unchecked iterators.
-    #define _SCL_SECURE_NO_WARNINGS
-
-    // Silence warnings about features that are deprecated in C++17.
-    #define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
-#endif // _LIBCXX_IN_DEVCRT
-
-#include <ciso646>
-
-#if _HAS_CXX17
-    #define TEST_STD_VER 17
-#else // _HAS_CXX17
-    #define TEST_STD_VER 14
-#endif // _HAS_CXX17
+// Silence warnings about raw pointers and other unchecked iterators.
+#define _SCL_SECURE_NO_WARNINGS
 
 #endif // SUPPORT_MSVC_STDLIB_FORCE_INCLUDE_HPP
diff --git a/test/support/nasty_containers.hpp b/test/support/nasty_containers.hpp
index 99e91d6..dcad6c2 100644
--- a/test/support/nasty_containers.hpp
+++ b/test/support/nasty_containers.hpp
@@ -39,7 +39,7 @@
     explicit nasty_vector(size_type n) : v_(n) {}
     nasty_vector(size_type n, const value_type& value) : v_(n, value) {}
     template <class InputIterator> nasty_vector(InputIterator first, InputIterator last) : v_(first, last) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     nasty_vector(std::initializer_list<value_type> il) : v_(il) {}
 #endif
     ~nasty_vector() {}
@@ -47,7 +47,7 @@
     template <class InputIterator>
         void assign(InputIterator first, InputIterator last) { v_.assign(first, last); }
     void assign(size_type n, const value_type& u) { v_.assign(n, u); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     void assign(std::initializer_list<value_type> il)  { v_.assign(il); }
 #endif
 
@@ -87,20 +87,24 @@
     const value_type* data() const TEST_NOEXCEPT { return v_.data(); }
 
     void push_back(const value_type& x)     { v_.push_back(x); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void push_back(value_type&& x)          { v_.push_back(std::forward<value_type&&>(x)); }
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... Args>
         void emplace_back(Args&&... args)   { v_.emplace_back(std::forward<Args>(args)...); }
 #endif
+#endif
     void pop_back()                         { v_.pop_back(); }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... Args> iterator emplace(const_iterator pos, Args&&... args)
     { return v_.emplace(pos, std::forward<Args>(args)...); }
 #endif
+#endif
 
     iterator insert(const_iterator pos, const value_type& x) { return v_.insert(pos, x); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert(const_iterator pos, value_type&& x)      { return v_.insert(pos, std::forward<value_type>(x)); }
 #endif
     iterator insert(const_iterator pos, size_type n, const value_type& x) { return v_.insert(pos, n, x); }
@@ -108,7 +112,7 @@
         iterator insert(const_iterator pos, InputIterator first, InputIterator last)
     { return v_.insert(pos, first, last); }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     iterator insert(const_iterator pos, std::initializer_list<value_type> il) { return v_.insert(pos, il); }
 #endif
 
@@ -162,19 +166,19 @@
     nasty_list(size_type n, const value_type& value)  : l_(n,value) {}
     template <class Iter>
         nasty_list(Iter first, Iter last)  : l_(first, last) {}
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     nasty_list(std::initializer_list<value_type> il) : l_(il) {}
 #endif
 
     ~nasty_list() {}
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     nasty_list& operator=(std::initializer_list<value_type> il) { l_ = il; return *this; }
 #endif
     template <class Iter>
         void assign(Iter first, Iter last) { l_.assign(first, last); }
     void assign(size_type n, const value_type& t) { l_.assign(n, t); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     void assign(std::initializer_list<value_type> il) { l_.assign(il); }
 #endif
 
@@ -205,24 +209,28 @@
 
     void push_front(const value_type& x)    { l_.push_front(x); }
     void push_back(const value_type& x)     { l_.push_back(x); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     void push_back(value_type&& x)          { l_.push_back(std::forward<value_type&&>(x)); }
     void push_front(value_type&& x)         { l_.push_back(std::forward<value_type&&>(x)); }
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... Args>
         void emplace_back(Args&&... args)   { l_.emplace_back(std::forward<Args>(args)...); }
     template <class... Args>
         void emplace_front(Args&&... args)  { l_.emplace_front(std::forward<Args>(args)...); }
 #endif
+#endif
     void pop_front()                        { l_.pop_front(); }
     void pop_back()                         { l_.pop_back(); }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#ifndef _LIBCPP_HAS_NO_VARIADICS
     template <class... Args> iterator emplace(const_iterator pos, Args&&... args)
     { return l_.emplace(pos, std::forward<Args>(args)...); }
 #endif
+#endif
 
     iterator insert(const_iterator pos, const value_type& x) { return l_.insert(pos, x); }
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     iterator insert(const_iterator pos, value_type&& x)      { return l_.insert(pos, std::forward<value_type>(x)); }
 #endif
     iterator insert(const_iterator pos, size_type n, const value_type& x) { return l_.insert(pos, n, x); }
@@ -230,7 +238,7 @@
         iterator insert(const_iterator pos, InputIterator first, InputIterator last)
     { return l_.insert(pos, first, last); }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
     iterator insert(const_iterator pos, std::initializer_list<value_type> il) { return l_.insert(pos, il); }
 #endif
 
diff --git a/test/support/nasty_macros.hpp b/test/support/nasty_macros.hpp
index ff141f7..f6c8aad 100644
--- a/test/support/nasty_macros.hpp
+++ b/test/support/nasty_macros.hpp
@@ -37,14 +37,6 @@
 #define _Y NASTY_MACRO
 #define _Z NASTY_MACRO
 
-// tchar.h defines these macros on Windows.
-#define _UI   NASTY_MACRO
-#define _PUC  NASTY_MACRO
-#define _CPUC NASTY_MACRO
-#define _PC   NASTY_MACRO
-#define _CRPC NASTY_MACRO
-#define _CPC  NASTY_MACRO
-
 // Test that libc++ doesn't use names reserved by WIN32 API Macros.
 // NOTE: Obviously we can only define these on non-windows platforms.
 #ifndef _WIN32
diff --git a/test/support/poisoned_hash_helper.hpp b/test/support/poisoned_hash_helper.hpp
index 6f42ebf..e8a2d8c 100644
--- a/test/support/poisoned_hash_helper.hpp
+++ b/test/support/poisoned_hash_helper.hpp
@@ -14,7 +14,6 @@
 #include <cassert>
 
 #include "test_macros.h"
-#include "test_workarounds.h"
 
 #if TEST_STD_VER < 11
 #error this header may only be used in C++11 or newer
diff --git a/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp b/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
deleted file mode 100644
index 669f175..0000000
--- a/test/support/test.workarounds/c1xx_broken_is_trivially_copyable.pass.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// This workaround option is specific to MSVC's C1XX, so we don't care that
-// it isn't set for older GCC versions.
-// XFAIL: gcc-4.9
-
-// Verify TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE.
-
-#include <type_traits>
-
-#include "test_workarounds.h"
-
-struct S {
-  S(S const&) = default;
-  S(S&&) = default;
-  S& operator=(S const&) = delete;
-  S& operator=(S&&) = delete;
-};
-
-int main() {
-#if defined(TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE)
-  static_assert(!std::is_trivially_copyable<S>::value, "");
-#else
-  static_assert(std::is_trivially_copyable<S>::value, "");
-#endif
-}
diff --git a/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp b/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
deleted file mode 100644
index 856574d..0000000
--- a/test/support/test.workarounds/c1xx_broken_za_ctor_check.pass.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// UNSUPPORTED: c++98, c++03
-
-// Verify TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK.
-
-#include <type_traits>
-
-#include "test_workarounds.h"
-
-struct X {
-    X(int) {}
-
-    X(X&&) = default;
-    X& operator=(X&&) = default;
-
-private:
-    X(const X&) = default;
-    X& operator=(const X&) = default;
-};
-
-void PushFront(X&&) {}
-
-template<class T = int>
-auto test(int) -> decltype(PushFront(std::declval<T>()), std::true_type{});
-auto test(long) -> std::false_type;
-
-int main() {
-#if defined(TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK)
-    static_assert(!decltype(test(0))::value, "");
-#else
-    static_assert(decltype(test(0))::value, "");
-#endif
-}
diff --git a/test/support/test_iterators.h b/test/support/test_iterators.h
index 0fdb225..a2c22b0 100644
--- a/test/support/test_iterators.h
+++ b/test/support/test_iterators.h
@@ -68,23 +68,23 @@
     typedef It                                                 pointer;
     typedef typename Traits::reference                         reference;
 
-    TEST_CONSTEXPR_CXX14 It base() const {return it_;}
+    It base() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 input_iterator() : it_() {}
-    explicit TEST_CONSTEXPR_CXX14 input_iterator(It it) : it_(it) {}
+    input_iterator() : it_() {}
+    explicit input_iterator(It it) : it_(it) {}
     template <class U, class T>
-        TEST_CONSTEXPR_CXX14 input_iterator(const input_iterator<U, T>& u) :it_(u.it_) {}
+        input_iterator(const input_iterator<U, T>& u) :it_(u.it_) {}
 
-    TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
-    TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 input_iterator& operator++() {++it_; return *this;}
-    TEST_CONSTEXPR_CXX14 input_iterator operator++(int)
+    input_iterator& operator++() {++it_; return *this;}
+    input_iterator operator++(int)
         {input_iterator tmp(*this); ++(*this); return tmp;}
 
-    friend TEST_CONSTEXPR_CXX14 bool operator==(const input_iterator& x, const input_iterator& y)
+    friend bool operator==(const input_iterator& x, const input_iterator& y)
         {return x.it_ == y.it_;}
-    friend TEST_CONSTEXPR_CXX14 bool operator!=(const input_iterator& x, const input_iterator& y)
+    friend bool operator!=(const input_iterator& x, const input_iterator& y)
         {return !(x == y);}
 
     template <class T>
@@ -120,23 +120,23 @@
     typedef It                                                 pointer;
     typedef typename std::iterator_traits<It>::reference       reference;
 
-    TEST_CONSTEXPR_CXX14 It base() const {return it_;}
+    It base() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 forward_iterator() : it_() {}
-    explicit TEST_CONSTEXPR_CXX14 forward_iterator(It it) : it_(it) {}
+    forward_iterator() : it_() {}
+    explicit forward_iterator(It it) : it_(it) {}
     template <class U>
-        TEST_CONSTEXPR_CXX14 forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
+        forward_iterator(const forward_iterator<U>& u) :it_(u.it_) {}
 
-    TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
-    TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 forward_iterator& operator++() {++it_; return *this;}
-    TEST_CONSTEXPR_CXX14 forward_iterator operator++(int)
+    forward_iterator& operator++() {++it_; return *this;}
+    forward_iterator operator++(int)
         {forward_iterator tmp(*this); ++(*this); return tmp;}
 
-    friend TEST_CONSTEXPR_CXX14 bool operator==(const forward_iterator& x, const forward_iterator& y)
+    friend bool operator==(const forward_iterator& x, const forward_iterator& y)
         {return x.it_ == y.it_;}
-    friend TEST_CONSTEXPR_CXX14 bool operator!=(const forward_iterator& x, const forward_iterator& y)
+    friend bool operator!=(const forward_iterator& x, const forward_iterator& y)
         {return !(x == y);}
 
     template <class T>
@@ -145,7 +145,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator==(const forward_iterator<T>& x, const forward_iterator<U>& y)
 {
     return x.base() == y.base();
@@ -153,7 +153,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator!=(const forward_iterator<T>& x, const forward_iterator<U>& y)
 {
     return !(x == y);
@@ -172,22 +172,22 @@
     typedef It                                                 pointer;
     typedef typename std::iterator_traits<It>::reference       reference;
 
-    TEST_CONSTEXPR_CXX14 It base() const {return it_;}
+    It base() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 bidirectional_iterator() : it_() {}
-    explicit TEST_CONSTEXPR_CXX14 bidirectional_iterator(It it) : it_(it) {}
+    bidirectional_iterator() : it_() {}
+    explicit bidirectional_iterator(It it) : it_(it) {}
     template <class U>
-        TEST_CONSTEXPR_CXX14 bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
+        bidirectional_iterator(const bidirectional_iterator<U>& u) :it_(u.it_) {}
 
-    TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
-    TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 bidirectional_iterator& operator++() {++it_; return *this;}
-    TEST_CONSTEXPR_CXX14 bidirectional_iterator operator++(int)
+    bidirectional_iterator& operator++() {++it_; return *this;}
+    bidirectional_iterator operator++(int)
         {bidirectional_iterator tmp(*this); ++(*this); return tmp;}
 
-    TEST_CONSTEXPR_CXX14 bidirectional_iterator& operator--() {--it_; return *this;}
-    TEST_CONSTEXPR_CXX14 bidirectional_iterator operator--(int)
+    bidirectional_iterator& operator--() {--it_; return *this;}
+    bidirectional_iterator operator--(int)
         {bidirectional_iterator tmp(*this); --(*this); return tmp;}
 
     template <class T>
@@ -196,7 +196,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator==(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
 {
     return x.base() == y.base();
@@ -204,7 +204,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator!=(const bidirectional_iterator<T>& x, const bidirectional_iterator<U>& y)
 {
     return !(x == y);
@@ -223,34 +223,34 @@
     typedef It                                                 pointer;
     typedef typename std::iterator_traits<It>::reference       reference;
 
-    TEST_CONSTEXPR_CXX14 It base() const {return it_;}
+    It base() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 random_access_iterator() : it_() {}
-    explicit TEST_CONSTEXPR_CXX14 random_access_iterator(It it) : it_(it) {}
-    template <class U>
-        TEST_CONSTEXPR_CXX14 random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
+    random_access_iterator() : it_() {}
+    explicit random_access_iterator(It it) : it_(it) {}
+   template <class U>
+        random_access_iterator(const random_access_iterator<U>& u) :it_(u.it_) {}
 
-    TEST_CONSTEXPR_CXX14 reference operator*() const {return *it_;}
-    TEST_CONSTEXPR_CXX14 pointer operator->() const {return it_;}
+    reference operator*() const {return *it_;}
+    pointer operator->() const {return it_;}
 
-    TEST_CONSTEXPR_CXX14 random_access_iterator& operator++() {++it_; return *this;}
-    TEST_CONSTEXPR_CXX14 random_access_iterator operator++(int)
+    random_access_iterator& operator++() {++it_; return *this;}
+    random_access_iterator operator++(int)
         {random_access_iterator tmp(*this); ++(*this); return tmp;}
 
-    TEST_CONSTEXPR_CXX14 random_access_iterator& operator--() {--it_; return *this;}
-    TEST_CONSTEXPR_CXX14 random_access_iterator operator--(int)
+    random_access_iterator& operator--() {--it_; return *this;}
+    random_access_iterator operator--(int)
         {random_access_iterator tmp(*this); --(*this); return tmp;}
 
-    TEST_CONSTEXPR_CXX14 random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
-    TEST_CONSTEXPR_CXX14 random_access_iterator operator+(difference_type n) const
+    random_access_iterator& operator+=(difference_type n) {it_ += n; return *this;}
+    random_access_iterator operator+(difference_type n) const
         {random_access_iterator tmp(*this); tmp += n; return tmp;}
-    friend TEST_CONSTEXPR_CXX14 random_access_iterator operator+(difference_type n, random_access_iterator x)
+    friend random_access_iterator operator+(difference_type n, random_access_iterator x)
         {x += n; return x;}
-    TEST_CONSTEXPR_CXX14 random_access_iterator& operator-=(difference_type n) {return *this += -n;}
-    TEST_CONSTEXPR_CXX14 random_access_iterator operator-(difference_type n) const
+    random_access_iterator& operator-=(difference_type n) {return *this += -n;}
+    random_access_iterator operator-(difference_type n) const
         {random_access_iterator tmp(*this); tmp -= n; return tmp;}
 
-    TEST_CONSTEXPR_CXX14 reference operator[](difference_type n) const {return it_[n];}
+    reference operator[](difference_type n) const {return it_[n];}
 
     template <class T>
     void operator,(T const &) DELETE_FUNCTION;
@@ -258,7 +258,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator==(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return x.base() == y.base();
@@ -266,7 +266,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator!=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return !(x == y);
@@ -274,7 +274,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator<(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return x.base() < y.base();
@@ -282,7 +282,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator<=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return !(y < x);
@@ -290,7 +290,7 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator>(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return y < x;
@@ -298,14 +298,14 @@
 
 template <class T, class U>
 inline
-bool TEST_CONSTEXPR_CXX14
+bool
 operator>=(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
     return !(x < y);
 }
 
 template <class T, class U>
-inline TEST_CONSTEXPR_CXX14
+inline
 typename std::iterator_traits<T>::difference_type
 operator-(const random_access_iterator<T>& x, const random_access_iterator<U>& y)
 {
@@ -313,22 +313,22 @@
 }
 
 template <class Iter>
-inline TEST_CONSTEXPR_CXX14 Iter base(output_iterator<Iter> i) { return i.base(); }
+inline Iter base(output_iterator<Iter> i) { return i.base(); }
 
 template <class Iter>
-inline TEST_CONSTEXPR_CXX14 Iter base(input_iterator<Iter> i) { return i.base(); }
+inline Iter base(input_iterator<Iter> i) { return i.base(); }
 
 template <class Iter>
-inline TEST_CONSTEXPR_CXX14 Iter base(forward_iterator<Iter> i) { return i.base(); }
+inline Iter base(forward_iterator<Iter> i) { return i.base(); }
 
 template <class Iter>
-inline TEST_CONSTEXPR_CXX14 Iter base(bidirectional_iterator<Iter> i) { return i.base(); }
+inline Iter base(bidirectional_iterator<Iter> i) { return i.base(); }
 
 template <class Iter>
-inline TEST_CONSTEXPR_CXX14 Iter base(random_access_iterator<Iter> i) { return i.base(); }
+inline Iter base(random_access_iterator<Iter> i) { return i.base(); }
 
 template <class Iter>    // everything else
-inline TEST_CONSTEXPR_CXX14 Iter base(Iter i) { return i; }
+inline Iter base(Iter i) { return i; }
 
 template <typename T>
 struct ThrowingIterator {
diff --git a/test/support/test_macros.h b/test/support/test_macros.h
index cc2918a..75b7885 100644
--- a/test/support/test_macros.h
+++ b/test/support/test_macros.h
@@ -52,19 +52,6 @@
 #define TEST_HAS_BUILTIN_IDENTIFIER(X) 0
 #endif
 
-#if defined(__EDG__)
-# define TEST_COMPILER_EDG
-#elif defined(__clang__)
-# define TEST_COMPILER_CLANG
-# if defined(__apple_build_version__)
-#  define TEST_COMPILER_APPLE_CLANG
-# endif
-#elif defined(_MSC_VER)
-# define TEST_COMPILER_C1XX
-#elif defined(__GNUC__)
-# define TEST_COMPILER_GCC
-#endif
-
 #if defined(__apple_build_version__)
 #define TEST_APPLE_CLANG_VER (__clang_major__ * 100) + __clang_minor__
 #elif defined(__clang_major__)
@@ -108,7 +95,6 @@
 #define TEST_ALIGNAS(...) alignas(__VA_ARGS__)
 #define TEST_CONSTEXPR constexpr
 #define TEST_NOEXCEPT noexcept
-#define TEST_NOEXCEPT_FALSE noexcept(false)
 #define TEST_NOEXCEPT_COND(...) noexcept(__VA_ARGS__)
 # if TEST_STD_VER >= 14
 #   define TEST_CONSTEXPR_CXX14 constexpr
@@ -126,7 +112,6 @@
 #define TEST_CONSTEXPR
 #define TEST_CONSTEXPR_CXX14
 #define TEST_NOEXCEPT throw()
-#define TEST_NOEXCEPT_FALSE
 #define TEST_NOEXCEPT_COND(...)
 #define TEST_THROW_SPEC(...) throw(__VA_ARGS__)
 #endif
@@ -154,22 +139,11 @@
 #define TEST_NORETURN [[noreturn]]
 #endif
 
-#if defined(_LIBCPP_SAFE_STATIC)
-#define TEST_SAFE_STATIC _LIBCPP_SAFE_STATIC
-#else
-#define TEST_SAFE_STATIC
-#endif
-
-#if TEST_STD_VER < 11
-#define ASSERT_NOEXCEPT(...)
-#define ASSERT_NOT_NOEXCEPT(...)
-#else
 #define ASSERT_NOEXCEPT(...) \
     static_assert(noexcept(__VA_ARGS__), "Operation must be noexcept")
 
 #define ASSERT_NOT_NOEXCEPT(...) \
     static_assert(!noexcept(__VA_ARGS__), "Operation must NOT be noexcept")
-#endif
 
 /* Macros for testing libc++ specific behavior and extensions */
 #if defined(_LIBCPP_VERSION)
@@ -194,8 +168,8 @@
 } // namespace test_macros_detail
 
 #define ASSERT_SAME_TYPE(...) \
-    static_assert((test_macros_detail::is_same<__VA_ARGS__>::value), \
-                 "Types differ unexpectedly")
+    static_assert(test_macros_detail::is_same<__VA_ARGS__>::value, \
+                 "Types differ uexpectedly")
 
 #ifndef TEST_HAS_NO_EXCEPTIONS
 #define TEST_THROW(...) throw __VA_ARGS__
@@ -217,8 +191,7 @@
 #include <intrin.h>
 template <class Tp>
 inline void DoNotOptimize(Tp const& value) {
-  const volatile void* volatile unused = __builtin_addressof(value);
-  static_cast<void>(unused);
+  const volatile void* volatile = __builtin_addressof(value);
   _ReadWriteBarrier();
 }
 #endif
diff --git a/test/support/test_workarounds.h b/test/support/test_workarounds.h
deleted file mode 100644
index e88a149..0000000
--- a/test/support/test_workarounds.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SUPPORT_TEST_WORKAROUNDS_H
-#define SUPPORT_TEST_WORKAROUNDS_H
-
-#include "test_macros.h"
-
-#if defined(TEST_COMPILER_EDG)
-# define TEST_WORKAROUND_EDG_EXPLICIT_CONSTEXPR // VSO#424280
-#endif
-
-#if defined(TEST_COMPILER_C1XX)
-# define TEST_WORKAROUND_C1XX_BROKEN_IS_TRIVIALLY_COPYABLE // VSO#117743
-# ifndef _MSC_EXTENSIONS
-#  define TEST_WORKAROUND_C1XX_BROKEN_ZA_CTOR_CHECK // VSO#119998
-# endif
-#endif
-
-#endif // SUPPORT_TEST_WORKAROUNDS_H
diff --git a/test/support/tracked_value.h b/test/support/tracked_value.h
index 6b75516..14d96b8 100644
--- a/test/support/tracked_value.h
+++ b/test/support/tracked_value.h
@@ -11,8 +11,6 @@
 
 #include <cassert>
 
-#include "test_macros.h"
-
 struct TrackedValue {
     enum State { CONSTRUCTED, MOVED_FROM, DESTROYED };
     State state;
@@ -24,7 +22,7 @@
         assert(t.state != State::DESTROYED  && "copying a destroyed object");
     }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     TrackedValue(TrackedValue&& t) : state(State::CONSTRUCTED) {
         assert(t.state != State::MOVED_FROM && "double moving from an object");
         assert(t.state != State::DESTROYED  && "moving from a destroyed object");
@@ -40,7 +38,7 @@
         return *this;
     }
 
-#if TEST_STD_VER >= 11
+#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
     TrackedValue& operator=(TrackedValue&& t) {
         assert(state != State::DESTROYED && "move assigning into destroyed object");
         assert(t.state != State::MOVED_FROM && "double moving from an object");
diff --git a/test/support/unique_ptr_test_helper.h b/test/support/unique_ptr_test_helper.h
deleted file mode 100644
index 6fb9eaa..0000000
--- a/test/support/unique_ptr_test_helper.h
+++ /dev/null
@@ -1,158 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is dual licensed under the MIT and the University of Illinois Open
-// Source Licenses. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef TEST_SUPPORT_UNIQUE_PTR_TEST_HELPER_H
-#define TEST_SUPPORT_UNIQUE_PTR_TEST_HELPER_H
-
-#include <memory>
-#include <type_traits>
-
-#include "test_macros.h"
-#include "deleter_types.h"
-
-struct A {
-  static int count;
-  A() { ++count; }
-  A(const A&) { ++count; }
-  virtual ~A() { --count; }
-};
-
-int A::count = 0;
-
-struct B : public A {
-  static int count;
-  B() { ++count; }
-  B(const B&) { ++count; }
-  virtual ~B() { --count; }
-};
-
-int B::count = 0;
-
-template <class T>
-typename std::enable_if<!std::is_array<T>::value, T*>::type
-newValue(int num_elements) {
-  assert(num_elements == 1);
-  return new T;
-}
-
-template <class T>
-typename std::enable_if<std::is_array<T>::value,
-                        typename std::remove_all_extents<T>::type*>::type
-newValue(int num_elements) {
-  typedef typename std::remove_all_extents<T>::type VT;
-  assert(num_elements >= 1);
-  return new VT[num_elements];
-}
-
-struct IncompleteType;
-
-void checkNumIncompleteTypeAlive(int i);
-int getNumIncompleteTypeAlive();
-IncompleteType* getNewIncomplete();
-IncompleteType* getNewIncompleteArray(int size);
-
-#if TEST_STD_VER >= 11
-template <class ThisT, class ...Args>
-struct args_is_this_type : std::false_type {};
-
-template <class ThisT, class A1>
-struct args_is_this_type<ThisT, A1> : std::is_same<ThisT, typename std::decay<A1>::type> {};
-#endif
-
-template <class IncompleteT = IncompleteType,
-          class Del = std::default_delete<IncompleteT> >
-struct StoresIncomplete {
-  static_assert((std::is_same<IncompleteT, IncompleteType>::value ||
-                 std::is_same<IncompleteT, IncompleteType[]>::value), "");
-
-  std::unique_ptr<IncompleteT, Del> m_ptr;
-
-#if TEST_STD_VER >= 11
-  StoresIncomplete(StoresIncomplete const&) = delete;
-  StoresIncomplete(StoresIncomplete&&) = default;
-
-  template <class ...Args>
-  StoresIncomplete(Args&&... args) : m_ptr(std::forward<Args>(args)...) {
-    static_assert(!args_is_this_type<StoresIncomplete, Args...>::value, "");
-  }
-#else
-private:
-  StoresIncomplete();
-  StoresIncomplete(StoresIncomplete const&);
-public:
-#endif
-
-  ~StoresIncomplete();
-
-  IncompleteType* get() const { return m_ptr.get(); }
-  Del& get_deleter() { return m_ptr.get_deleter(); }
-};
-
-#if TEST_STD_VER >= 11
-template <class IncompleteT = IncompleteType,
-          class Del = std::default_delete<IncompleteT>, class... Args>
-void doIncompleteTypeTest(int expect_alive, Args&&... ctor_args) {
-  using ValueT = typename std::remove_all_extents<IncompleteT>::type;
-  checkNumIncompleteTypeAlive(expect_alive);
-  {
-    StoresIncomplete<IncompleteT, Del> sptr(std::forward<Args>(ctor_args)...);
-    checkNumIncompleteTypeAlive(expect_alive);
-    if (expect_alive == 0)
-      assert(sptr.get() == nullptr);
-    else
-      assert(sptr.get() != nullptr);
-  }
-  checkNumIncompleteTypeAlive(0);
-}
-#endif
-
-#define INCOMPLETE_TEST_EPILOGUE()                                             \
-  int is_incomplete_test_anchor = is_incomplete_test();                        \
-                                                                               \
-  struct IncompleteType {                                                      \
-    static int count;                                                          \
-    IncompleteType() { ++count; }                                              \
-    ~IncompleteType() { --count; }                                             \
-  };                                                                           \
-                                                                               \
-  int IncompleteType::count = 0;                                               \
-                                                                               \
-  void checkNumIncompleteTypeAlive(int i) {                                    \
-    assert(IncompleteType::count == i);                                        \
-  }                                                                            \
-  int getNumIncompleteTypeAlive() { return IncompleteType::count; }            \
-  IncompleteType* getNewIncomplete() { return new IncompleteType; }            \
-  IncompleteType* getNewIncompleteArray(int size) {                            \
-    return new IncompleteType[size];                                           \
-  }                                                                            \
-                                                                               \
-  template <class IncompleteT, class Del>                                      \
-  StoresIncomplete<IncompleteT, Del>::~StoresIncomplete() {}
-#
-
-#if defined(__GNUC__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wvariadic-macros"
-#endif
-
-#if TEST_STD_VER >= 11
-#define DEFINE_AND_RUN_IS_INCOMPLETE_TEST(...)                                 \
-  static int is_incomplete_test() { __VA_ARGS__ return 0; }                    \
-  INCOMPLETE_TEST_EPILOGUE()
-#else
-#define DEFINE_AND_RUN_IS_INCOMPLETE_TEST(...)                                 \
-  static int is_incomplete_test() { return 0; }                                \
-  INCOMPLETE_TEST_EPILOGUE()
-#endif
-
-#if defined(__GNUC__)
-#pragma GCC diagnostic pop
-#endif
-
-#endif // TEST_SUPPORT_UNIQUE_PTR_TEST_HELPER_H
diff --git a/test/support/uses_alloc_types.hpp b/test/support/uses_alloc_types.hpp
index 426d258..8422f80 100644
--- a/test/support/uses_alloc_types.hpp
+++ b/test/support/uses_alloc_types.hpp
@@ -15,7 +15,6 @@
 #include <cstdlib>
 
 #include "test_macros.h"
-#include "test_workarounds.h"
 #include "type_id.h"
 
 // There are two forms of uses-allocator construction:
diff --git a/test/support/variant_test_helpers.hpp b/test/support/variant_test_helpers.hpp
index 7598154..2771672 100644
--- a/test/support/variant_test_helpers.hpp
+++ b/test/support/variant_test_helpers.hpp
@@ -69,9 +69,9 @@
 void makeEmpty(Variant& v) {
     Variant v2(std::in_place_type<MakeEmptyT>);
     try {
-        v = std::move(v2);
+        v = v2;
         assert(false);
-    } catch (...) {
+    }  catch (...) {
         assert(v.valueless_by_exception());
     }
 }
diff --git a/utils/google-benchmark/AUTHORS b/utils/google-benchmark/AUTHORS
index c4b059d..5a545fa 100644
--- a/utils/google-benchmark/AUTHORS
+++ b/utils/google-benchmark/AUTHORS
@@ -18,15 +18,12 @@
 Evgeny Safronov <division494@gmail.com>
 Felix Homann <linuxaudio@showlabor.de>
 Google Inc.
-International Business Machines Corporation
 Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
-Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
 JianXiong Zhou <zhoujianxiong2@gmail.com>
 Jussi Knuuttila <jussi.knuuttila@gmail.com>
 Kaito Udagawa <umireon@gmail.com>
 Lei Xu <eddyxu@gmail.com>
 Matt Clarkson <mattyclarkson@gmail.com>
-Maxim Vafin <maxvafin@gmail.com>
 Nick Hutchinson <nshutchinson@gmail.com>
 Oleksandr Sochka <sasha.sochka@gmail.com>
 Paul Redmond <paul.redmond@gmail.com>
diff --git a/utils/google-benchmark/CMakeLists.txt b/utils/google-benchmark/CMakeLists.txt
index 1ba3133..8bfd21b 100644
--- a/utils/google-benchmark/CMakeLists.txt
+++ b/utils/google-benchmark/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.12)
+cmake_minimum_required (VERSION 2.8.11)
 project (benchmark)
 
 foreach(p
@@ -11,11 +11,8 @@
 endforeach()
 
 option(BENCHMARK_ENABLE_TESTING "Enable testing of the benchmark library." ON)
-option(BENCHMARK_ENABLE_EXCEPTIONS "Enable the use of exceptions in the benchmark library." ON)
 option(BENCHMARK_ENABLE_LTO "Enable link time optimisation of the benchmark library." OFF)
 option(BENCHMARK_USE_LIBCXX "Build and test using libc++ as the standard library." OFF)
-option(BENCHMARK_BUILD_32_BITS "Build a 32 bit version of the library" OFF)
-
 # Make sure we can import out CMake functions
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
 
@@ -36,20 +33,12 @@
 include(AddCXXCompilerFlag)
 include(CXXFeatureCheck)
 
-if (BENCHMARK_BUILD_32_BITS)
-  add_required_cxx_compiler_flag(-m32)
-endif()
-
 if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
   # Turn compiler warnings up to 11
   string(REGEX REPLACE "[-/]W[1-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
   add_definitions(-D_CRT_SECURE_NO_WARNINGS)
 
-  if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
-    add_cxx_compiler_flag(-EHs-)
-    add_cxx_compiler_flag(-EHa-)
-  endif()
   # Link time optimisation
   if (BENCHMARK_ENABLE_LTO)
     set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL")
@@ -91,20 +80,12 @@
   add_cxx_compiler_flag(-Wshorten-64-to-32)
   add_cxx_compiler_flag(-Wfloat-equal)
   add_cxx_compiler_flag(-fstrict-aliasing)
-  if (NOT BENCHMARK_ENABLE_EXCEPTIONS)
-    add_cxx_compiler_flag(-fno-exceptions)
-  endif()
   if (NOT BENCHMARK_USE_LIBCXX)
     add_cxx_compiler_flag(-Wzero-as-null-pointer-constant)
   endif()
   if (HAVE_CXX_FLAG_FSTRICT_ALIASING)
-    if (NOT CMAKE_CXX_COMPILER_ID STREQUAL "Intel") #ICC17u2: Many false positives for Wstrict-aliasing
-      add_cxx_compiler_flag(-Wstrict-aliasing)
-    endif()
+    add_cxx_compiler_flag(-Wstrict-aliasing)
   endif()
-  # ICC17u2: overloaded virtual function "benchmark::Fixture::SetUp" is only partially overridden
-  # (because of deprecated overload)
-  add_cxx_compiler_flag(-wd654)  
   add_cxx_compiler_flag(-Wthread-safety)
   if (HAVE_CXX_FLAG_WTHREAD_SAFETY)
     cxx_feature_check(THREAD_SAFETY_ATTRIBUTES)
@@ -181,10 +162,7 @@
 if(NOT HAVE_STD_REGEX AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
   message(FATAL_ERROR "Failed to determine the source files for the regular expression backend")
 endif()
-if (NOT BENCHMARK_ENABLE_EXCEPTIONS AND HAVE_STD_REGEX
-        AND NOT HAVE_GNU_POSIX_REGEX AND NOT HAVE_POSIX_REGEX)
-  message(WARNING "Using std::regex with exceptions disabled is not fully supported")
-endif()
+
 cxx_feature_check(STEADY_CLOCK)
 # Ensure we have pthreads
 find_package(Threads REQUIRED)
diff --git a/utils/google-benchmark/CONTRIBUTORS b/utils/google-benchmark/CONTRIBUTORS
index 8ca4565..33cd941 100644
--- a/utils/google-benchmark/CONTRIBUTORS
+++ b/utils/google-benchmark/CONTRIBUTORS
@@ -34,21 +34,18 @@
 Evgeny Safronov <division494@gmail.com>
 Felix Homann <linuxaudio@showlabor.de>
 Ismael Jimenez Martinez <ismael.jimenez.martinez@gmail.com>
-Joao Paulo Magalhaes <joaoppmagalhaes@gmail.com>
 JianXiong Zhou <zhoujianxiong2@gmail.com>
 Jussi Knuuttila <jussi.knuuttila@gmail.com>
 Kaito Udagawa <umireon@gmail.com>
 Kai Wolf <kai.wolf@gmail.com>
 Lei Xu <eddyxu@gmail.com>
 Matt Clarkson <mattyclarkson@gmail.com>
-Maxim Vafin <maxvafin@gmail.com>
 Nick Hutchinson <nshutchinson@gmail.com>
 Oleksandr Sochka <sasha.sochka@gmail.com>
 Pascal Leroy <phl@google.com>
 Paul Redmond <paul.redmond@gmail.com>
 Pierre Phaneuf <pphaneuf@google.com>
 Radoslav Yovchev <radoslav.tm@gmail.com>
-Ray Glover <ray.glover@uk.ibm.com>
 Shuo Chen <chenshuo@chenshuo.com>
 Yusuke Suzuki <utatane.tea@gmail.com>
 Tobias Ulvgård <tobias.ulvgard@dirac.se>
diff --git a/utils/google-benchmark/README.md b/utils/google-benchmark/README.md
index f16a9d7..9109430 100644
--- a/utils/google-benchmark/README.md
+++ b/utils/google-benchmark/README.md
@@ -11,8 +11,6 @@
 
 [Known issues and common problems](#known-issues)
 
-[Additional Tooling Documentation](docs/tools.md)
-
 ## Example usage
 ### Basic usage
 Define a function that executes the code to be measured.
@@ -365,7 +363,7 @@
 }
 ```
 
-Note that `ClobberMemory()` is only available for GNU or MSVC based compilers.
+Note that `ClobberMemory()` is only available for GNU based compilers.
 
 ### Set time unit manually
 If a benchmark runs a few milliseconds it may be hard to visually compare the
@@ -432,65 +430,6 @@
 /* BarTest is now registered */
 ```
 
-
-## User-defined counters
-
-You can add your own counters with user-defined names. The example below
-will add columns "Foo", "Bar" and "Baz" in its output:
-
-```c++
-static void UserCountersExample1(benchmark::State& state) {
-  double numFoos = 0, numBars = 0, numBazs = 0;
-  while (state.KeepRunning()) {
-    // ... count Foo,Bar,Baz events
-  }
-  state.counters["Foo"] = numFoos;
-  state.counters["Bar"] = numBars;
-  state.counters["Baz"] = numBazs;
-}
-```
-
-The `state.counters` object is a `std::map` with `std::string` keys
-and `Counter` values. The latter is a `double`-like class, via an implicit
-conversion to `double&`. Thus you can use all of the standard arithmetic
-assignment operators (`=,+=,-=,*=,/=`) to change the value of each counter.
-
-In multithreaded benchmarks, each counter is set on the calling thread only.
-When the benchmark finishes, the counters from each thread will be summed;
-the resulting sum is the value which will be shown for the benchmark.
-
-The `Counter` constructor accepts two parameters: the value as a `double`
-and a bit flag which allows you to show counters as rates and/or as
-per-thread averages:
-
-```c++
-  // sets a simple counter
-  state.counters["Foo"] = numFoos;
-
-  // Set the counter as a rate. It will be presented divided
-  // by the duration of the benchmark.
-  state.counters["FooRate"] = Counter(numFoos, benchmark::Counter::kIsRate);
-
-  // Set the counter as a thread-average quantity. It will
-  // be presented divided by the number of threads.
-  state.counters["FooAvg"] = Counter(numFoos, benchmark::Counter::kAvgThreads);
-
-  // There's also a combined flag:
-  state.counters["FooAvgRate"] = Counter(numFoos,benchmark::Counter::kAvgThreadsRate);
-```
-
-When you're compiling in C++11 mode or later you can use `insert()` with
-`std::initializer_list`:
-
-```c++
-  // With C++11, this can be done:
-  state.counters.insert({{"Foo", numFoos}, {"Bar", numBars}, {"Baz", numBazs}});
-  // ... instead of:
-  state.counters["Foo"] = numFoos;
-  state.counters["Bar"] = numBars;
-  state.counters["Baz"] = numBazs;
-```
-
 ## Exiting Benchmarks in Error
 
 When errors caused by external influences, such as file I/O and network
@@ -562,7 +501,7 @@
 information about the CPU and the date.
 The `benchmarks` attribute contains a list of ever benchmark run. Example json
 output looks like:
-```json
+``` json
 {
   "context": {
     "date": "2015/03/17-18:40:25",
@@ -643,7 +582,6 @@
 * GCC 4.8
 * Clang 3.4
 * Visual Studio 2013
-* Intel 2015 Update 1
 
 Anything older *may* work.
 
diff --git a/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
index 0b176ba..9afde84 100644
--- a/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
+++ b/utils/google-benchmark/cmake/AddCXXCompilerFlag.cmake
@@ -19,21 +19,14 @@
 
 include(CheckCXXCompilerFlag)
 
-function(mangle_compiler_flag FLAG OUTPUT)
+function(add_cxx_compiler_flag FLAG)
   string(TOUPPER "HAVE_CXX_FLAG_${FLAG}" SANITIZED_FLAG)
   string(REPLACE "+" "X" SANITIZED_FLAG ${SANITIZED_FLAG})
   string(REGEX REPLACE "[^A-Za-z_0-9]" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
   string(REGEX REPLACE "_+" "_" SANITIZED_FLAG ${SANITIZED_FLAG})
-  set(${OUTPUT} "${SANITIZED_FLAG}" PARENT_SCOPE)
-endfunction(mangle_compiler_flag)
-
-function(add_cxx_compiler_flag FLAG)
-  mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
-  set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
-  check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
-  set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
-  if(${MANGLED_FLAG})
+  set(CMAKE_REQUIRED_FLAGS "${FLAG}")
+  check_cxx_compiler_flag("${FLAG}" ${SANITIZED_FLAG})
+  if(${SANITIZED_FLAG})
     set(VARIANT ${ARGV1})
     if(ARGV1)
       string(TOUPPER "_${VARIANT}" VARIANT)
@@ -42,23 +35,3 @@
   endif()
 endfunction()
 
-function(add_required_cxx_compiler_flag FLAG)
-  mangle_compiler_flag("${FLAG}" MANGLED_FLAG)
-  set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-  set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}")
-  check_cxx_compiler_flag("${FLAG}" ${MANGLED_FLAG})
-  set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
-  if(${MANGLED_FLAG})
-    set(VARIANT ${ARGV1})
-    if(ARGV1)
-      string(TOUPPER "_${VARIANT}" VARIANT)
-    endif()
-    set(CMAKE_CXX_FLAGS${VARIANT} "${CMAKE_CXX_FLAGS${VARIANT}} ${FLAG}" PARENT_SCOPE)
-    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
-    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
-    set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${FLAG}" PARENT_SCOPE)
-    set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${FLAG}" PARENT_SCOPE)
-  else()
-    message(FATAL_ERROR "Required flag '${FLAG}' is not supported by the compiler")
-  endif()
-endfunction()
diff --git a/utils/google-benchmark/cmake/CXXFeatureCheck.cmake b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
index 6efe6a8..b106f32 100644
--- a/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
+++ b/utils/google-benchmark/cmake/CXXFeatureCheck.cmake
@@ -10,7 +10,7 @@
 #
 # include(CXXFeatureCheck)
 # cxx_feature_check(STD_REGEX)
-# Requires CMake 2.8.12+
+# Requires CMake 2.6+
 
 if(__cxx_feature_check)
   return()
diff --git a/utils/google-benchmark/cmake/Config.cmake.in b/utils/google-benchmark/cmake/Config.cmake.in
deleted file mode 100644
index 6e9256e..0000000
--- a/utils/google-benchmark/cmake/Config.cmake.in
+++ /dev/null
@@ -1 +0,0 @@
-include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
diff --git a/utils/google-benchmark/docs/tools.md b/utils/google-benchmark/docs/tools.md
deleted file mode 100644
index f176f74..0000000
--- a/utils/google-benchmark/docs/tools.md
+++ /dev/null
@@ -1,59 +0,0 @@
-# Benchmark Tools
-
-## compare_bench.py
-
-The `compare_bench.py` utility which can be used to compare the result of benchmarks.
-The program is invoked like:
-
-``` bash
-$ compare_bench.py <old-benchmark> <new-benchmark> [benchmark options]...
-```
-
-Where `<old-benchmark>` and `<new-benchmark>` either specify a benchmark executable file, or a JSON output file. The type of the input file is automatically detected. If a benchmark executable is specified then the benchmark is run to obtain the results. Otherwise the results are simply loaded from the output file.
-
-The sample output using the JSON test files under `Inputs/` gives:
-
-``` bash
-$ ./compare_bench.py ./gbench/Inputs/test1_run1.json ./gbench/Inputs/test1_run2.json
-Comparing ./gbench/Inputs/test1_run1.json to ./gbench/Inputs/test1_run2.json
-Benchmark                   Time           CPU
-----------------------------------------------
-BM_SameTimes               +0.00         +0.00
-BM_2xFaster                -0.50         -0.50
-BM_2xSlower                +1.00         +1.00
-BM_10PercentFaster         -0.10         -0.10
-BM_10PercentSlower         +0.10         +0.10
-```
-
-When a benchmark executable is run, the raw output from the benchmark is printed in real time to stdout. The sample output using `benchmark/basic_test` for both arguments looks like:
-
-```
-./compare_bench.py  test/basic_test test/basic_test  --benchmark_filter=BM_empty.*
-RUNNING: test/basic_test --benchmark_filter=BM_empty.*
-Run on (4 X 4228.32 MHz CPU s)
-2016-08-02 19:21:33
-Benchmark                              Time           CPU Iterations
---------------------------------------------------------------------
-BM_empty                               9 ns          9 ns   79545455
-BM_empty/threads:4                     4 ns          9 ns   75268816
-BM_empty_stop_start                    8 ns          8 ns   83333333
-BM_empty_stop_start/threads:4          3 ns          8 ns   83333332
-RUNNING: test/basic_test --benchmark_filter=BM_empty.*
-Run on (4 X 4228.32 MHz CPU s)
-2016-08-02 19:21:35
-Benchmark                              Time           CPU Iterations
---------------------------------------------------------------------
-BM_empty                               9 ns          9 ns   76086957
-BM_empty/threads:4                     4 ns          9 ns   76086956
-BM_empty_stop_start                    8 ns          8 ns   87500000
-BM_empty_stop_start/threads:4          3 ns          8 ns   88607596
-Comparing test/basic_test to test/basic_test
-Benchmark                              Time           CPU
----------------------------------------------------------
-BM_empty                              +0.00         +0.00
-BM_empty/threads:4                    +0.00         +0.00
-BM_empty_stop_start                   +0.00         +0.00
-BM_empty_stop_start/threads:4         +0.00         +0.00
-```
-
-Obviously this example doesn't give any useful output, but it's intended to show the output format when 'compare_bench.py' needs to run benchmarks.
diff --git a/utils/google-benchmark/include/benchmark/benchmark_api.h b/utils/google-benchmark/include/benchmark/benchmark_api.h
index 1e853e2..28baa58 100644
--- a/utils/google-benchmark/include/benchmark/benchmark_api.h
+++ b/utils/google-benchmark/include/benchmark/benchmark_api.h
@@ -155,29 +155,19 @@
 
 #include <string>
 #include <vector>
-#include <map>
 
 #include "macros.h"
 
 #if defined(BENCHMARK_HAS_CXX11)
 #include <type_traits>
-#include <initializer_list>
 #include <utility>
 #endif
 
-#if defined(_MSC_VER)
-#include <intrin.h> // for _ReadWriteBarrier
-#endif
-
 namespace benchmark {
 class BenchmarkReporter;
 
 void Initialize(int* argc, char** argv);
 
-// Report to stdout all arguments in 'argv' as unrecognized except the first.
-// Returns true there is at least on unrecognized argument (i.e. 'argc' > 1).
-bool ReportUnrecognizedArguments(int argc, char** argv);
-
 // Generate a list of benchmarks matching the specified --benchmark_filter flag
 // and if --benchmark_list_tests is specified return after printing the name
 // of each matching benchmark. Otherwise run each matching benchmark and
@@ -207,6 +197,19 @@
 class BenchmarkImp;
 class BenchmarkFamilies;
 
+template <class T>
+struct Voider {
+  typedef void type;
+};
+
+template <class T, class = void>
+struct EnableIfString {};
+
+template <class T>
+struct EnableIfString<T, typename Voider<typename T::basic_string>::type> {
+  typedef int type;
+};
+
 void UseCharPointer(char const volatile*);
 
 // Take ownership of the pointer and register the benchmark. Return the
@@ -219,16 +222,11 @@
 
 }  // end namespace internal
 
-
-#if !defined(__GNUC__) || defined(__pnacl__) || defined(EMSCRIPTN)
-# define BENCHMARK_HAS_NO_INLINE_ASSEMBLY
-#endif
-
 // The DoNotOptimize(...) function can be used to prevent a value or
 // expression from being optimized away by the compiler. This function is
 // intended to add little to no overhead.
 // See: https://youtu.be/nXaxk27zwlk?t=2441
-#ifndef BENCHMARK_HAS_NO_INLINE_ASSEMBLY
+#if defined(__GNUC__)
 template <class Tp>
 inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
   asm volatile("" : : "g"(value) : "memory");
@@ -238,57 +236,14 @@
 inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() {
   asm volatile("" : : : "memory");
 }
-#elif defined(_MSC_VER)
-template <class Tp>
-inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
-  internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value));
-  _ReadWriteBarrier();
-}
-
-inline BENCHMARK_ALWAYS_INLINE void ClobberMemory() {
-  _ReadWriteBarrier();
-}
 #else
 template <class Tp>
 inline BENCHMARK_ALWAYS_INLINE void DoNotOptimize(Tp const& value) {
   internal::UseCharPointer(&reinterpret_cast<char const volatile&>(value));
 }
-// FIXME Add ClobberMemory() for non-gnu and non-msvc compilers
+// FIXME Add ClobberMemory() for non-gnu compilers
 #endif
 
-
-
-// This class is used for user-defined counters.
-class Counter {
-public:
-
-  enum Flags {
-    kDefaults   = 0,
-    // Mark the counter as a rate. It will be presented divided
-    // by the duration of the benchmark.
-    kIsRate     = 1,
-    // Mark the counter as a thread-average quantity. It will be
-    // presented divided by the number of threads.
-    kAvgThreads = 2,
-    // Mark the counter as a thread-average rate. See above.
-    kAvgThreadsRate = kIsRate|kAvgThreads
-  };
-
-  double value;
-  Flags  flags;
-
-  BENCHMARK_ALWAYS_INLINE
-  Counter(double v = 0., Flags f = kDefaults) : value(v), flags(f) {}
-
-  BENCHMARK_ALWAYS_INLINE operator double const& () const { return value; }
-  BENCHMARK_ALWAYS_INLINE operator double      & ()       { return value; }
-
-};
-
-// This is the container for the user-defined counters.
-typedef std::map<std::string, Counter> UserCounters;
-
-
 // TimeUnit is passed to a benchmark in order to specify the order of magnitude
 // for the measured time.
 enum TimeUnit { kNanosecond, kMicrosecond, kMillisecond };
@@ -438,7 +393,13 @@
   // REQUIRES: a benchmark has exited its KeepRunning loop.
   void SetLabel(const char* label);
 
-  void BENCHMARK_ALWAYS_INLINE SetLabel(const std::string& str) {
+  // Allow the use of std::string without actually including <string>.
+  // This function does not participate in overload resolution unless StringType
+  // has the nested typename `basic_string`. This typename should be provided
+  // as an injected class name in the case of std::string.
+  template <class StringType>
+  void SetLabel(StringType const& str,
+                typename internal::EnableIfString<StringType>::type = 1) {
     this->SetLabel(str.c_str());
   }
 
@@ -473,8 +434,6 @@
   bool error_occurred_;
 
  public:
-  // Container for user-defined counters.
-  UserCounters counters;
   // Index of the executing thread. Values from [0, threads).
   const int thread_index;
   // Number of threads concurrently executing the benchmark.
@@ -577,17 +536,9 @@
 
   // Set the minimum amount of time to use when running this benchmark. This
   // option overrides the `benchmark_min_time` flag.
-  // REQUIRES: `t > 0` and `Iterations` has not been called on this benchmark.
+  // REQUIRES: `t > 0`
   Benchmark* MinTime(double t);
 
-  // Specify the amount of iterations that should be run by this benchmark.
-  // REQUIRES: 'n > 0' and `MinTime` has not been called on this benchmark.
-  //
-  // NOTE: This function should only be used when *exact* iteration control is
-  //   needed and never to control or limit how long a benchmark runs, where
-  // `--benchmark_min_time=N` or `MinTime(...)` should be used instead.
-  Benchmark* Iterations(size_t n);
-
   // Specify the amount of times to repeat this benchmark. This option overrides
   // the `benchmark_repetitions` flag.
   // REQUIRES: `n > 0`
@@ -676,7 +627,6 @@
   TimeUnit time_unit_;
   int range_multiplier_;
   double min_time_;
-  size_t iterations_;
   int repetitions_;
   bool use_real_time_;
   bool use_manual_time_;
@@ -908,7 +858,6 @@
 #define BENCHMARK_MAIN()                   \
   int main(int argc, char** argv) {        \
     ::benchmark::Initialize(&argc, argv);  \
-    if (::benchmark::ReportUnrecognizedArguments(argc, argv)) return 1; \
     ::benchmark::RunSpecifiedBenchmarks(); \
   }
 
diff --git a/utils/google-benchmark/include/benchmark/reporter.h b/utils/google-benchmark/include/benchmark/reporter.h
index 789124b..8c39e7f 100644
--- a/utils/google-benchmark/include/benchmark/reporter.h
+++ b/utils/google-benchmark/include/benchmark/reporter.h
@@ -19,7 +19,6 @@
 #include <string>
 #include <utility>
 #include <vector>
-#include <set>
 
 #include "benchmark_api.h"  // For forward declaration of BenchmarkReporter
 
@@ -55,8 +54,7 @@
           complexity_lambda(),
           complexity_n(0),
           report_big_o(false),
-          report_rms(false),
-          counters() {}
+          report_rms(false) {}
 
     std::string benchmark_name;
     std::string report_label;  // Empty if not set by benchmark.
@@ -95,8 +93,6 @@
     // Inform print function whether the current run is a complexity report
     bool report_big_o;
     bool report_rms;
-
-    UserCounters counters;
   };
 
   // Construct a BenchmarkReporter with the output stream set to 'std::cout'
@@ -167,10 +163,7 @@
 
  protected:
   virtual void PrintRunData(const Run& report);
-  virtual void PrintHeader(const Run& report);
-
   size_t name_field_width_;
-  bool printed_header_;
 
  private:
   bool color_output_;
@@ -191,15 +184,11 @@
 
 class CSVReporter : public BenchmarkReporter {
  public:
-  CSVReporter() : printed_header_(false) {}
   virtual bool ReportContext(const Context& context);
   virtual void ReportRuns(const std::vector<Run>& reports);
 
  private:
   void PrintRunData(const Run& report);
-
-  bool printed_header_;
-  std::set< std::string > user_counter_names_;
 };
 
 inline const char* GetTimeUnitString(TimeUnit unit) {
diff --git a/utils/google-benchmark/mingw.py b/utils/google-benchmark/mingw.py
deleted file mode 100644
index 706ad55..0000000
--- a/utils/google-benchmark/mingw.py
+++ /dev/null
@@ -1,320 +0,0 @@
-#! /usr/bin/env python
-# encoding: utf-8
-
-import argparse
-import errno
-import logging
-import os
-import platform
-import re
-import sys
-import subprocess
-import tempfile
-
-try:
-    import winreg
-except ImportError:
-    import _winreg as winreg
-try:
-    import urllib.request as request
-except ImportError:
-    import urllib as request
-try:
-    import urllib.parse as parse
-except ImportError:
-    import urlparse as parse
-
-class EmptyLogger(object):
-    '''
-    Provides an implementation that performs no logging
-    '''
-    def debug(self, *k, **kw):
-        pass
-    def info(self, *k, **kw):
-        pass
-    def warn(self, *k, **kw):
-        pass
-    def error(self, *k, **kw):
-        pass
-    def critical(self, *k, **kw):
-        pass
-    def setLevel(self, *k, **kw):
-        pass
-
-urls = (
-    'http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20'
-        'targetting%20Win32/Personal%20Builds/mingw-builds/installer/'
-        'repository.txt',
-    'http://downloads.sourceforge.net/project/mingwbuilds/host-windows/'
-        'repository.txt'
-)
-'''
-A list of mingw-build repositories
-'''
-
-def repository(urls = urls, log = EmptyLogger()):
-    '''
-    Downloads and parse mingw-build repository files and parses them
-    '''
-    log.info('getting mingw-builds repository')
-    versions = {}
-    re_sourceforge = re.compile(r'http://sourceforge.net/projects/([^/]+)/files')
-    re_sub = r'http://downloads.sourceforge.net/project/\1'
-    for url in urls:
-        log.debug(' - requesting: %s', url)
-        socket = request.urlopen(url)
-        repo = socket.read()
-        if not isinstance(repo, str):
-            repo = repo.decode();
-        socket.close()
-        for entry in repo.split('\n')[:-1]:
-            value = entry.split('|')
-            version = tuple([int(n) for n in value[0].strip().split('.')])
-            version = versions.setdefault(version, {})
-            arch = value[1].strip()
-            if arch == 'x32':
-                arch = 'i686'
-            elif arch == 'x64':
-                arch = 'x86_64'
-            arch = version.setdefault(arch, {})
-            threading = arch.setdefault(value[2].strip(), {})
-            exceptions = threading.setdefault(value[3].strip(), {})
-            revision = exceptions.setdefault(int(value[4].strip()[3:]),
-                re_sourceforge.sub(re_sub, value[5].strip()))
-    return versions
-
-def find_in_path(file, path=None):
-    '''
-    Attempts to find an executable in the path
-    '''
-    if platform.system() == 'Windows':
-        file += '.exe'
-    if path is None:
-        path = os.environ.get('PATH', '')
-    if type(path) is type(''):
-        path = path.split(os.pathsep)
-    return list(filter(os.path.exists,
-        map(lambda dir, file=file: os.path.join(dir, file), path)))
-
-def find_7zip(log = EmptyLogger()):
-    '''
-    Attempts to find 7zip for unpacking the mingw-build archives
-    '''
-    log.info('finding 7zip')
-    path = find_in_path('7z')
-    if not path:
-        key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\7-Zip')
-        path, _ = winreg.QueryValueEx(key, 'Path')
-        path = [os.path.join(path, '7z.exe')]
-    log.debug('found \'%s\'', path[0])
-    return path[0]
-
-find_7zip()
-
-def unpack(archive, location, log = EmptyLogger()):
-    '''
-    Unpacks a mingw-builds archive
-    '''
-    sevenzip = find_7zip(log)
-    log.info('unpacking %s', os.path.basename(archive))
-    cmd = [sevenzip, 'x', archive, '-o' + location, '-y']
-    log.debug(' - %r', cmd)
-    with open(os.devnull, 'w') as devnull:
-        subprocess.check_call(cmd, stdout = devnull)
-
-def download(url, location, log = EmptyLogger()):
-    '''
-    Downloads and unpacks a mingw-builds archive
-    '''
-    log.info('downloading MinGW')
-    log.debug(' - url: %s', url)
-    log.debug(' - location: %s', location)
-
-    re_content = re.compile(r'attachment;[ \t]*filename=(")?([^"]*)(")?[\r\n]*')
-
-    stream = request.urlopen(url)
-    try:
-        content = stream.getheader('Content-Disposition') or ''
-    except AttributeError:
-        content = stream.headers.getheader('Content-Disposition') or ''
-    matches = re_content.match(content)
-    if matches:
-        filename = matches.group(2)
-    else:
-        parsed = parse.urlparse(stream.geturl())
-        filename = os.path.basename(parsed.path)
-
-    try:
-        os.makedirs(location)
-    except OSError as e:
-        if e.errno == errno.EEXIST and os.path.isdir(location):
-            pass
-        else:
-            raise
-
-    archive = os.path.join(location, filename)
-    with open(archive, 'wb') as out:
-        while True:
-            buf = stream.read(1024)
-            if not buf:
-                break
-            out.write(buf)
-    unpack(archive, location, log = log)
-    os.remove(archive)
-
-    possible = os.path.join(location, 'mingw64')
-    if not os.path.exists(possible):
-        possible = os.path.join(location, 'mingw32')
-        if not os.path.exists(possible):
-            raise ValueError('Failed to find unpacked MinGW: ' + possible)
-    return possible
-
-def root(location = None, arch = None, version = None, threading = None,
-        exceptions = None, revision = None, log = EmptyLogger()):
-    '''
-    Returns the root folder of a specific version of the mingw-builds variant
-    of gcc. Will download the compiler if needed
-    '''
-
-    # Get the repository if we don't have all the information
-    if not (arch and version and threading and exceptions and revision):
-        versions = repository(log = log)
-
-    # Determine some defaults
-    version = version or max(versions.keys())
-    if not arch:
-        arch = platform.machine().lower()
-        if arch == 'x86':
-            arch = 'i686'
-        elif arch == 'amd64':
-            arch = 'x86_64'
-    if not threading:
-        keys = versions[version][arch].keys()
-        if 'posix' in keys:
-            threading = 'posix'
-        elif 'win32' in keys:
-            threading = 'win32'
-        else:
-            threading = keys[0]
-    if not exceptions:
-        keys = versions[version][arch][threading].keys()
-        if 'seh' in keys:
-            exceptions = 'seh'
-        elif 'sjlj' in keys:
-            exceptions = 'sjlj'
-        else:
-            exceptions = keys[0]
-    if revision == None:
-        revision = max(versions[version][arch][threading][exceptions].keys())
-    if not location:
-        location = os.path.join(tempfile.gettempdir(), 'mingw-builds')
-
-    # Get the download url
-    url = versions[version][arch][threading][exceptions][revision]
-
-    # Tell the user whatzzup
-    log.info('finding MinGW %s', '.'.join(str(v) for v in version))
-    log.debug(' - arch: %s', arch)
-    log.debug(' - threading: %s', threading)
-    log.debug(' - exceptions: %s', exceptions)
-    log.debug(' - revision: %s', revision)
-    log.debug(' - url: %s', url)
-
-    # Store each specific revision differently
-    slug = '{version}-{arch}-{threading}-{exceptions}-rev{revision}'
-    slug = slug.format(
-        version = '.'.join(str(v) for v in version),
-        arch = arch,
-        threading = threading,
-        exceptions = exceptions,
-        revision = revision
-    )
-    if arch == 'x86_64':
-        root_dir = os.path.join(location, slug, 'mingw64')
-    elif arch == 'i686':
-        root_dir = os.path.join(location, slug, 'mingw32')
-    else:
-        raise ValueError('Unknown MinGW arch: ' + arch)
-
-    # Download if needed
-    if not os.path.exists(root_dir):
-        downloaded = download(url, os.path.join(location, slug), log = log)
-        if downloaded != root_dir:
-            raise ValueError('The location of mingw did not match\n%s\n%s'
-                % (downloaded, root_dir))
-
-    return root_dir
-
-def str2ver(string):
-    '''
-    Converts a version string into a tuple
-    '''
-    try:
-        version = tuple(int(v) for v in string.split('.'))
-        if len(version) is not 3:
-            raise ValueError()
-    except ValueError:
-        raise argparse.ArgumentTypeError(
-            'please provide a three digit version string')
-    return version
-
-def main():
-    '''
-    Invoked when the script is run directly by the python interpreter
-    '''
-    parser = argparse.ArgumentParser(
-        description = 'Downloads a specific version of MinGW',
-        formatter_class = argparse.ArgumentDefaultsHelpFormatter
-    )
-    parser.add_argument('--location',
-        help = 'the location to download the compiler to',
-        default = os.path.join(tempfile.gettempdir(), 'mingw-builds'))
-    parser.add_argument('--arch', required = True, choices = ['i686', 'x86_64'],
-        help = 'the target MinGW architecture string')
-    parser.add_argument('--version', type = str2ver,
-        help = 'the version of GCC to download')
-    parser.add_argument('--threading', choices = ['posix', 'win32'],
-        help = 'the threading type of the compiler')
-    parser.add_argument('--exceptions', choices = ['sjlj', 'seh', 'dwarf'],
-        help = 'the method to throw exceptions')
-    parser.add_argument('--revision', type=int,
-        help = 'the revision of the MinGW release')
-    group = parser.add_mutually_exclusive_group()
-    group.add_argument('-v', '--verbose', action='store_true',
-        help='increase the script output verbosity')
-    group.add_argument('-q', '--quiet', action='store_true',
-        help='only print errors and warning')
-    args = parser.parse_args()
-
-    # Create the logger
-    logger = logging.getLogger('mingw')
-    handler = logging.StreamHandler()
-    formatter = logging.Formatter('%(message)s')
-    handler.setFormatter(formatter)
-    logger.addHandler(handler)
-    logger.setLevel(logging.INFO)
-    if args.quiet:
-        logger.setLevel(logging.WARN)
-    if args.verbose:
-        logger.setLevel(logging.DEBUG)
-
-    # Get MinGW
-    root_dir = root(location = args.location, arch = args.arch,
-        version = args.version, threading = args.threading,
-        exceptions = args.exceptions, revision = args.revision,
-        log = logger)
-
-    sys.stdout.write('%s\n' % os.path.join(root_dir, 'bin'))
-
-if __name__ == '__main__':
-    try:
-        main()
-    except IOError as e:
-        sys.stderr.write('IO error: %s\n' % e)
-        sys.exit(1)
-    except OSError as e:
-        sys.stderr.write('OS error: %s\n' % e)
-        sys.exit(1)
-    except KeyboardInterrupt as e:
-        sys.stderr.write('Killed\n')
-        sys.exit(1)
diff --git a/utils/google-benchmark/src/CMakeLists.txt b/utils/google-benchmark/src/CMakeLists.txt
index 7707773..4038875 100644
--- a/utils/google-benchmark/src/CMakeLists.txt
+++ b/utils/google-benchmark/src/CMakeLists.txt
@@ -21,55 +21,24 @@
 
 # Link threads.
 target_link_libraries(benchmark  ${BENCHMARK_CXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
-find_library(LIBRT rt)
-if(LIBRT)
-  target_link_libraries(benchmark ${LIBRT})
-endif()
 
 # We need extra libraries on Windows
 if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
   target_link_libraries(benchmark Shlwapi)
 endif()
 
-set(include_install_dir "include")
-set(lib_install_dir "lib/")
-set(bin_install_dir "bin/")
-set(config_install_dir "lib/cmake/${PROJECT_NAME}")
-
-set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated")
-
-set(version_config "${generated_dir}/${PROJECT_NAME}ConfigVersion.cmake")
-set(project_config "${generated_dir}/${PROJECT_NAME}Config.cmake")
-set(targets_export_name "${PROJECT_NAME}Targets")
-
-set(namespace "${PROJECT_NAME}::")
-
-include(CMakePackageConfigHelpers)
-write_basic_package_version_file(
-    "${version_config}" VERSION ${GIT_VERSION} COMPATIBILITY SameMajorVersion
-)
-
-configure_file("${PROJECT_SOURCE_DIR}/cmake/Config.cmake.in" "${project_config}" @ONLY)
+# Expose public API
+target_include_directories(benchmark PUBLIC ${PROJECT_SOURCE_DIR}/include)
 
 # Install target (will install the library to specified CMAKE_INSTALL_PREFIX variable)
 install(
   TARGETS benchmark
-  EXPORT ${targets_export_name}
-  ARCHIVE DESTINATION ${lib_install_dir}
-  LIBRARY DESTINATION ${lib_install_dir}
-  RUNTIME DESTINATION ${bin_install_dir}
-  INCLUDES DESTINATION ${include_install_dir})
+  ARCHIVE DESTINATION lib
+  LIBRARY DESTINATION lib
+  RUNTIME DESTINATION bin
+  COMPONENT library)
 
 install(
   DIRECTORY "${PROJECT_SOURCE_DIR}/include/benchmark"
-  DESTINATION ${include_install_dir}
+  DESTINATION include
   FILES_MATCHING PATTERN "*.*h")
-
-install(
-    FILES "${project_config}" "${version_config}"
-    DESTINATION "${config_install_dir}")
-
-install(
-    EXPORT "${targets_export_name}"
-    NAMESPACE "${namespace}"
-    DESTINATION "${config_install_dir}")
diff --git a/utils/google-benchmark/src/benchmark.cc b/utils/google-benchmark/src/benchmark.cc
index 00ffa07..95f6a25 100644
--- a/utils/google-benchmark/src/benchmark.cc
+++ b/utils/google-benchmark/src/benchmark.cc
@@ -37,7 +37,6 @@
 #include "colorprint.h"
 #include "commandlineflags.h"
 #include "complexity.h"
-#include "counter.h"
 #include "log.h"
 #include "mutex.h"
 #include "re.h"
@@ -146,7 +145,6 @@
     std::string report_label_;
     std::string error_message_;
     bool has_error_ = false;
-    UserCounters counters;
   };
   GUARDED_BY(GetBenchmarkMutex()) Result results;
 
@@ -251,7 +249,6 @@
     report.complexity_n = results.complexity_n;
     report.complexity = b.complexity;
     report.complexity_lambda = b.complexity_lambda;
-    report.counters = results.counters;
   }
   return report;
 }
@@ -275,7 +272,6 @@
     results.bytes_processed += st.bytes_processed();
     results.items_processed += st.items_processed();
     results.complexity_n += st.complexity_length_n();
-    internal::Increment(&results.counters, st.counters);
   }
   manager->NotifyThreadComplete();
 }
@@ -285,8 +281,7 @@
     std::vector<BenchmarkReporter::Run>* complexity_reports) {
   std::vector<BenchmarkReporter::Run> reports;  // return value
 
-  const bool has_explicit_iteration_count = b.iterations != 0;
-  size_t iters = has_explicit_iteration_count ? b.iterations : 1;
+  size_t iters = 1;
   std::unique_ptr<internal::ThreadManager> manager;
   std::vector<std::thread> pool(b.threads - 1);
   const int repeats =
@@ -296,7 +291,7 @@
       (b.report_mode == internal::RM_Unspecified
            ? FLAGS_benchmark_report_aggregates_only
            : b.report_mode == internal::RM_ReportAggregatesOnly);
-  for (int repetition_num = 0; repetition_num < repeats; repetition_num++) {
+  for (int i = 0; i < repeats; i++) {
     for (;;) {
       // Try benchmark
       VLOG(2) << "Running " << b.name << " for " << iters << "\n";
@@ -332,20 +327,10 @@
 
       const double min_time =
           !IsZero(b.min_time) ? b.min_time : FLAGS_benchmark_min_time;
-
-      // Determine if this run should be reported; Either it has
-      // run for a sufficient amount of time or because an error was reported.
-      const bool should_report =  repetition_num > 0
-        || has_explicit_iteration_count // An exact iteration count was requested
-        || results.has_error_
-        || iters >= kMaxIterations
-        || seconds >= min_time // the elapsed time is large enough
-        // CPU time is specified but the elapsed real time greatly exceeds the
-        // minimum time. Note that user provided timers are except from this
-        // sanity check.
-        || ((results.real_time_used >= 5 * min_time) && !b.use_manual_time);
-
-      if (should_report) {
+      // If this was the first run, was elapsed time or cpu time large enough?
+      // If this is not the first run, go with the current value of iter.
+      if ((i > 0) || results.has_error_ || (iters >= kMaxIterations) ||
+          (seconds >= min_time) || (results.real_time_used >= 5 * min_time)) {
         BenchmarkReporter::Run report =
             CreateRunReport(b, results, iters, seconds);
         if (!report.error_occurred && b.complexity != oNone)
@@ -401,7 +386,6 @@
       items_processed_(0),
       complexity_n_(0),
       error_occurred_(false),
-      counters(),
       thread_index(thread_i),
       threads(n_threads),
       max_iterations(max_iters),
@@ -650,7 +634,7 @@
         // TODO: Remove this.
         ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) ||
         ParseInt32Flag(argv[i], "v", &FLAGS_v)) {
-      for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1];
+      for (int j = i; j != *argc; ++j) argv[j] = argv[j + 1];
 
       --(*argc);
       --i;
@@ -680,11 +664,4 @@
   internal::LogLevel() = FLAGS_v;
 }
 
-bool ReportUnrecognizedArguments(int argc, char** argv) {
-  for (int i = 1; i < argc; ++i) {
-    fprintf(stderr, "%s: error: unrecognized command-line flag: %s\n", argv[0], argv[i]);
-  }
-  return argc > 1;
-}
-
 }  // end namespace benchmark
diff --git a/utils/google-benchmark/src/benchmark_api_internal.h b/utils/google-benchmark/src/benchmark_api_internal.h
index 828ed12..8b97ce6 100644
--- a/utils/google-benchmark/src/benchmark_api_internal.h
+++ b/utils/google-benchmark/src/benchmark_api_internal.h
@@ -24,11 +24,9 @@
   bool use_manual_time;
   BigO complexity;
   BigOFunc* complexity_lambda;
-  UserCounters counters;
   bool last_benchmark_instance;
   int repetitions;
   double min_time;
-  size_t iterations;
   int threads;  // Number of concurrent threads to us
 };
 
diff --git a/utils/google-benchmark/src/benchmark_register.cc b/utils/google-benchmark/src/benchmark_register.cc
index fe37320..4e580d8 100644
--- a/utils/google-benchmark/src/benchmark_register.cc
+++ b/utils/google-benchmark/src/benchmark_register.cc
@@ -143,7 +143,6 @@
         instance.time_unit = family->time_unit_;
         instance.range_multiplier = family->range_multiplier_;
         instance.min_time = family->min_time_;
-        instance.iterations = family->iterations_;
         instance.repetitions = family->repetitions_;
         instance.use_real_time = family->use_real_time_;
         instance.use_manual_time = family->use_manual_time_;
@@ -164,17 +163,16 @@
             }
           }
 
-          instance.name += std::to_string(arg);
+          AppendHumanReadable(arg, &instance.name);
           ++arg_i;
         }
 
-        if (!IsZero(family->min_time_))
+        if (!IsZero(family->min_time_)) {
           instance.name += StringPrintF("/min_time:%0.3f", family->min_time_);
-        if (family->iterations_ != 0)
-          instance.name += StringPrintF("/iterations:%d", family->iterations_);
-        if (family->repetitions_ != 0)
+        }
+        if (family->repetitions_ != 0) {
           instance.name += StringPrintF("/repeats:%d", family->repetitions_);
-
+        }
         if (family->use_manual_time_) {
           instance.name += "/manual_time";
         } else if (family->use_real_time_) {
@@ -221,7 +219,6 @@
       time_unit_(kNanosecond),
       range_multiplier_(kRangeMultiplier),
       min_time_(0),
-      iterations_(0),
       repetitions_(0),
       use_real_time_(false),
       use_manual_time_(false),
@@ -347,22 +344,6 @@
   return this;
 }
 
-
-Benchmark* Benchmark::MinTime(double t) {
-  CHECK(t > 0.0);
-  CHECK(iterations_ == 0);
-  min_time_ = t;
-  return this;
-}
-
-
-Benchmark* Benchmark::Iterations(size_t n) {
-  CHECK(n > 0);
-  CHECK(IsZero(min_time_));
-  iterations_ = n;
-  return this;
-}
-
 Benchmark* Benchmark::Repetitions(int n) {
   CHECK(n > 0);
   repetitions_ = n;
@@ -374,6 +355,12 @@
   return this;
 }
 
+Benchmark* Benchmark::MinTime(double t) {
+  CHECK(t > 0.0);
+  min_time_ = t;
+  return this;
+}
+
 Benchmark* Benchmark::UseRealTime() {
   CHECK(!use_manual_time_)
       << "Cannot set UseRealTime and UseManualTime simultaneously.";
diff --git a/utils/google-benchmark/src/complexity.cc b/utils/google-benchmark/src/complexity.cc
index 02adbef..dfab791 100644
--- a/utils/google-benchmark/src/complexity.cc
+++ b/utils/google-benchmark/src/complexity.cc
@@ -171,22 +171,6 @@
   // All repetitions should be run with the same number of iterations so we
   // can take this information from the first benchmark.
   int64_t const run_iterations = reports.front().iterations;
-  // create stats for user counters
-  struct CounterStat {
-    Counter c;
-    Stat1_d s;
-  };
-  std::map< std::string, CounterStat > counter_stats;
-  for(Run const& r : reports) {
-    for(auto const& cnt : r.counters) {
-      auto it = counter_stats.find(cnt.first);
-      if(it == counter_stats.end()) {
-        counter_stats.insert({cnt.first, {cnt.second, Stat1_d{}}});
-      } else {
-        CHECK_EQ(counter_stats[cnt.first].c.flags, cnt.second.flags);
-      }
-    }
-  }
 
   // Populate the accumulators.
   for (Run const& run : reports) {
@@ -199,12 +183,6 @@
         Stat1_d(run.cpu_accumulated_time / run.iterations, run.iterations);
     items_per_second_stat += Stat1_d(run.items_per_second, run.iterations);
     bytes_per_second_stat += Stat1_d(run.bytes_per_second, run.iterations);
-    // user counters
-    for(auto const& cnt : run.counters) {
-      auto it = counter_stats.find(cnt.first);
-      CHECK_NE(it, counter_stats.end());
-      it->second.s += Stat1_d(cnt.second, run.iterations);
-    }
   }
 
   // Get the data from the accumulator to BenchmarkReporter::Run's.
@@ -218,11 +196,6 @@
   mean_data.bytes_per_second = bytes_per_second_stat.Mean();
   mean_data.items_per_second = items_per_second_stat.Mean();
   mean_data.time_unit = reports[0].time_unit;
-  // user counters
-  for(auto const& kv : counter_stats) {
-    auto c = Counter(kv.second.s.Mean(), counter_stats[kv.first].c.flags);
-    mean_data.counters[kv.first] = c;
-  }
 
   // Only add label to mean/stddev if it is same for all runs
   mean_data.report_label = reports[0].report_label;
@@ -242,11 +215,6 @@
   stddev_data.bytes_per_second = bytes_per_second_stat.StdDev();
   stddev_data.items_per_second = items_per_second_stat.StdDev();
   stddev_data.time_unit = reports[0].time_unit;
-  // user counters
-  for(auto const& kv : counter_stats) {
-    auto c = Counter(kv.second.s.StdDev(), counter_stats[kv.first].c.flags);
-    stddev_data.counters[kv.first] = c;
-  }
 
   results.push_back(mean_data);
   results.push_back(stddev_data);
@@ -295,11 +263,6 @@
   big_o.report_big_o = true;
   big_o.complexity = result_cpu.complexity;
 
-  // All the time results are reported after being multiplied by the
-  // time unit multiplier. But since RMS is a relative quantity it
-  // should not be multiplied at all. So, here, we _divide_ it by the
-  // multiplier so that when it is multiplied later the result is the
-  // correct one.
   double multiplier = GetTimeUnitMultiplier(reports[0].time_unit);
 
   // Only add label to mean/stddev if it is same for all runs
@@ -312,9 +275,6 @@
   rms.cpu_accumulated_time = result_cpu.rms / multiplier;
   rms.report_rms = true;
   rms.complexity = result_cpu.complexity;
-  // don't forget to keep the time unit, or we won't be able to
-  // recover the correct value.
-  rms.time_unit = reports[0].time_unit;
 
   results.push_back(big_o);
   results.push_back(rms);
diff --git a/utils/google-benchmark/src/console_reporter.cc b/utils/google-benchmark/src/console_reporter.cc
index 3f3de02..7e0cca3 100644
--- a/utils/google-benchmark/src/console_reporter.cc
+++ b/utils/google-benchmark/src/console_reporter.cc
@@ -14,7 +14,6 @@
 
 #include "benchmark/reporter.h"
 #include "complexity.h"
-#include "counter.h"
 
 #include <algorithm>
 #include <cstdint>
@@ -35,7 +34,6 @@
 
 bool ConsoleReporter::ReportContext(const Context& context) {
   name_field_width_ = context.name_field_width;
-  printed_header_ = false;
 
   PrintBasicContext(&GetErrorStream(), context);
 
@@ -47,32 +45,16 @@
     color_output_ = false;
   }
 #endif
+  std::string str =
+      FormatString("%-*s %13s %13s %10s\n", static_cast<int>(name_field_width_),
+                   "Benchmark", "Time", "CPU", "Iterations");
+  GetOutputStream() << str << std::string(str.length() - 1, '-') << "\n";
 
   return true;
 }
 
-void ConsoleReporter::PrintHeader(const Run& run) {
-  std::string str =
-      FormatString("%-*s %13s %13s %10s\n", static_cast<int>(name_field_width_),
-                   "Benchmark", "Time", "CPU", "Iterations");
-  if(!run.counters.empty()) {
-    str += " UserCounters...";
-  }
-  std::string line = std::string(str.length(), '-');
-  GetOutputStream() << line << "\n" << str << line << "\n";
-}
-
 void ConsoleReporter::ReportRuns(const std::vector<Run>& reports) {
-  for (const auto& run : reports) {
-    // print the header if none was printed yet
-    if (!printed_header_) {
-      printed_header_ = true;
-      PrintHeader(run);
-    }
-    // As an alternative to printing the headers like this, we could sort
-    // the benchmarks by header and then print like that.
-    PrintRunData(run);
-  }
+  for (const auto& run : reports) PrintRunData(run);
 }
 
 static void IgnoreColorPrint(std::ostream& out, LogColor, const char* fmt,
@@ -132,11 +114,6 @@
     printer(Out, COLOR_CYAN, "%10lld", result.iterations);
   }
 
-  for (auto& c : result.counters) {
-    auto const& s = HumanReadableNumber(c.second.value);
-    printer(Out, COLOR_DEFAULT, " %s=%s", c.first.c_str(), s.c_str());
-  }
-
   if (!rate.empty()) {
     printer(Out, COLOR_DEFAULT, " %*s", 13, rate.c_str());
   }
diff --git a/utils/google-benchmark/src/counter.cc b/utils/google-benchmark/src/counter.cc
deleted file mode 100644
index 307863d..0000000
--- a/utils/google-benchmark/src/counter.cc
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright 2015 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "counter.h"
-
-namespace benchmark {
-namespace internal {
-
-double Finish(Counter const& c, double cpu_time, double num_threads) {
-  double v = c.value;
-  if (c.flags & Counter::kIsRate) {
-    v /= cpu_time;
-  }
-  if (c.flags & Counter::kAvgThreads) {
-    v /= num_threads;
-  }
-  return v;
-}
-
-void Finish(UserCounters *l, double cpu_time, double num_threads) {
-  for (auto &c : *l) {
-    c.second = Finish(c.second, cpu_time, num_threads);
-  }
-}
-
-void Increment(UserCounters *l, UserCounters const& r) {
-  // add counters present in both or just in *l
-  for (auto &c : *l) {
-    auto it = r.find(c.first);
-    if (it != r.end()) {
-      c.second = c.second + it->second;
-    }
-  }
-  // add counters present in r, but not in *l
-  for (auto const &tc : r) {
-    auto it = l->find(tc.first);
-    if (it == l->end()) {
-      (*l)[tc.first] = tc.second;
-    }
-  }
-}
-
-bool SameNames(UserCounters const& l, UserCounters const& r) {
-  if (&l == &r) return true;
-  if (l.size() != r.size()) {
-    return false;
-  }
-  for (auto const& c : l) {
-    if ( r.find(c.first) == r.end()) {
-      return false;
-    }
-  }
-  return true;
-}
-
-} // end namespace internal
-} // end namespace benchmark
diff --git a/utils/google-benchmark/src/counter.h b/utils/google-benchmark/src/counter.h
deleted file mode 100644
index bbb92d9..0000000
--- a/utils/google-benchmark/src/counter.h
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2015 Google Inc. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "benchmark/benchmark_api.h"
-
-namespace benchmark {
-
-// these counter-related functions are hidden to reduce API surface.
-namespace internal {
-void Finish(UserCounters *l, double time, double num_threads);
-void Increment(UserCounters *l, UserCounters const& r);
-bool SameNames(UserCounters const& l, UserCounters const& r);
-} // end namespace internal
-
-} //end namespace benchmark
diff --git a/utils/google-benchmark/src/csv_reporter.cc b/utils/google-benchmark/src/csv_reporter.cc
index 6779815..18ab3b6 100644
--- a/utils/google-benchmark/src/csv_reporter.cc
+++ b/utils/google-benchmark/src/csv_reporter.cc
@@ -24,7 +24,6 @@
 
 #include "string_util.h"
 #include "timers.h"
-#include "check.h"
 
 // File format reference: http://edoceo.com/utilitas/csv-file-format.
 
@@ -39,51 +38,21 @@
 
 bool CSVReporter::ReportContext(const Context& context) {
   PrintBasicContext(&GetErrorStream(), context);
+
+  std::ostream& Out = GetOutputStream();
+  for (auto B = elements.begin(); B != elements.end();) {
+    Out << *B++;
+    if (B != elements.end()) Out << ",";
+  }
+  Out << "\n";
   return true;
 }
 
-void CSVReporter::ReportRuns(const std::vector<Run> & reports) {
-  std::ostream& Out = GetOutputStream();
-
-  if (!printed_header_) {
-    // save the names of all the user counters
-    for (const auto& run : reports) {
-      for (const auto& cnt : run.counters) {
-        user_counter_names_.insert(cnt.first);
-      }
-    }
-
-    // print the header
-    for (auto B = elements.begin(); B != elements.end();) {
-      Out << *B++;
-      if (B != elements.end()) Out << ",";
-    }
-    for (auto B = user_counter_names_.begin(); B != user_counter_names_.end();) {
-      Out << ",\"" << *B++ << "\"";
-    }
-    Out << "\n";
-
-    printed_header_ = true;
-  } else {
-    // check that all the current counters are saved in the name set
-    for (const auto& run : reports) {
-      for (const auto& cnt : run.counters) {
-        CHECK(user_counter_names_.find(cnt.first) != user_counter_names_.end())
-              << "All counters must be present in each run. "
-              << "Counter named \"" << cnt.first
-              << "\" was not in a run after being added to the header";
-      }
-    }
-  }
-
-  // print results for each run
-  for (const auto& run : reports) {
-    PrintRunData(run);
-  }
-
+void CSVReporter::ReportRuns(const std::vector<Run>& reports) {
+  for (const auto& run : reports) PrintRunData(run);
 }
 
-void CSVReporter::PrintRunData(const Run & run) {
+void CSVReporter::PrintRunData(const Run& run) {
   std::ostream& Out = GetOutputStream();
 
   // Field with embedded double-quote characters must be doubled and the field
@@ -133,13 +102,6 @@
     Out << "\"" << label << "\"";
   }
   Out << ",,";  // for error_occurred and error_message
-
-  // Print user counters
-  for (const auto &ucn : user_counter_names_) {
-    auto it = run.counters.find(ucn);
-    CHECK(it != run.counters.end());
-    Out << "," << it->second;
-  }
   Out << '\n';
 }
 
diff --git a/utils/google-benchmark/src/cycleclock.h b/utils/google-benchmark/src/cycleclock.h
index e0f9b01..e4825d4 100644
--- a/utils/google-benchmark/src/cycleclock.h
+++ b/utils/google-benchmark/src/cycleclock.h
@@ -43,11 +43,6 @@
 
 #ifndef BENCHMARK_OS_WINDOWS
 #include <sys/time.h>
-#include <time.h>
-#endif
-
-#ifdef BENCHMARK_OS_EMSCRIPTEN
-#include <emscripten.h>
 #endif
 
 namespace benchmark {
@@ -70,10 +65,6 @@
   // counter pauses; it does not continue counting, nor does it
   // reset to zero.
   return mach_absolute_time();
-#elif defined(BENCHMARK_OS_EMSCRIPTEN)
-  // this goes above x86-specific code because old versions of Emscripten
-  // define __x86_64__, although they have nothing to do with it.
-  return static_cast<int64_t>(emscripten_get_now() * 1e+6);
 #elif defined(__i386__)
   int64_t ret;
   __asm__ volatile("rdtsc" : "=A"(ret));
@@ -88,7 +79,7 @@
   asm("mftbu %0" : "=r"(tbu0));
   asm("mftb  %0" : "=r"(tbl));
   asm("mftbu %0" : "=r"(tbu1));
-  tbl &= -static_cast<int64_t>(tbu0 == tbu1);
+  tbl &= -static_cast<int64>(tbu0 == tbu1);
   // high 32 bits in tbu1; low 32 bits in tbl  (tbu0 is garbage)
   return (tbu1 << 32) | tbl;
 #elif defined(__sparc__)
@@ -108,22 +99,6 @@
   _asm rdtsc
 #elif defined(COMPILER_MSVC)
   return __rdtsc();
-#elif defined(BENCHMARK_OS_NACL)
-  // Native Client validator on x86/x86-64 allows RDTSC instructions,
-  // and this case is handled above. Native Client validator on ARM
-  // rejects MRC instructions (used in the ARM-specific sequence below),
-  // so we handle it here. Portable Native Client compiles to
-  // architecture-agnostic bytecode, which doesn't provide any
-  // cycle counter access mnemonics.
-
-  // Native Client does not provide any API to access cycle counter.
-  // Use clock_gettime(CLOCK_MONOTONIC, ...) instead of gettimeofday
-  // because is provides nanosecond resolution (which is noticable at
-  // least for PNaCl modules running on x86 Mac & Linux).
-  // Initialize to always return 0 if clock_gettime fails.
-  struct timespec ts = { 0, 0 };
-  clock_gettime(CLOCK_MONOTONIC, &ts);
-  return static_cast<int64_t>(ts.tv_sec) * 1000000000 + ts.tv_nsec;
 #elif defined(__aarch64__)
   // System timer of ARMv8 runs at a different frequency than the CPU's.
   // The frequency is fixed, typically in the range 1-50MHz.  It can be
@@ -133,9 +108,7 @@
   asm volatile("mrs %0, cntvct_el0" : "=r"(virtual_timer_value));
   return virtual_timer_value;
 #elif defined(__ARM_ARCH)
-  // V6 is the earliest arch that has a standard cyclecount
-  // Native Client validator doesn't allow MRC instructions.
-#if (__ARM_ARCH >= 6)
+#if (__ARM_ARCH >= 6)  // V6 is the earliest arch that has a standard cyclecount
   uint32_t pmccntr;
   uint32_t pmuseren;
   uint32_t pmcntenset;
diff --git a/utils/google-benchmark/src/internal_macros.h b/utils/google-benchmark/src/internal_macros.h
index ab9dd85..e8efcbb 100644
--- a/utils/google-benchmark/src/internal_macros.h
+++ b/utils/google-benchmark/src/internal_macros.h
@@ -30,26 +30,13 @@
 #elif defined(_WIN32)
 #define BENCHMARK_OS_WINDOWS 1
 #elif defined(__APPLE__)
-#include "TargetConditionals.h"
-  #if defined(TARGET_OS_MAC)
-    #define BENCHMARK_OS_MACOSX 1
-    #if defined(TARGET_OS_IPHONE)
-      #define BENCHMARK_OS_IOS 1
-    #endif
-  #endif
+// TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
+// that it is an apple system.
+#define BENCHMARK_OS_MACOSX 1
 #elif defined(__FreeBSD__)
 #define BENCHMARK_OS_FREEBSD 1
 #elif defined(__linux__)
 #define BENCHMARK_OS_LINUX 1
-#elif defined(__native_client__)
-#define BENCHMARK_OS_NACL 1
-#elif defined(EMSCRIPTEN)
-#define BENCHMARK_OS_EMSCRIPTEN 1
-#endif
-
-#if !__has_feature(cxx_exceptions) && !defined(__cpp_exceptions) \
-     && !defined(__EXCEPTIONS)
-#define BENCHMARK_HAS_NO_EXCEPTIONS
 #endif
 
 #endif  // BENCHMARK_INTERNAL_MACROS_H_
diff --git a/utils/google-benchmark/src/json_reporter.cc b/utils/google-benchmark/src/json_reporter.cc
index 5a65308..cea5f9b 100644
--- a/utils/google-benchmark/src/json_reporter.cc
+++ b/utils/google-benchmark/src/json_reporter.cc
@@ -154,15 +154,10 @@
         << indent
         << FormatKV("items_per_second", RoundDouble(run.items_per_second));
   }
-  for(auto &c : run.counters) {
-    out << ",\n"
-        << indent
-        << FormatKV(c.first, RoundDouble(c.second));
-  }
   if (!run.report_label.empty()) {
     out << ",\n" << indent << FormatKV("label", run.report_label);
   }
   out << '\n';
 }
 
-} // end namespace benchmark
+}  // end namespace benchmark
diff --git a/utils/google-benchmark/src/re.h b/utils/google-benchmark/src/re.h
index 01e9736..af4a498 100644
--- a/utils/google-benchmark/src/re.h
+++ b/utils/google-benchmark/src/re.h
@@ -15,15 +15,6 @@
 #ifndef BENCHMARK_RE_H_
 #define BENCHMARK_RE_H_
 
-#include "internal_macros.h"
-
-// Prefer C regex libraries when compiling w/o exceptions so that we can
-// correctly report errors.
-#if defined(BENCHMARK_HAS_NO_EXCEPTIONS) && defined(HAVE_STD_REGEX) && \
-    (defined(HAVE_GNU_POSIX_REGEX) || defined(HAVE_POSIX_REGEX))
-#undef HAVE_STD_REGEX
-#endif
-
 #if defined(HAVE_STD_REGEX)
 #include <regex>
 #elif defined(HAVE_GNU_POSIX_REGEX)
@@ -71,20 +62,15 @@
 #if defined(HAVE_STD_REGEX)
 
 inline bool Regex::Init(const std::string& spec, std::string* error) {
-#ifdef BENCHMARK_HAS_NO_EXCEPTIONS
-  ((void)error); // suppress unused warning
-#else
   try {
-#endif
     re_ = std::regex(spec, std::regex_constants::extended);
+
     init_ = true;
-#ifndef BENCHMARK_HAS_NO_EXCEPTIONS
   } catch (const std::regex_error& e) {
     if (error) {
       *error = e.what();
     }
   }
-#endif
   return init_;
 }
 
diff --git a/utils/google-benchmark/src/sleep.cc b/utils/google-benchmark/src/sleep.cc
index 54aa04a..918abc4 100644
--- a/utils/google-benchmark/src/sleep.cc
+++ b/utils/google-benchmark/src/sleep.cc
@@ -15,7 +15,6 @@
 #include "sleep.h"
 
 #include <cerrno>
-#include <cstdlib>
 #include <ctime>
 
 #include "internal_macros.h"
@@ -41,7 +40,7 @@
 }
 
 void SleepForMilliseconds(int milliseconds) {
-  SleepForMicroseconds(milliseconds * kNumMicrosPerMilli);
+  SleepForMicroseconds(static_cast<int>(milliseconds) * kNumMicrosPerMilli);
 }
 
 void SleepForSeconds(double seconds) {
diff --git a/utils/google-benchmark/src/sleep.h b/utils/google-benchmark/src/sleep.h
index f98551a..f1e515c 100644
--- a/utils/google-benchmark/src/sleep.h
+++ b/utils/google-benchmark/src/sleep.h
@@ -1,12 +1,14 @@
 #ifndef BENCHMARK_SLEEP_H_
 #define BENCHMARK_SLEEP_H_
 
+#include <cstdint>
+
 namespace benchmark {
-const int kNumMillisPerSecond = 1000;
-const int kNumMicrosPerMilli = 1000;
-const int kNumMicrosPerSecond = kNumMillisPerSecond * 1000;
-const int kNumNanosPerMicro = 1000;
-const int kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
+const int64_t kNumMillisPerSecond = 1000LL;
+const int64_t kNumMicrosPerMilli = 1000LL;
+const int64_t kNumMicrosPerSecond = kNumMillisPerSecond * 1000LL;
+const int64_t kNumNanosPerMicro = 1000LL;
+const int64_t kNumNanosPerSecond = kNumNanosPerMicro * kNumMicrosPerSecond;
 
 void SleepForMilliseconds(int milliseconds);
 void SleepForSeconds(double seconds);
diff --git a/utils/google-benchmark/src/string_util.cc b/utils/google-benchmark/src/string_util.cc
index cd4e7cf..4cefbfb 100644
--- a/utils/google-benchmark/src/string_util.cc
+++ b/utils/google-benchmark/src/string_util.cc
@@ -45,8 +45,6 @@
       std::max(thresh, 1.0 / std::pow(10.0, precision));
   const double big_threshold = adjusted_threshold * one_k;
   const double small_threshold = adjusted_threshold;
-  // Values in ]simple_threshold,small_threshold[ will be printed as-is
-  const double simple_threshold = 0.01;
 
   if (val > big_threshold) {
     // Positive powers
@@ -64,16 +62,14 @@
     *exponent = 0;
   } else if (val < small_threshold) {
     // Negative powers
-    if (val < simple_threshold) {
-      double scaled = val;
-      for (size_t i = 0; i < arraysize(kSmallSIUnits); ++i) {
-        scaled *= one_k;
-        if (scaled >= small_threshold) {
-          mantissa_stream << scaled;
-          *exponent = -static_cast<int64_t>(i + 1);
-          *mantissa = mantissa_stream.str();
-          return;
-        }
+    double scaled = val;
+    for (size_t i = 0; i < arraysize(kSmallSIUnits); ++i) {
+      scaled *= one_k;
+      if (scaled >= small_threshold) {
+        mantissa_stream << scaled;
+        *exponent = -static_cast<int64_t>(i + 1);
+        *mantissa = mantissa_stream.str();
+        return;
       }
     }
     mantissa_stream << val;
diff --git a/utils/google-benchmark/src/sysinfo.cc b/utils/google-benchmark/src/sysinfo.cc
index 7feb79e..dd1e663 100644
--- a/utils/google-benchmark/src/sysinfo.cc
+++ b/utils/google-benchmark/src/sysinfo.cc
@@ -75,9 +75,7 @@
     char line[1024];
     char* err;
     memset(line, '\0', sizeof(line));
-    ssize_t read_err = read(fd, line, sizeof(line) - 1);
-    ((void)read_err); // prevent unused warning
-    CHECK(read_err >= 0);
+    CHECK(read(fd, line, sizeof(line) - 1));
     const long temp_value = strtol(line, &err, 10);
     if (line[0] != '\0' && (*err == '\n' || *err == '\0')) {
       *value = temp_value;
@@ -297,13 +295,8 @@
       (size == sizeof(cpu_freq))) {
     cpuinfo_cycles_per_second = cpu_freq;
   } else {
-    #if defined BENCHMARK_OS_IOS
-    fprintf(stderr, "CPU frequency cannot be detected. \n");
-    cpuinfo_cycles_per_second = 0;
-    #else
     fprintf(stderr, "%s\n", strerror(errno));
     std::exit(EXIT_FAILURE);
-    #endif
   }
 #else
   // Generic cycles per second counter
diff --git a/utils/google-benchmark/src/timers.cc b/utils/google-benchmark/src/timers.cc
index 8d56e8a..fadc08f 100644
--- a/utils/google-benchmark/src/timers.cc
+++ b/utils/google-benchmark/src/timers.cc
@@ -35,10 +35,6 @@
 #endif
 #endif
 
-#ifdef BENCHMARK_OS_EMSCRIPTEN
-#include <emscripten.h>
-#endif
-
 #include <cerrno>
 #include <cstdint>
 #include <cstdio>
@@ -104,7 +100,14 @@
 }  // end namespace
 
 double ProcessCPUUsage() {
-#if defined(BENCHMARK_OS_WINDOWS)
+// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+// https://github.com/google/benchmark/pull/292
+#if defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
+  struct timespec spec;
+  if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &spec) == 0)
+    return MakeTime(spec);
+  DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
+#elif defined(BENCHMARK_OS_WINDOWS)
   HANDLE proc = GetCurrentProcess();
   FILETIME creation_time;
   FILETIME exit_time;
@@ -114,28 +117,21 @@
                       &user_time))
     return MakeTime(kernel_time, user_time);
   DiagnoseAndExit("GetProccessTimes() failed");
-#elif defined(BENCHMARK_OS_EMSCRIPTEN)
-  // clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) returns 0 on Emscripten.
-  // Use Emscripten-specific API. Reported CPU time would be exactly the
-  // same as total time, but this is ok because there aren't long-latency
-  // syncronous system calls in Emscripten.
-  return emscripten_get_now() * 1e-3;
-#elif defined(CLOCK_PROCESS_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
-  // FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
-  // https://github.com/google/benchmark/pull/292
-  struct timespec spec;
-  if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &spec) == 0)
-    return MakeTime(spec);
-  DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
 #else
   struct rusage ru;
   if (getrusage(RUSAGE_SELF, &ru) == 0) return MakeTime(ru);
-  DiagnoseAndExit("getrusage(RUSAGE_SELF, ...) failed");
+  DiagnoseAndExit("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, ...) failed");
 #endif
 }
 
 double ThreadCPUUsage() {
-#if defined(BENCHMARK_OS_WINDOWS)
+// FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
+// https://github.com/google/benchmark/pull/292
+#if defined(CLOCK_THREAD_CPUTIME_ID) && !defined(BENCHMARK_OS_MACOSX)
+  struct timespec ts;
+  if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) return MakeTime(ts);
+  DiagnoseAndExit("clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) failed");
+#elif defined(BENCHMARK_OS_WINDOWS)
   HANDLE this_thread = GetCurrentThread();
   FILETIME creation_time;
   FILETIME exit_time;
@@ -145,8 +141,6 @@
                  &user_time);
   return MakeTime(kernel_time, user_time);
 #elif defined(BENCHMARK_OS_MACOSX)
-  // FIXME We want to use clock_gettime, but its not available in MacOS 10.11. See
-  // https://github.com/google/benchmark/pull/292
   mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
   thread_basic_info_data_t info;
   mach_port_t thread = pthread_mach_thread_np(pthread_self());
@@ -155,13 +149,6 @@
     return MakeTime(info);
   }
   DiagnoseAndExit("ThreadCPUUsage() failed when evaluating thread_info");
-#elif defined(BENCHMARK_OS_EMSCRIPTEN)
-  // Emscripten doesn't support traditional threads
-  return ProcessCPUUsage();
-#elif defined(CLOCK_THREAD_CPUTIME_ID)
-  struct timespec ts;
-  if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &ts) == 0) return MakeTime(ts);
-  DiagnoseAndExit("clock_gettime(CLOCK_THREAD_CPUTIME_ID, ...) failed");
 #else
 #error Per-thread timing is not available on your system.
 #endif
diff --git a/utils/google-benchmark/test/CMakeLists.txt b/utils/google-benchmark/test/CMakeLists.txt
index 14ba7a6..8724598 100644
--- a/utils/google-benchmark/test/CMakeLists.txt
+++ b/utils/google-benchmark/test/CMakeLists.txt
@@ -2,25 +2,6 @@
 
 find_package(Threads REQUIRED)
 
-# NOTE: Some tests use `<cassert>` to perform the test. Therefore we must
-# strip -DNDEBUG from the default CMake flags in DEBUG mode.
-string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
-if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" )
-  add_definitions( -UNDEBUG )
-  add_definitions(-DTEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS)
-  # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines.
-  foreach (flags_var_to_scrub
-      CMAKE_CXX_FLAGS_RELEASE
-      CMAKE_CXX_FLAGS_RELWITHDEBINFO
-      CMAKE_CXX_FLAGS_MINSIZEREL
-      CMAKE_C_FLAGS_RELEASE
-      CMAKE_C_FLAGS_RELWITHDEBINFO
-      CMAKE_C_FLAGS_MINSIZEREL)
-    string (REGEX REPLACE "(^| )[/-]D *NDEBUG($| )" " "
-      "${flags_var_to_scrub}" "${${flags_var_to_scrub}}")
-  endforeach()
-endif()
-
 # NOTE: These flags must be added after find_package(Threads REQUIRED) otherwise
 # they will break the configuration check.
 if (DEFINED BENCHMARK_CXX_LINKER_FLAGS)
diff --git a/utils/google-benchmark/test/benchmark_test.cc b/utils/google-benchmark/test/benchmark_test.cc
index 5773133..d832f81 100644
--- a/utils/google-benchmark/test/benchmark_test.cc
+++ b/utils/google-benchmark/test/benchmark_test.cc
@@ -150,7 +150,7 @@
 BENCHMARK(BM_LongTest)->Range(1 << 16, 1 << 28);
 
 static void BM_ParallelMemset(benchmark::State& state) {
-  int size = state.range(0) / static_cast<int>(sizeof(int));
+  int size = state.range(0) / sizeof(int);
   int thread_size = size / state.threads;
   int from = thread_size * state.thread_index;
   int to = from + thread_size;
@@ -209,27 +209,11 @@
                   std::pair<int, double>(42, 3.8));
 
 void BM_non_template_args(benchmark::State& state, int, double) {
-  while(state.KeepRunning()) {}
+  while (state.KeepRunning()) {
+  }
 }
 BENCHMARK_CAPTURE(BM_non_template_args, basic_test, 0, 0);
 
-static void BM_UserCounter(benchmark::State& state) {
-  static const int depth = 1024;
-  while (state.KeepRunning()) {
-    benchmark::DoNotOptimize(CalculatePi(depth));
-  }
-  state.counters["Foo"] = 1;
-  state.counters["Bar"] = 2;
-  state.counters["Baz"] = 3;
-  state.counters["Bat"] = 5;
-#ifdef BENCHMARK_HAS_CXX11
-  state.counters.insert({{"Foo", 2}, {"Bar", 3}, {"Baz", 5}, {"Bat", 6}});
-#endif
-}
-BENCHMARK(BM_UserCounter)->Threads(8);
-BENCHMARK(BM_UserCounter)->ThreadRange(1, 32);
-BENCHMARK(BM_UserCounter)->ThreadPerCpu();
-
 #endif  // __cplusplus >= 201103L
 
 static void BM_DenseThreadRanges(benchmark::State& st) {
diff --git a/utils/google-benchmark/test/cxx03_test.cc b/utils/google-benchmark/test/cxx03_test.cc
index a79d964..4f3d0fb 100644
--- a/utils/google-benchmark/test/cxx03_test.cc
+++ b/utils/google-benchmark/test/cxx03_test.cc
@@ -39,10 +39,4 @@
 BENCHMARK_TEMPLATE(BM_template1, long);
 BENCHMARK_TEMPLATE1(BM_template1, int);
 
-void BM_counters(benchmark::State& state) {
-    BM_empty(state);
-    state.counters["Foo"] = 2;
-}
-BENCHMARK(BM_counters);
-
 BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/diagnostics_test.cc b/utils/google-benchmark/test/diagnostics_test.cc
index 1046730..c6c235d 100644
--- a/utils/google-benchmark/test/diagnostics_test.cc
+++ b/utils/google-benchmark/test/diagnostics_test.cc
@@ -26,7 +26,7 @@
 }
 
 void try_invalid_pause_resume(benchmark::State& state) {
-#if !defined(TEST_BENCHMARK_LIBRARY_HAS_NO_ASSERTIONS) && !defined(TEST_HAS_NO_EXCEPTIONS)
+#if !defined(NDEBUG) && !defined(TEST_HAS_NO_EXCEPTIONS)
   try {
     state.PauseTiming();
     std::abort();
diff --git a/utils/google-benchmark/test/options_test.cc b/utils/google-benchmark/test/options_test.cc
index bbbed28..bedb1cc 100644
--- a/utils/google-benchmark/test/options_test.cc
+++ b/utils/google-benchmark/test/options_test.cc
@@ -1,12 +1,8 @@
 #include "benchmark/benchmark_api.h"
+
 #include <chrono>
 #include <thread>
 
-#if defined(NDEBUG)
-#undef NDEBUG
-#endif
-#include <cassert>
-
 void BM_basic(benchmark::State& state) {
   while (state.KeepRunning()) {
   }
@@ -44,22 +40,4 @@
 
 BENCHMARK(BM_basic)->Apply(CustomArgs);
 
-void BM_explicit_iteration_count(benchmark::State& st) {
-  // Test that benchmarks specified with an explicit iteration count are
-  // only run once.
-  static bool invoked_before = false;
-  assert(!invoked_before);
-  invoked_before = true;
-
-  // Test that the requested iteration count is respected.
-  assert(st.max_iterations == 42);
-  size_t actual_iterations = 0;
-  while (st.KeepRunning())
-    ++actual_iterations;
-  assert(st.iterations() == st.max_iterations);
-  assert(st.iterations() == 42);
-
-}
-BENCHMARK(BM_explicit_iteration_count)->Iterations(42);
-
 BENCHMARK_MAIN()
diff --git a/utils/google-benchmark/test/output_test_helper.cc b/utils/google-benchmark/test/output_test_helper.cc
index 54c028a..721d39f 100644
--- a/utils/google-benchmark/test/output_test_helper.cc
+++ b/utils/google-benchmark/test/output_test_helper.cc
@@ -31,7 +31,7 @@
 
 SubMap& GetSubstitutions() {
   // Don't use 'dec_re' from header because it may not yet be initialized.
-  static std::string safe_dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?";
+  static std::string dec_re = "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?";
   static SubMap map = {
       {"%float", "[0-9]*[.]?[0-9]+([eE][-+][0-9]+)?"},
       {"%int", "[ ]*[0-9]+"},
@@ -39,13 +39,13 @@
       {"%time", "[ ]*[0-9]{1,5} ns"},
       {"%console_report", "[ ]*[0-9]{1,5} ns [ ]*[0-9]{1,5} ns [ ]*[0-9]+"},
       {"%console_us_report", "[ ]*[0-9] us [ ]*[0-9] us [ ]*[0-9]+"},
-      {"%csv_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,,,,,"},
-      {"%csv_us_report", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",us,,,,,"},
+      {"%csv_report", "[0-9]+," + dec_re + "," + dec_re + ",ns,,,,,"},
+      {"%csv_us_report", "[0-9]+," + dec_re + "," + dec_re + ",us,,,,,"},
       {"%csv_bytes_report",
-       "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns," + safe_dec_re + ",,,,"},
+       "[0-9]+," + dec_re + "," + dec_re + ",ns," + dec_re + ",,,,"},
       {"%csv_items_report",
-       "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,," + safe_dec_re + ",,,"},
-      {"%csv_label_report_begin", "[0-9]+," + safe_dec_re + "," + safe_dec_re + ",ns,,,"},
+       "[0-9]+," + dec_re + "," + dec_re + ",ns,," + dec_re + ",,,"},
+      {"%csv_label_report_begin", "[0-9]+," + dec_re + "," + dec_re + ",ns,,,"},
       {"%csv_label_report_end", ",,"}};
   return map;
 }
diff --git a/utils/google-benchmark/test/reporter_output_test.cc b/utils/google-benchmark/test/reporter_output_test.cc
index cb52aec..2e6d2b2 100644
--- a/utils/google-benchmark/test/reporter_output_test.cc
+++ b/utils/google-benchmark/test/reporter_output_test.cc
@@ -9,10 +9,8 @@
 // ---------------------- Testing Prologue Output -------------------------- //
 // ========================================================================= //
 
-ADD_CASES(TC_ConsoleOut,
-          {{"^[-]+$", MR_Next},
-           {"^Benchmark %s Time %s CPU %s Iterations$", MR_Next},
-           {"^[-]+$", MR_Next}});
+ADD_CASES(TC_ConsoleOut, {{"^Benchmark %s Time %s CPU %s Iterations$", MR_Next},
+                          {"^[-]+$", MR_Next}});
 ADD_CASES(TC_CSVOut,
           {{"name,iterations,real_time,cpu_time,time_unit,bytes_per_second,"
             "items_per_second,label,error_occurred,error_message"}});
diff --git a/utils/google-benchmark/tools/compare_bench.py b/utils/google-benchmark/tools/compare_bench.py
index d54baaa..ed0f133 100644
--- a/utils/google-benchmark/tools/compare_bench.py
+++ b/utils/google-benchmark/tools/compare_bench.py
@@ -3,63 +3,25 @@
 compare_bench.py - Compare two benchmarks or their results and report the
                    difference.
 """
-import argparse
-from argparse import ArgumentParser
 import sys
 import gbench
 from gbench import util, report
-from gbench.util import *
-
-def check_inputs(in1, in2, flags):
-    """
-    Perform checking on the user provided inputs and diagnose any abnormalities
-    """
-    in1_kind, in1_err = classify_input_file(in1)
-    in2_kind, in2_err = classify_input_file(in2)
-    output_file = find_benchmark_flag('--benchmark_out=', flags)
-    output_type = find_benchmark_flag('--benchmark_out_format=', flags)
-    if in1_kind == IT_Executable and in2_kind == IT_Executable and output_file:
-        print(("WARNING: '--benchmark_out=%s' will be passed to both "
-              "benchmarks causing it to be overwritten") % output_file)
-    if in1_kind == IT_JSON and in2_kind == IT_JSON and len(flags) > 0:
-        print("WARNING: passing --benchmark flags has no effect since both "
-              "inputs are JSON")
-    if output_type is not None and output_type != 'json':
-        print(("ERROR: passing '--benchmark_out_format=%s' to 'compare_bench.py`"
-              " is not supported.") % output_type)
-        sys.exit(1)
-
 
 def main():
-    parser = ArgumentParser(
-        description='compare the results of two benchmarks')
-    parser.add_argument(
-        'test1', metavar='test1', type=str, nargs=1,
-        help='A benchmark executable or JSON output file')
-    parser.add_argument(
-        'test2', metavar='test2', type=str, nargs=1,
-        help='A benchmark executable or JSON output file')
-    # FIXME this is a dummy argument which will never actually match
-    # any --benchmark flags but it helps generate a better usage message
-    parser.add_argument(
-        'benchmark_options', metavar='benchmark_option', nargs='*',
-        help='Arguments to pass when running benchmark executables'
-    )
-    args, unknown_args = parser.parse_known_args()
     # Parse the command line flags
-    test1 = args.test1[0]
-    test2 = args.test2[0]
-    if args.benchmark_options:
-        print("Unrecognized positional argument arguments: '%s'"
-              % args.benchmark_options)
+    def usage():
+        print('compare_bench.py <test1> <test2> [benchmark options]...')
         exit(1)
-    benchmark_options = unknown_args
-    check_inputs(test1, test2, benchmark_options)
+    if '--help' in sys.argv or len(sys.argv) < 3:
+        usage()
+    tests = sys.argv[1:3]
+    bench_opts = sys.argv[3:]
+    bench_opts = list(bench_opts)
     # Run the benchmarks and report the results
-    json1 = gbench.util.run_or_load_benchmark(test1, benchmark_options)
-    json2 = gbench.util.run_or_load_benchmark(test2, benchmark_options)
+    json1 = gbench.util.run_or_load_benchmark(tests[0], bench_opts)
+    json2 = gbench.util.run_or_load_benchmark(tests[1], bench_opts)
     output_lines = gbench.report.generate_difference_report(json1, json2)
-    print('Comparing %s to %s' % (test1, test2))
+    print 'Comparing %s to %s' % (tests[0], tests[1])
     for ln in output_lines:
         print(ln)
 
diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
index 37faed4..da9425e 100644
--- a/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
+++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run1.json
@@ -41,20 +41,6 @@
       "real_time": 100,
       "cpu_time": 100,
       "time_unit": "ns"
-    },
-    {
-      "name": "BM_100xSlower",
-      "iterations": 1000,
-      "real_time": 100,
-      "cpu_time": 100,
-      "time_unit": "ns"
-    },
-    {
-      "name": "BM_100xFaster",
-      "iterations": 1000,
-      "real_time": 10000,
-      "cpu_time": 10000,
-      "time_unit": "ns"
     }
   ]
 }
\ No newline at end of file
diff --git a/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
index aed5151..d8bc72d 100644
--- a/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
+++ b/utils/google-benchmark/tools/gbench/Inputs/test1_run2.json
@@ -41,20 +41,6 @@
       "real_time": 110,
       "cpu_time": 110,
       "time_unit": "ns"
-    },
-    {
-      "name": "BM_100xSlower",
-      "iterations": 1000,
-      "real_time": 10000,
-      "cpu_time": 10000,
-      "time_unit": "ns"
-    },
-    {
-      "name": "BM_100xFaster",
-      "iterations": 1000,
-      "real_time": 100,
-      "cpu_time": 100,
-      "time_unit": "ns"
     }
   ]
 }
\ No newline at end of file
diff --git a/utils/google-benchmark/tools/gbench/report.py b/utils/google-benchmark/tools/gbench/report.py
index 8f1b0fa..ac69b9b 100644
--- a/utils/google-benchmark/tools/gbench/report.py
+++ b/utils/google-benchmark/tools/gbench/report.py
@@ -92,7 +92,7 @@
                 return BC_WHITE
             else:
                 return BC_CYAN
-        fmt_str = "{}{:<{}s}{endc}{}{:+9.2f}{endc}{}{:+14.2f}{endc}{:14d}{:14d}"
+        fmt_str = "{}{:<{}s}{endc}    {}{:+.2f}{endc}         {}{:+.2f}{endc}         {:4d}         {:4d}"
         tres = calculate_change(bn['real_time'], other_bench['real_time'])
         cpures = calculate_change(bn['cpu_time'], other_bench['cpu_time'])
         output_strs += [color_format(use_color, fmt_str,
@@ -121,22 +121,19 @@
 
     def test_basic(self):
         expect_lines = [
-            ['BM_SameTimes', '+0.00', '+0.00', '10', '10'],
-            ['BM_2xFaster', '-0.50', '-0.50', '50', '25'],
-            ['BM_2xSlower', '+1.00', '+1.00', '50', '100'],
-            ['BM_10PercentFaster', '-0.10', '-0.10', '100', '90'],
-            ['BM_10PercentSlower', '+0.10', '+0.10', '100', '110'],
-            ['BM_100xSlower', '+99.00', '+99.00', '100', '10000'],
-            ['BM_100xFaster', '-0.99', '-0.99', '10000', '100'],
+            ['BM_SameTimes', '+0.00', '+0.00'],
+            ['BM_2xFaster', '-0.50', '-0.50'],
+            ['BM_2xSlower', '+1.00', '+1.00'],
+            ['BM_10PercentFaster', '-0.10', '-0.10'],
+            ['BM_10PercentSlower', '+0.10', '+0.10']
         ]
         json1, json2 = self.load_results()
-        output_lines_with_header = generate_difference_report(json1, json2, use_color=False)
-        output_lines = output_lines_with_header[2:]
-        print("\n".join(output_lines_with_header))
+        output_lines = generate_difference_report(json1, json2, use_color=False)
+        print output_lines
         self.assertEqual(len(output_lines), len(expect_lines))
         for i in xrange(0, len(output_lines)):
             parts = [x for x in output_lines[i].split(' ') if x]
-            self.assertEqual(len(parts), 5)
+            self.assertEqual(len(parts), 3)
             self.assertEqual(parts, expect_lines[i])
 
 
diff --git a/utils/google-benchmark/tools/gbench/util.py b/utils/google-benchmark/tools/gbench/util.py
index 07c2377..169b71c 100644
--- a/utils/google-benchmark/tools/gbench/util.py
+++ b/utils/google-benchmark/tools/gbench/util.py
@@ -20,21 +20,21 @@
     """
     if not os.path.isfile(filename):
         return False
-    with open(filename, mode='rb') as f:
+    with open(filename, 'r') as f:
         magic_bytes = f.read(_num_magic_bytes)
     if sys.platform == 'darwin':
         return magic_bytes in [
-            b'\xfe\xed\xfa\xce',  # MH_MAGIC
-            b'\xce\xfa\xed\xfe',  # MH_CIGAM
-            b'\xfe\xed\xfa\xcf',  # MH_MAGIC_64
-            b'\xcf\xfa\xed\xfe',  # MH_CIGAM_64
-            b'\xca\xfe\xba\xbe',  # FAT_MAGIC
-            b'\xbe\xba\xfe\xca'   # FAT_CIGAM
+            '\xfe\xed\xfa\xce',  # MH_MAGIC
+            '\xce\xfa\xed\xfe',  # MH_CIGAM
+            '\xfe\xed\xfa\xcf',  # MH_MAGIC_64
+            '\xcf\xfa\xed\xfe',  # MH_CIGAM_64
+            '\xca\xfe\xba\xbe',  # FAT_MAGIC
+            '\xbe\xba\xfe\xca'   # FAT_CIGAM
         ]
     elif sys.platform.startswith('win'):
-        return magic_bytes == b'MZ'
+        return magic_bytes == 'MZ'
     else:
-        return magic_bytes == b'\x7FELF'
+        return magic_bytes == '\x7FELF'
 
 
 def is_json_file(filename):
@@ -68,7 +68,7 @@
     elif is_json_file(filename):
         ftype = IT_JSON
     else:
-        err_msg = "'%s' does not name a valid benchmark executable or JSON file" % filename
+        err_msg = "'%s' does not name a valid benchmark executable or JSON file"
     return ftype, err_msg
 
 
@@ -80,30 +80,10 @@
     """
     ftype, msg = classify_input_file(filename)
     if ftype == IT_Invalid:
-        print("Invalid input file: %s" % msg)
+        print "Invalid input file: %s" % msg
         sys.exit(1)
     return ftype
 
-def find_benchmark_flag(prefix, benchmark_flags):
-    """
-    Search the specified list of flags for a flag matching `<prefix><arg>` and
-    if it is found return the arg it specifies. If specified more than once the
-    last value is returned. If the flag is not found None is returned.
-    """
-    assert prefix.startswith('--') and prefix.endswith('=')
-    result = None
-    for f in benchmark_flags:
-        if f.startswith(prefix):
-            result = f[len(prefix):]
-    return result
-
-def remove_benchmark_flags(prefix, benchmark_flags):
-    """
-    Return a new list containing the specified benchmark_flags except those
-    with the specified prefix.
-    """
-    assert prefix.startswith('--') and prefix.endswith('=')
-    return [f for f in benchmark_flags if not f.startswith(prefix)]
 
 def load_benchmark_results(fname):
     """
@@ -121,25 +101,16 @@
     real time console output.
     RETURNS: A JSON object representing the benchmark output
     """
-    output_name = find_benchmark_flag('--benchmark_out=',
-                                      benchmark_flags)
-    is_temp_output = False
-    if output_name is None:
-        is_temp_output = True
-        thandle, output_name = tempfile.mkstemp()
-        os.close(thandle)
-        benchmark_flags = list(benchmark_flags) + \
-                          ['--benchmark_out=%s' % output_name]
-
+    thandle, tname = tempfile.mkstemp()
+    os.close(thandle)
     cmd = [exe_name] + benchmark_flags
     print("RUNNING: %s" % ' '.join(cmd))
-    exitCode = subprocess.call(cmd)
+    exitCode = subprocess.call(cmd + ['--benchmark_out=%s' % tname])
     if exitCode != 0:
         print('TEST FAILED...')
         sys.exit(exitCode)
-    json_res = load_benchmark_results(output_name)
-    if is_temp_output:
-        os.unlink(output_name)
+    json_res = load_benchmark_results(tname)
+    os.unlink(tname)
     return json_res
 
 
diff --git a/utils/libcxx/compiler.py b/utils/libcxx/compiler.py
index e908e26..983bc26 100644
--- a/utils/libcxx/compiler.py
+++ b/utils/libcxx/compiler.py
@@ -24,7 +24,6 @@
                  modules_flags=None, use_modules=False,
                  use_ccache=False, use_warnings=False, compile_env=None,
                  cxx_type=None, cxx_version=None):
-        self.source_lang = 'c++'
         self.path = path
         self.flags = list(flags or [])
         self.compile_flags = list(compile_flags or [])
@@ -109,7 +108,7 @@
         if out is not None:
             cmd += ['-o', out]
         if input_is_cxx:
-            cmd += ['-x', self.source_lang]
+            cmd += ['-x', 'c++']
         if isinstance(source_files, list):
             cmd += source_files
         elif isinstance(source_files, str):
diff --git a/utils/libcxx/test/config.py b/utils/libcxx/test/config.py
index 0fbc2cf..d21fc94 100644
--- a/utils/libcxx/test/config.py
+++ b/utils/libcxx/test/config.py
@@ -67,7 +67,7 @@
         self.abi_library_root = None
         self.link_shared = self.get_lit_bool('enable_shared', default=True)
         self.debug_build = self.get_lit_bool('debug_build',   default=False)
-        self.exec_env = dict(os.environ)
+        self.exec_env = {}
         self.use_target = False
         self.use_system_cxx_lib = False
         self.use_clang_verify = False
@@ -111,23 +111,20 @@
     def make_static_lib_name(self, name):
         """Return the full filename for the specified library name"""
         if self.is_windows:
-            assert name == 'c++'  # Only allow libc++ to use this function for now.
-            return 'lib' + name + '.lib'
+            return name + '.lib'
         else:
             return 'lib' + name + '.a'
 
     def configure(self):
         self.configure_executor()
-        self.configure_use_system_cxx_lib()
         self.configure_target_info()
         self.configure_cxx()
         self.configure_triple()
-        self.configure_deployment()
-        self.configure_availability()
         self.configure_src_root()
         self.configure_obj_root()
         self.configure_cxx_stdlib_under_test()
         self.configure_cxx_library_root()
+        self.configure_use_system_cxx_lib()
         self.configure_use_clang_verify()
         self.configure_use_thread_safety()
         self.configure_execute_external()
@@ -142,7 +139,6 @@
         self.configure_sanitizer()
         self.configure_coverage()
         self.configure_modules()
-        self.configure_coroutines()
         self.configure_substitutions()
         self.configure_features()
 
@@ -161,11 +157,7 @@
         # Print as list to prevent "set([...])" from being printed.
         self.lit_config.note('Using available_features: %s' %
                              list(self.config.available_features))
-        show_env_vars = {}
-        for k,v in self.exec_env.items():
-            if k not in os.environ or os.environ[k] != v:
-                show_env_vars[k] = v
-        self.lit_config.note('Adding environment variables: %r' % show_env_vars)
+        self.lit_config.note('Using environment: %r' % self.exec_env)
         sys.stderr.flush()  # Force flushing to avoid broken output on Windows
 
     def get_test_format(self):
@@ -248,7 +240,7 @@
         flags = []
         compile_flags = _prefixed_env_list('INCLUDE', '-isystem')
         link_flags = _prefixed_env_list('LIB', '-L')
-        for path in _split_env_var('LIB'):
+        for path in _list_env_var('LIB'):
             self.add_path(self.exec_env, path)
         return CXXCompiler(clang_path, flags=flags,
                            compile_flags=compile_flags,
@@ -280,22 +272,12 @@
         # the locally built one; the former mode is useful for testing ABI
         # compatibility between the current headers and a shipping dynamic
         # library.
-        # Default to testing against the locally built libc++ library.
-        self.use_system_cxx_lib = self.get_lit_conf('use_system_cxx_lib')
-        if self.use_system_cxx_lib == 'true':
-            self.use_system_cxx_lib = True
-        elif self.use_system_cxx_lib == 'false':
+        self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib')
+        if self.use_system_cxx_lib is None:
+            # Default to testing against the locally built libc++ library.
             self.use_system_cxx_lib = False
-        elif self.use_system_cxx_lib:
-            assert os.path.isdir(self.use_system_cxx_lib)
-        self.lit_config.note(
-            "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
-
-    def configure_availability(self):
-        # See http://llvm.org/docs/AvailabilityMarkup.html
-        self.with_availability = self.get_lit_bool('with_availability', False)
-        self.lit_config.note(
-            "inferred with_availability as: %r" % self.with_availability)
+            self.lit_config.note(
+                "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib)
 
     def configure_cxx_stdlib_under_test(self):
         self.cxx_stdlib_under_test = self.get_lit_conf(
@@ -318,18 +300,15 @@
 
     def configure_use_clang_verify(self):
         '''If set, run clang with -verify on failing tests.'''
-        if self.with_availability:
-            self.use_clang_verify = False
-            return
         self.use_clang_verify = self.get_lit_bool('use_clang_verify')
         if self.use_clang_verify is None:
             # NOTE: We do not test for the -verify flag directly because
             #   -verify will always exit with non-zero on an empty file.
             self.use_clang_verify = self.cxx.isVerifySupported()
+            if self.use_clang_verify:
+                self.config.available_features.add('verify-support')
             self.lit_config.note(
                 "inferred use_clang_verify as: %r" % self.use_clang_verify)
-        if self.use_clang_verify:
-                self.config.available_features.add('verify-support')
 
     def configure_use_thread_safety(self):
         '''If set, run clang with -verify on failing tests.'''
@@ -361,12 +340,6 @@
             self.cxx.use_ccache = True
             self.lit_config.note('enabling ccache')
 
-    def add_deployment_feature(self, feature):
-        (arch, name, version) = self.config.deployment
-        self.config.available_features.add('%s=%s-%s' % (feature, arch, name))
-        self.config.available_features.add('%s=%s' % (feature, name))
-        self.config.available_features.add('%s=%s%s' % (feature, name, version))
-
     def configure_features(self):
         additional_features = self.get_lit_conf('additional_features')
         if additional_features:
@@ -385,29 +358,6 @@
             self.config.available_features.add(
                 'with_system_cxx_lib=%s' % self.config.target_triple)
 
-            # Add subcomponents individually.
-            target_components = self.config.target_triple.split('-')
-            for component in target_components:
-                self.config.available_features.add(
-                    'with_system_cxx_lib=%s' % component)
-
-            # Add available features for more generic versions of the target
-            # triple attached to  with_system_cxx_lib.
-            if self.use_deployment:
-                self.add_deployment_feature('with_system_cxx_lib')
-
-        # Configure the availability markup checks features.
-        if self.with_availability:
-            self.config.available_features.add('availability_markup')
-            self.add_deployment_feature('availability_markup')
-
-        if self.use_system_cxx_lib or self.with_availability:
-            self.config.available_features.add('availability')
-            self.add_deployment_feature('availability')
-
-        if platform.system() == 'Darwin':
-            self.config.available_features.add('apple-darwin')
-
         # Insert the platform name into the available features as a lower case.
         self.config.available_features.add(target_platform)
 
@@ -450,13 +400,6 @@
 
         if self.is_windows:
             self.config.available_features.add('windows')
-            if self.cxx_stdlib_under_test == 'libc++':
-                # LIBCXX-WINDOWS-FIXME is the feature name used to XFAIL the
-                # initial Windows failures until they can be properly diagnosed
-                # and fixed. This allows easier detection of new test failures
-                # and regressions. Note: New failures should not be suppressed
-                # using this feature. (Also see llvm.org/PR32730)
-                self.config.available_features.add('LIBCXX-WINDOWS-FIXME')
 
         # Attempt to detect the glibc version by querying for __GLIBC__
         # in 'features.h'.
@@ -467,12 +410,6 @@
             self.config.available_features.add('glibc-%s' % maj_v)
             self.config.available_features.add('glibc-%s.%s' % (maj_v, min_v))
 
-        # Support Objective-C++ only on MacOS and if the compiler supports it.
-        if self.target_info.platform() == "darwin" and \
-           self.target_info.is_host_macosx() and \
-           self.cxx.hasCompileFlag(["-x", "objective-c++", "-fobjc-arc"]):
-            self.config.available_features.add("objective-c++")
-
     def configure_compile_flags(self):
         no_default_flags = self.get_lit_bool('no_default_flags', False)
         if not no_default_flags:
@@ -484,13 +421,9 @@
         # Configure extra flags
         compile_flags_str = self.get_lit_conf('compile_flags', '')
         self.cxx.compile_flags += shlex.split(compile_flags_str)
+        # FIXME: Can we remove this?
         if self.is_windows:
-            # FIXME: Can we remove this?
             self.cxx.compile_flags += ['-D_CRT_SECURE_NO_WARNINGS']
-            # Required so that tests using min/max don't fail on Windows,
-            # and so that those tests don't have to be changed to tolerate
-            # this insanity.
-            self.cxx.compile_flags += ['-DNOMINMAX']
 
     def configure_default_compile_flags(self):
         # Try and get the std version from the command line. Fall back to
@@ -550,18 +483,9 @@
                     ['-target', self.config.target_triple]):
                 self.lit_config.warning('use_target is true but -target is '\
                         'not supported by the compiler')
-        if self.use_deployment:
-            arch, name, version = self.config.deployment
-            self.cxx.flags += ['-arch', arch]
-            self.cxx.flags += ['-m' + name + '-version-min=' + version]
-
-        # Disable availability unless explicitely requested
-        if not self.with_availability:
-            self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
 
     def configure_compile_flags_header_includes(self):
         support_path = os.path.join(self.libcxx_src_root, 'test', 'support')
-        self.configure_config_site_header()
         if self.cxx_stdlib_under_test != 'libstdc++' and \
            not self.is_windows:
             self.cxx.compile_flags += [
@@ -577,6 +501,7 @@
                 '-include', os.path.join(support_path,
                                          'set_windows_crt_report_mode.h')
             ]
+        self.configure_config_site_header()
         cxx_headers = self.get_lit_conf('cxx_headers')
         if cxx_headers == '' or (cxx_headers is None
                                  and self.cxx_stdlib_under_test != 'libc++'):
@@ -749,13 +674,6 @@
                                             self.cxx_runtime_root]
                 elif self.is_windows and self.link_shared:
                     self.add_path(self.exec_env, self.cxx_runtime_root)
-        elif os.path.isdir(str(self.use_system_cxx_lib)):
-            self.cxx.link_flags += ['-L' + self.use_system_cxx_lib]
-            if not self.is_windows:
-                self.cxx.link_flags += ['-Wl,-rpath,' +
-                                        self.use_system_cxx_lib]
-            if self.is_windows and self.link_shared:
-                self.add_path(self.cxx.compile_env, self.use_system_cxx_lib)
 
     def configure_link_flags_abi_library_path(self):
         # Configure ABI library paths.
@@ -872,7 +790,6 @@
         self.cxx.addWarningFlagIfSupported('-Wno-pessimizing-move')
         self.cxx.addWarningFlagIfSupported('-Wno-c++11-extensions')
         self.cxx.addWarningFlagIfSupported('-Wno-user-defined-literals')
-        self.cxx.addWarningFlagIfSupported('-Wno-noexcept-type')
         # These warnings should be enabled in order to support the MSVC
         # team using the test suite; They enable the warnings below and
         # expect the test suite to be clean.
@@ -883,9 +800,6 @@
         # FIXME: Enable the two warnings below.
         self.cxx.addWarningFlagIfSupported('-Wno-conversion')
         self.cxx.addWarningFlagIfSupported('-Wno-unused-local-typedef')
-        # FIXME: Remove this warning once the min/max handling patch lands
-        # See https://reviews.llvm.org/D33080
-        self.cxx.addWarningFlagIfSupported('-Wno-#warnings')
         std = self.get_lit_conf('std', None)
         if std in ['c++98', 'c++03']:
             # The '#define static_assert' provided by libc++ in C++03 mode
@@ -959,18 +873,6 @@
             self.cxx.flags += ['-g', '--coverage']
             self.cxx.compile_flags += ['-O0']
 
-    def configure_coroutines(self):
-        if self.cxx.hasCompileFlag('-fcoroutines-ts'):
-            macros = self.cxx.dumpMacros(flags=['-fcoroutines-ts'])
-            if '__cpp_coroutines' not in macros:
-                self.lit_config.warning('-fcoroutines-ts is supported but '
-                    '__cpp_coroutines is not defined')
-            # Consider coroutines supported only when the feature test macro
-            # reflects a recent value.
-            val = macros['__cpp_coroutines'].replace('L', '')
-            if int(val) >= 201703:
-                self.config.available_features.add('fcoroutines-ts')
-
     def configure_modules(self):
         modules_flags = ['-fmodules']
         if platform.system() != 'Darwin':
@@ -1032,41 +934,29 @@
         sub.append(('%link', link_str))
         sub.append(('%build', build_str))
         # Configure exec prefix substitutions.
+        exec_env_str = ''
+        if not self.is_windows and len(self.exec_env) != 0:
+            exec_env_str = 'env '
+            for k, v in self.exec_env.items():
+                exec_env_str += ' %s=%s' % (k, v)
         # Configure run env substitution.
-        sub.append(('%run', '%t.exe'))
+        exec_str = exec_env_str
+        if self.lit_config.useValgrind:
+            exec_str = ' '.join(self.lit_config.valgrindArgs) + exec_env_str
+        sub.append(('%exec', exec_str))
+        # Configure run shortcut
+        sub.append(('%run', exec_str + ' %t.exe'))
         # Configure not program substitutions
         not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
         not_str = '%s %s ' % (pipes.quote(sys.executable), pipes.quote(not_py))
         sub.append(('not ', not_str))
 
-    def can_use_deployment(self):
-        # Check if the host is on an Apple platform using clang.
-        if not self.target_info.platform() == "darwin":
-            return False
-        if not self.target_info.is_host_macosx():
-            return False
-        if not self.cxx.type.endswith('clang'):
-            return False
-        return True
-
     def configure_triple(self):
         # Get or infer the target triple.
-        target_triple = self.get_lit_conf('target_triple')
+        self.config.target_triple = self.get_lit_conf('target_triple')
         self.use_target = self.get_lit_bool('use_target', False)
-        if self.use_target and target_triple:
+        if self.use_target and self.config.target_triple:
             self.lit_config.warning('use_target is true but no triple is specified')
-
-        # Use deployment if possible.
-        self.use_deployment = not self.use_target and self.can_use_deployment()
-        if self.use_deployment:
-            return
-
-        # Save the triple (and warn on Apple platforms).
-        self.config.target_triple = target_triple
-        if self.use_target and 'apple' in target_triple:
-            self.lit_config.warning('consider using arch and platform instead'
-                                    ' of target_triple on Apple platforms')
-
         # If no target triple was given, try to infer it from the compiler
         # under test.
         if not self.config.target_triple:
@@ -1088,39 +978,6 @@
             self.lit_config.note(
                 "inferred target_triple as: %r" % self.config.target_triple)
 
-    def configure_deployment(self):
-        assert not self.use_deployment is None
-        assert not self.use_target is None
-        if not self.use_deployment:
-            # Warn about ignored parameters.
-            if self.get_lit_conf('arch'):
-                self.lit_config.warning('ignoring arch, using target_triple')
-            if self.get_lit_conf('platform'):
-                self.lit_config.warning('ignoring platform, using target_triple')
-            return
-
-        assert not self.use_target
-        assert self.target_info.is_host_macosx()
-
-        # Always specify deployment explicitly on Apple platforms, since
-        # otherwise a platform is picked up from the SDK.  If the SDK version
-        # doesn't match the system version, tests that use the system library
-        # may fail spuriously.
-        arch = self.get_lit_conf('arch')
-        if not arch:
-            arch = self.cxx.getTriple().split('-', 1)[0]
-            self.lit_config.note("inferred arch as: %r" % arch)
-
-        inferred_platform, name, version = self.target_info.get_platform()
-        if inferred_platform:
-            self.lit_config.note("inferred platform as: %r" % (name + version))
-        self.config.deployment = (arch, name, version)
-
-        # Set the target triple for use by lit.
-        self.config.target_triple = arch + '-apple-' + name + version
-        self.lit_config.note(
-            "computed target_triple as: %r" % self.config.target_triple)
-
     def configure_env(self):
         self.target_info.configure_env(self.exec_env)
 
diff --git a/utils/libcxx/test/executor.py b/utils/libcxx/test/executor.py
index 0ccf96c..65f5a13 100644
--- a/utils/libcxx/test/executor.py
+++ b/utils/libcxx/test/executor.py
@@ -38,11 +38,36 @@
 
     def run(self, exe_path, cmd=None, work_dir='.', file_deps=None, env=None):
         cmd = cmd or [exe_path]
+        env_cmd = []
+        if env:
+            env_cmd += ['env']
+            env_cmd += ['%s=%s' % (k, v) for k, v in env.items()]
         if work_dir == '.':
             work_dir = os.getcwd()
-        out, err, rc = executeCommand(cmd, cwd=work_dir, env=env)
-        return (cmd, out, err, rc)
+        if not self.is_windows:
+            out, err, rc = executeCommand(env_cmd + cmd, cwd=work_dir)
+        else:
+            out, err, rc = executeCommand(cmd, cwd=work_dir,
+                                          env=self._build_windows_env(env))
+        return (env_cmd + cmd, out, err, rc)
 
+    def _build_windows_env(self, exec_env):
+        # FIXME: Finding Windows DLL's at runtime requires modifying the
+        #   PATH environment variables. However we don't want to print out
+        #   the entire PATH as part of the diagnostic for every failing test.
+        #   Therefore this hack builds a new executable environment that
+        #   merges the current environment and the supplied environment while
+        #   still only printing the supplied environment in diagnostics.
+        if not self.is_windows or exec_env is None:
+            return None
+        new_env = dict(os.environ)
+        for key, value in exec_env.items():
+            if key == 'PATH':
+                assert value.strip() != '' and "expected non-empty path"
+                new_env['PATH'] = "%s;%s" % (value, os.environ['PATH'])
+            else:
+                new_env[key] = value
+        return new_env
 
 class PrefixExecutor(Executor):
     """Prefix an executor with some other command wrapper.
@@ -171,7 +196,7 @@
         # Not sure how to do suffix on osx yet
         dir_arg = '-d' if is_dir else ''
         cmd = 'mktemp -q {} /tmp/libcxx.XXXXXXXXXX'.format(dir_arg)
-        _, temp_path, err, exitCode = self._execute_command_remote([cmd])
+        temp_path, err, exitCode = self._execute_command_remote([cmd])
         temp_path = temp_path.strip()
         if exitCode != 0:
             raise RuntimeError(err)
@@ -194,5 +219,4 @@
         remote_cmd = ' '.join(env_cmd + cmd)
         if remote_work_dir != '.':
             remote_cmd = 'cd ' + remote_work_dir + ' && ' + remote_cmd
-        out, err, rc = self.local_run(ssh_cmd + [remote_cmd])
-        return (remote_cmd, out, err, rc)
+        return self.local_run(ssh_cmd + [remote_cmd])
diff --git a/utils/libcxx/test/format.py b/utils/libcxx/test/format.py
index 317fc80..c3bc971 100644
--- a/utils/libcxx/test/format.py
+++ b/utils/libcxx/test/format.py
@@ -87,22 +87,14 @@
         name_root, name_ext = os.path.splitext(name)
         is_libcxx_test = test.path_in_suite[0] == 'libcxx'
         is_sh_test = name_root.endswith('.sh')
-        is_pass_test = name.endswith('.pass.cpp') or name.endswith('.pass.mm')
-        is_fail_test = name.endswith('.fail.cpp') or name.endswith('.fail.mm')
-        is_objcxx_test = name.endswith('.mm')
-        is_objcxx_arc_test = name.endswith('.arc.pass.mm') or \
-                             name.endswith('.arc.fail.mm')
-        assert is_sh_test or name_ext == '.cpp' or name_ext == '.mm', \
-            'non-cpp file must be sh test'
+        is_pass_test = name.endswith('.pass.cpp')
+        is_fail_test = name.endswith('.fail.cpp')
+        assert is_sh_test or name_ext == '.cpp', 'non-cpp file must be sh test'
 
         if test.config.unsupported:
             return (lit.Test.UNSUPPORTED,
                     "A lit.local.cfg marked this unsupported")
 
-        if is_objcxx_test and not \
-           'objective-c++' in test.config.available_features:
-            return (lit.Test.UNSUPPORTED, "Objective-C++ is not supported")
-
         parsers = self._make_custom_parsers()
         script = lit.TestRunner.parseIntegratedTestScript(
             test, additional_parsers=parsers, require_script=is_sh_test)
@@ -141,21 +133,13 @@
                 if '#define _LIBCPP_ASSERT' in contents:
                     test_cxx.useModules(False)
 
-        if is_objcxx_test:
-            test_cxx.source_lang = 'objective-c++'
-            if is_objcxx_arc_test:
-                test_cxx.compile_flags += ['-fobjc-arc']
-            else:
-                test_cxx.compile_flags += ['-fno-objc-arc']
-            test_cxx.link_flags += ['-framework', 'Foundation']
-
         # Dispatch the test based on its suffix.
         if is_sh_test:
             if not isinstance(self.executor, LocalExecutor):
                 # We can't run ShTest tests with a executor yet.
                 # For now, bail on trying to run them
                 return lit.Test.UNSUPPORTED, 'ShTest format not yet supported'
-            test.config.environment = dict(self.exec_env)
+            test.config.enviroment = dict(self.exec_env)
             return lit.TestRunner._runShTest(test, lit_config,
                                              self.execute_external, script,
                                              tmpBase)
diff --git a/utils/libcxx/test/target_info.py b/utils/libcxx/test/target_info.py
index 2104432..14d94a8 100644
--- a/utils/libcxx/test/target_info.py
+++ b/utils/libcxx/test/target_info.py
@@ -12,7 +12,6 @@
 import locale
 import os
 import platform
-import re
 import sys
 
 class DefaultTargetInfo(object):
@@ -46,88 +45,37 @@
         locale.setlocale(locale.LC_ALL, default_locale)
 
 
-def add_common_locales(features, lit_config, is_windows=False):
+def add_common_locales(features, lit_config):
     # A list of locales needed by the test-suite.
     # The list uses the canonical name for the locale used in the test-suite
     # TODO: On Linux ISO8859 *may* needs to hyphenated.
     locales = [
-        ('en_US.UTF-8', 'English_United States.1252'),
-        ('fr_FR.UTF-8', 'French_France.1252'),
-        ('ru_RU.UTF-8', 'Russian_Russia.1251'),
-        ('zh_CN.UTF-8', 'Chinese_China.936'),
-        ('fr_CA.ISO8859-1', 'French_Canada.1252'),
-        ('cs_CZ.ISO8859-2', 'Czech_Czech Republic.1250')
+        'en_US.UTF-8',
+        'fr_FR.UTF-8',
+        'ru_RU.UTF-8',
+        'zh_CN.UTF-8',
+        'fr_CA.ISO8859-1',
+        'cs_CZ.ISO8859-2'
     ]
-    for loc_id, windows_loc_name in locales:
-        loc_name = windows_loc_name if is_windows else loc_id
-        if test_locale(loc_name):
-            features.add('locale.{0}'.format(loc_id))
+    for loc in locales:
+        if test_locale(loc):
+            features.add('locale.{0}'.format(loc))
         else:
             lit_config.warning('The locale {0} is not supported by '
                                'your platform. Some tests will be '
-                               'unsupported.'.format(loc_name))
+                               'unsupported.'.format(loc))
 
 
 class DarwinLocalTI(DefaultTargetInfo):
     def __init__(self, full_config):
         super(DarwinLocalTI, self).__init__(full_config)
 
-    def is_host_macosx(self):
-        name = lit.util.capture(['sw_vers', '-productName']).strip()
-        return name == "Mac OS X"
-
-    def get_macosx_version(self):
-        assert self.is_host_macosx()
-        version = lit.util.capture(['sw_vers', '-productVersion']).strip()
-        version = re.sub(r'([0-9]+\.[0-9]+)(\..*)?', r'\1', version)
-        return version
-
-    def get_sdk_version(self, name):
-        assert self.is_host_macosx()
-        cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
-        try:
-            out = lit.util.capture(cmd).strip()
-        except OSError:
-            pass
-
-        if not out:
-            self.full_config.lit_config.fatal(
-                    "cannot infer sdk version with: %r" % cmd)
-
-        return re.sub(r'.*/[^0-9]+([0-9.]+)\.sdk', r'\1', out)
-
-    def get_platform(self):
-        platform = self.full_config.get_lit_conf('platform')
-        if platform:
-            platform = re.sub(r'([^0-9]+)([0-9\.]*)', r'\1-\2', platform)
-            name, version = tuple(platform.split('-', 1))
-        else:
-            name = 'macosx'
-            version = None
-
-        if version:
-            return (False, name, version)
-
-        # Infer the version, either from the SDK or the system itself.  For
-        # macosx, ignore the SDK version; what matters is what's at
-        # /usr/lib/libc++.dylib.
-        if name == 'macosx':
-            version = self.get_macosx_version()
-        else:
-            version = self.get_sdk_version(name)
-        return (True, name, version)
-
     def add_locale_features(self, features):
         add_common_locales(features, self.full_config.lit_config)
 
     def add_cxx_compile_flags(self, flags):
-        if self.full_config.use_deployment:
-            _, name, _ = self.full_config.config.deployment
-            cmd = ['xcrun', '--sdk', name, '--show-sdk-path']
-        else:
-            cmd = ['xcrun', '--show-sdk-path']
         try:
-            out = lit.util.capture(cmd).strip()
+            out = lit.util.capture(['xcrun', '--show-sdk-path']).strip()
             res = 0
         except OSError:
             res = -1
@@ -143,8 +91,6 @@
         library_paths = []
         # Configure the library path for libc++
         if self.full_config.use_system_cxx_lib:
-            if (os.path.isdir(str(self.full_config.use_system_cxx_lib))):
-                library_paths += [self.full_config.use_system_cxx_lib]
             pass
         elif self.full_config.cxx_runtime_root:
             library_paths += [self.full_config.cxx_runtime_root]
@@ -252,8 +198,7 @@
         super(WindowsLocalTI, self).__init__(full_config)
 
     def add_locale_features(self, features):
-        add_common_locales(features, self.full_config.lit_config,
-                           is_windows=True)
+        add_common_locales(features, self.full_config.lit_config)
 
     def use_lit_shell_default(self):
         # Default to the internal shell on Windows, as bash on Windows is
diff --git a/www/cxx1z_status.html b/www/cxx1z_status.html
index bd33b6e..cb6da83 100644
--- a/www/cxx1z_status.html
+++ b/www/cxx1z_status.html
@@ -46,7 +46,7 @@
     <li>SG1 - Study group #1 (Concurrency working group)</li>
   </ul>
   </p>
-
+  
   <h3>Paper Status</h3>
   <table id="papers" border="1">
 	<tr><th>Paper #</th><th>Group</th><th>Paper Name</th><th>Meeting</th><th>Status</th><th>First released version</th></tr>
@@ -71,13 +71,13 @@
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4366">N4366</a></td><td>LWG</td></td><td>LWG 2228 missing SFINAE rule</td><td>Lenexa</td><td>Complete</td><td>3.1</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4510">N4510</a></td><td>LWG</td></td><td>Minimal incomplete type support for standard containers, revision 4</td><td>Lenexa</td><td>Complete</td><td>3.6</td></tr>
   	<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0004r1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0004R1.html">P0004R1</a></td><td>LWG</td><td>Remove Deprecated iostreams aliases.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
 	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0006r0.html">P0006R0</a></td><td>LWG</td><td>Adopt Type Traits Variable Templates for C++17.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0092r1.html">P0092R1</a></td><td>LWG</td><td>Polishing &lt;chrono&gt;</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0007r1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0156r0.html" >P0156R0</a></td><td>LWG</td><td>Variadic lock_guard(rev 3).</td><td>Kona</td><td><I>Reverted in Kona</I></td><td>3.9</td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0074r0.html">P0074R0</a></td><td>LWG</td><td>Making <tt>std::owner_less</tt> more flexible</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
-	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0013r1.html">P0013R1</a></td><td>LWG</td><td>Logical type traits rev 2</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0092R1.html">P0092R1</a></td><td>LWG</td><td>Polishing &lt;chrono&gt;</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0007R1.html">P0007R1</a></td><td>LWG</td><td>Constant View: A proposal for a <tt>std::as_const</tt> helper function template.</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0156r0.html" >P0156R0</a></td><td>LWG</td><td>Variadic lock_guard(rev 3).</td><td>Kona</td><td>Complete (ABI V2 Only)</td><td>3.9</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0074R0.html">P0074R0</a></td><td>LWG</td><td>Making <tt>std::owner_less</tt> more flexible</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
+	<tr><td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/P0013R1.html">P0013R1</a></td><td>LWG</td><td>Logical type traits rev 2</td><td>Kona</td><td>Complete</td><td>3.8</td></tr>
   	<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0024R2">P0024R2</a></td><td>LWG</td><td>The Parallelism TS Should be Standardized</td><td>Jacksonville</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0226R1">P0226R1</a></td><td>LWG</td><td>Mathematical Special Functions for C++17</td><td>Jacksonville</td><td></td><td></td></tr>
@@ -142,25 +142,23 @@
 	<tr><td><a href="http://wg21.link/P0517R0">P0517R0</a></td><td>LWG</td><td>Make future_error Constructible</td><td>Issaquah</td><td>Complete</td><td>4.0</td></tr>
 	<tr><td><a href="http://wg21.link/P0521R0">P0521R0</a></td><td>LWG</td><td>Proposed Resolution for CA 14 (shared_ptr use_count/unique)</td><td>Issaquah</td><td><i>Nothing to do</i></td><td>n/a</td></tr>
   	<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0156R2">P0156R2</a></td><td>LWG</td><td>Variadic Lock guard(rev 5)</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
-	<tr><td><a href="http://wg21.link/P0270R3">P0270R3</a></td><td>CWG</td><td>Removing C dependencies from signal handler wording</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0298R3">P0298R3</a></td><td>CWG</td><td>A byte type definition</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
 	<tr><td><a href="http://wg21.link/P0317R1">P0317R1</a></td><td>LWG</td><td>Directory Entry Caching for Filesystem</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0430R2">P0430R2</a></td><td>LWG</td><td>File system library on non-POSIX-like operating systems</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0433R2">P0433R2</a></td><td>LWG</td><td>Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0452R1">P0452R1</a></td><td>LWG</td><td>Unifying &lt;numeric&gt; Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0467R2">P0467R2</a></td><td>LWG</td><td>Iterator Concerns for Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0492R2">P0492R2</a></td><td>LWG</td><td>Proposed Resolution of C++17 National Body Comments for Filesystems</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0430R2">P0430R2</a></td><td>LWG</td><td>File system library on non-POSIX-like operating systems</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0452R1">P0452R1</a></td><td>LWG</td><td>Unifying &lt;numeric&gt; Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0518R1">P0518R1</a></td><td>LWG</td><td>Allowing copies as arguments to function objects given to parallel algorithms in response to CH11</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0523R1">P0523R1</a></td><td>LWG</td><td>Wording for CH 10: Complexity of parallel algorithms</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0548R1">P0548R1</a></td><td>LWG</td><td>common_type and duration</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
-	<tr><td><a href="http://wg21.link/P0558R1">P0558R1</a></td><td>LWG</td><td>Resolving atomic&lt;T&gt; named base class inconsistencies</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0574R1">P0574R1</a></td><td>LWG</td><td>Algorithm Complexity Constraints and Parallel Overloads</td><td>Kona</td><td></td><td></td></tr>
-	<tr><td><a href="http://wg21.link/P0599R1">P0599R1</a></td><td>LWG</td><td>noexcept for hash functions</td><td>Kona</td><td>Complete</td><td>5.0</td></tr>
+	<tr><td><a href="http://wg21.link/P0467R2">P0467R2</a></td><td>LWG</td><td>Iterator Concerns for Parallel Algorithms</td><td>Kona</td><td></td><td></td></tr>
+	<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><a href="http://wg21.link/P0604R0">P0604R0</a></td><td>LWG</td><td>Resolving GB 55, US 84, US 85, US 86</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0607R0">P0607R0</a></td><td>LWG</td><td>Inline Variables for the Standard Library</td><td>Kona</td><td></td><td></td></tr>
 	<tr><td><a href="http://wg21.link/P0618R0">P0618R0</a></td><td>LWG</td><td>Deprecating &lt;codecvt&gt;</td><td>Kona</td><td></td><td></td></tr>
-	<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><a href="http://wg21.link/P0156R2">P0156R2</a></td><td>LWG</td><td>Variadic Lock guard</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0599R1">P0599R1</a></td><td>LWG</td><td>noexcept for hash functions</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0433R2">P0433R2</a></td><td>LWG</td><td>Toward a resolution of US7 and US14: Integrating template deduction for class templates into the standard library</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0558R1">P0558R1</a></td><td>LWG</td><td>Resolving atomic&lt;T&gt; named base class inconsistencies</td><td>Kona</td><td></td><td></td></tr>
+	<tr><td><a href="http://wg21.link/P0548R1">P0548R1</a></td><td>LWG</td><td>common_type and duration</td><td>Kona</td><td></td><td></td></tr>
 
 <!--  	<tr><td></td><td></td><td></td><td></td><td></td><td></td></tr> -->
   </table>
@@ -387,7 +385,7 @@
 	<tr><td><a href="http://wg21.link/LWG2584">2584</a></td><td><regex> ECMAScript IdentityEscape is ambiguous</td><td>Issaquah</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2588">2588</a></td><td>[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunction</td><td>Issaquah</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2589">2589</a></td><td>match_results can't satisfy the requirements of a container</td><td>Issaquah</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2591">2591</a></td><td>std::function's member template target() should not lead to undefined behaviour</td><td>Issaquah</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2598">2598</a></td><td>addressof works on temporaries</td><td>Issaquah</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2664">2664</a></td><td>operator/ (and other append) semantics not useful if argument has root</td><td>Issaquah</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2665">2665</a></td><td>remove_filename() post condition is incorrect</td><td>Issaquah</td><td>Complete</td></tr>
@@ -437,18 +435,18 @@
 	<tr><td><a href="http://wg21.link/LWG2768">2768</a></td><td>any_cast and move semantics</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2769">2769</a></td><td>Redundant const in the return type of any_cast(const any&amp;)</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2781">2781</a></td><td>Contradictory requirements for std::function and std::reference_wrapper</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2782">2782</a></td><td>scoped_allocator_adaptor constructors must be constrained</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2782">2782</a></td><td>scoped_allocator_adaptor constructors must be constrained</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2784">2784</a></td><td>Resolution to LWG 2484 is missing "otherwise, no effects" and is hard to parse</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2785">2785</a></td><td>quoted should work with basic_string_view</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2786">2786</a></td><td>Annex C should mention shared_ptr changes for array support</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2787">2787</a></td><td>&sect;[file_status.cons] doesn't match class definition</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2788">2788</a></td><td>basic_string range mutators unintentionally require a default constructible allocator</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2788">2788</a></td><td>basic_string range mutators unintentionally require a default constructible allocator</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2789">2789</a></td><td>Equivalence of contained objects</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2790">2790</a></td><td>Missing specification of istreambuf_iterator::operator-&gt;</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2790">2790</a></td><td>Missing specification of istreambuf_iterator::operator-&gt;</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2794">2794</a></td><td>Missing requirements for allocator pointers</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2795">2795</a></td><td>&sect;[global.functions] provides incorrect example of ADL use</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2796">2796</a></td><td>tuple should be a literal type</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2801">2801</a></td><td>Default-constructibility of unique_ptr</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2796">2796</a></td><td>tuple should be a literal type</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2801">2801</a></td><td>Default-constructibility of unique_ptr</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2802">2802</a></td><td>shared_ptr constructor requirements for a deleter</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2804">2804</a></td><td>Unconditional constexpr default constructor for istream_iterator</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2806">2806</a></td><td>Base class of bad_optional_access</td><td>Kona</td><td>Complete</td></tr>
@@ -460,36 +458,36 @@
 	<tr><td><a href="http://wg21.link/LWG2835">2835</a></td><td>LWG 2536 seems to misspecify &lt;tgmath.h&gt;</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2837">2837</a></td><td>gcd and lcm should support a wider range of input values</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2838">2838</a></td><td>is_literal_type specification needs a little cleanup</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2842">2842</a></td><td>in_place_t check for optional::optional(U&amp;&amp;) should decay U</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2850">2850</a></td><td>std::function move constructor does unnecessary work</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2853">2853</a></td><td>Possible inconsistency in specification of erase in [vector.modifiers]</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2855">2855</a></td><td>std::throw_with_nested("string_literal")</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2857">2857</a></td><td>{variant,optional,any}::emplace should return the constructed value</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2861">2861</a></td><td>basic_string should require that charT match traits::char_type</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2842">2842</a></td><td>in_place_t check for optional::optional(U&amp;&amp;) should decay U</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2850">2850</a></td><td>std::function move constructor does unnecessary work</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2853">2853</a></td><td>Possible inconsistency in specification of erase in [vector.modifiers]</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2855">2855</a></td><td>std::throw_with_nested("string_literal")</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2857">2857</a></td><td>{variant,optional,any}::emplace should return the constructed value</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2861">2861</a></td><td>basic_string should require that charT match traits::char_type</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2866">2866</a></td><td>Incorrect derived classes constraints</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2868">2868</a></td><td>Missing specification of bad_any_cast::what()</td><td>Kona</td><td>Complete</td></tr>
 	<tr><td><a href="http://wg21.link/LWG2872">2872</a></td><td>Add definition for direct-non-list-initialization</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2873">2873</a></td><td>Add noexcept to several shared_ptr related functions</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2873">2873</a></td><td>Add noexcept to several shared_ptr related functions</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2874">2874</a></td><td>Constructor shared_ptr::shared_ptr(Y*) should be constrained</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2875">2875</a></td><td>shared_ptr::shared_ptr(Y*, D, [&hellip;]) constructors should be constrained</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2876">2876</a></td><td>shared_ptr::shared_ptr(const weak_ptr&lt;Y&gt;&amp;) constructor should be constrained</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2878">2878</a></td><td>Missing DefaultConstructible requirement for istream_iterator default constructor</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2890">2890</a></td><td>The definition of 'object state' applies only to class types</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2900">2900</a></td><td>The copy and move constructors of optional are not constexpr</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2900">2900</a></td><td>The copy and move constructors of optional are not constexpr</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2903">2903</a></td><td>The form of initialization for the emplace-constructors is not specified</td><td>Kona</td><td></td></tr>
-	<tr><td><a href="http://wg21.link/LWG2904">2904</a></td><td>Make variant move-assignment more exception safe</td><td>Kona</td><td>Complete</td></tr>
-	<tr><td><a href="http://wg21.link/LWG2905">2905</a></td><td>is_constructible_v&lt;unique_ptr&lt;P, D&gt;, P, D const &amp;&gt; should be false when D is not copy constructible</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2904">2904</a></td><td>Make variant move-assignment more exception safe</td><td>Kona</td><td></td></tr>
+	<tr><td><a href="http://wg21.link/LWG2905">2905</a></td><td>is_constructible_v&lt;unique_ptr&lt;P, D&gt;, P, D const &amp;&gt; should be false when D is not copy constructible</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2908">2908</a></td><td>The less-than operator for shared pointers could do more</td><td>Kona</td><td></td></tr>
-	<tr><td><a href="http://wg21.link/LWG2911">2911</a></td><td>An is_aggregate type trait is needed</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2911">2911</a></td><td>An is_aggregate type trait is needed</td><td>Kona</td><td></td></tr>
 	<tr><td><a href="http://wg21.link/LWG2921">2921</a></td><td>packaged_task and type-erased allocators</td><td>Kona</td><td></td></tr>
-	<tr><td><a href="http://wg21.link/LWG2934">2934</a></td><td>optional&lt;const T&gt; doesn't compare with T</td><td>Kona</td><td>Complete</td></tr>
+	<tr><td><a href="http://wg21.link/LWG2934">2934</a></td><td>optional&lt;const T&gt; doesn't compare with T</td><td>Kona</td><td></td></tr>
 <!--
 	<tr><td><a href="http://wg21.link/LWG1214">1214</a></td><td>Insufficient/inconsistent key immutability requirements for associative containers</td><td>Urbana</td><td></td></tr>
 -->
 <!-- 	<tr><td></td><td></td><td></td><td></td></tr> -->
   </table>
 
-  <p>Last Updated: 25-May-2017</p>
+  <p>Last Updated: 6-Mar-2017</p>
 </div>
 </body>
 </html>