Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -1315,7 +1315,6 @@ __attribute__((availability(watchos,strict,introduced=5.0))) # define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS \ _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH __attribute__((unavailable)) # define _LIBCPP_AVAILABILITY_BAD_ANY_CAST \ _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS # define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS \ @@ -1343,7 +1342,6 @@ # define _LIBCPP_AVAILABILITY_SHARED_MUTEX # define _LIBCPP_AVAILABILITY_BAD_VARIANT_ACCESS # define _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS -# define _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH # define _LIBCPP_AVAILABILITY_BAD_ANY_CAST # define _LIBCPP_AVAILABILITY_UNCAUGHT_EXCEPTIONS # define _LIBCPP_AVAILABILITY_SIZED_NEW_DELETE Index: libcxx/include/new =================================================================== --- libcxx/include/new +++ libcxx/include/new @@ -27,12 +27,6 @@ virtual const char* what() const noexcept; }; -class bad_array_length : public bad_alloc // FIXME: Not part of C++ -{ -public: - bad_array_length() noexcept; -}; - class bad_array_new_length : public bad_alloc // C++14 { public: @@ -156,20 +150,6 @@ _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec -#if defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11) - -class _LIBCPP_EXCEPTION_ABI _LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH - bad_array_length : public bad_alloc { -public: - bad_array_length() _NOEXCEPT; - virtual ~bad_array_length() _NOEXCEPT; - virtual const char* what() const _NOEXCEPT; -}; - -#define _LIBCPP_BAD_ARRAY_LENGTH_DEFINED - -#endif // defined(_LIBCPP_BUILDING_LIBRARY) || (_LIBCPP_STD_VER > 11) - #if !defined(_LIBCPP_HAS_NO_LIBRARY_ALIGNED_ALLOCATION) && \ !defined(_LIBCPP_DEFER_NEW_TO_VCRUNTIME) #ifndef _LIBCPP_CXX03_LANG @@ -350,21 +330,6 @@ _DeallocateCaller::__do_deallocate_handle_align(__ptr, __align); } -#ifdef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED -_LIBCPP_NORETURN inline _LIBCPP_INLINE_VISIBILITY -#ifndef _LIBCPP_NO_EXCEPTIONS -_LIBCPP_AVAILABILITY_BAD_ARRAY_LENGTH -#endif -void __throw_bad_array_length() -{ -#ifndef _LIBCPP_NO_EXCEPTIONS - throw bad_array_length(); -#else - _VSTD::abort(); -#endif -} -#endif - template _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_CONSTEXPR _Tp* __launder(_Tp* __p) _NOEXCEPT Index: libcxx/lib/abi/CHANGELOG.TXT =================================================================== --- libcxx/lib/abi/CHANGELOG.TXT +++ libcxx/lib/abi/CHANGELOG.TXT @@ -16,6 +16,35 @@ Version 8.0 ----------- +* rXXXXX - Remove std::bad_array_length + + The change removes the definition of std::bad_array_length (which never made + it into the standard) from the headers and the dylib. This is technically an + ABI break because the symbols are shipped starting with mac OSX 10.13, however + users couldn't be relying on the functionality because it is marked as being + unavailable using Clang's availability attribute. + + x86_64-apple-darwin16.0 + ----------------------- + Symbol removed: __ZNKSt16bad_array_length4whatEv + Symbol removed: __ZNKSt16bad_array_length4whatEv + Symbol removed: __ZNSt16bad_array_lengthC1Ev + Symbol removed: __ZNSt16bad_array_lengthC1Ev + Symbol removed: __ZNSt16bad_array_lengthC2Ev + Symbol removed: __ZNSt16bad_array_lengthC2Ev + Symbol removed: __ZNSt16bad_array_lengthD0Ev + Symbol removed: __ZNSt16bad_array_lengthD0Ev + Symbol removed: __ZNSt16bad_array_lengthD1Ev + Symbol removed: __ZNSt16bad_array_lengthD1Ev + Symbol removed: __ZNSt16bad_array_lengthD2Ev + Symbol removed: __ZNSt16bad_array_lengthD2Ev + Symbol removed: __ZTISt16bad_array_length + Symbol removed: __ZTISt16bad_array_length + Symbol removed: __ZTSSt16bad_array_length + Symbol removed: __ZTSSt16bad_array_length + Symbol removed: __ZTVSt16bad_array_length + Symbol removed: __ZTVSt16bad_array_length + * r347395 - Making libc++ build under -fvisibility=hidden on Linux The change marks several function templates as hidden. This removes symbols Index: libcxx/lib/abi/x86_64-apple-darwin.v1.abilist =================================================================== --- libcxx/lib/abi/x86_64-apple-darwin.v1.abilist +++ libcxx/lib/abi/x86_64-apple-darwin.v1.abilist @@ -8,8 +8,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'} {'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'} {'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'} -{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'} -{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv'} @@ -527,16 +525,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'} {'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'} {'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'} @@ -1804,8 +1792,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0} @@ -2059,8 +2045,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0} @@ -2251,8 +2235,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0} Index: libcxx/lib/abi/x86_64-apple-darwin.v2.abilist =================================================================== --- libcxx/lib/abi/x86_64-apple-darwin.v2.abilist +++ libcxx/lib/abi/x86_64-apple-darwin.v2.abilist @@ -8,8 +8,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZNKSt13bad_exception4whatEv'} {'type': 'U', 'is_defined': False, 'name': '__ZNKSt13runtime_error4whatEv'} {'type': 'I', 'is_defined': True, 'name': '__ZNKSt13runtime_error4whatEv'} -{'type': 'U', 'is_defined': False, 'name': '__ZNKSt16bad_array_length4whatEv'} -{'type': 'I', 'is_defined': True, 'name': '__ZNKSt16bad_array_length4whatEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt16nested_exception14rethrow_nestedEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt18bad_variant_access4whatEv'} {'type': 'FUNC', 'is_defined': True, 'name': '__ZNKSt19bad_optional_access4whatEv'} @@ -530,16 +528,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD1Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt15underflow_errorD2Ev'} {'type': 'I', 'is_defined': True, 'name': '__ZNSt15underflow_errorD2Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC1Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC1Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthC2Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthC2Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD0Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD0Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD1Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD1Ev'} -{'type': 'U', 'is_defined': False, 'name': '__ZNSt16bad_array_lengthD2Ev'} -{'type': 'I', 'is_defined': True, 'name': '__ZNSt16bad_array_lengthD2Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD0Ev'} {'type': 'I', 'is_defined': True, 'name': '__ZNSt16invalid_argumentD0Ev'} {'type': 'U', 'is_defined': False, 'name': '__ZNSt16invalid_argumentD1Ev'} @@ -1721,8 +1709,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTISt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTISt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTISt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTISt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTISt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTISt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTISt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTISt16nested_exception', 'size': 0} @@ -2013,8 +1999,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTSSt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTSSt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTSSt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTSSt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTSSt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTSSt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTSSt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTSSt16nested_exception', 'size': 0} @@ -2206,8 +2190,6 @@ {'type': 'I', 'is_defined': True, 'name': '__ZTVSt14overflow_error'} {'type': 'U', 'is_defined': False, 'name': '__ZTVSt15underflow_error'} {'type': 'I', 'is_defined': True, 'name': '__ZTVSt15underflow_error'} -{'type': 'U', 'is_defined': False, 'name': '__ZTVSt16bad_array_length'} -{'type': 'I', 'is_defined': True, 'name': '__ZTVSt16bad_array_length'} {'type': 'U', 'is_defined': False, 'name': '__ZTVSt16invalid_argument'} {'type': 'I', 'is_defined': True, 'name': '__ZTVSt16invalid_argument'} {'type': 'OBJECT', 'is_defined': True, 'name': '__ZTVSt16nested_exception', 'size': 0} Index: libcxx/lib/libc++abi2.exp =================================================================== --- libcxx/lib/libc++abi2.exp +++ libcxx/lib/libc++abi2.exp @@ -283,16 +283,6 @@ __ZTSSt16invalid_argument __ZTVSt16invalid_argument -__ZNKSt16bad_array_length4whatEv -__ZNSt16bad_array_lengthC1Ev -__ZNSt16bad_array_lengthC2Ev -__ZNSt16bad_array_lengthD0Ev -__ZNSt16bad_array_lengthD1Ev -__ZNSt16bad_array_lengthD2Ev -__ZTISt16bad_array_length -__ZTSSt16bad_array_length -__ZTVSt16bad_array_length - __ZTSDi __ZTSDn __ZTSDs Index: libcxx/src/support/runtime/exception_fallback.ipp =================================================================== --- libcxx/src/support/runtime/exception_fallback.ipp +++ libcxx/src/support/runtime/exception_fallback.ipp @@ -134,22 +134,6 @@ return "bad_array_new_length"; } - -bad_array_length::bad_array_length() _NOEXCEPT -{ -} - -bad_array_length::~bad_array_length() _NOEXCEPT -{ -} - -const char* -bad_array_length::what() const _NOEXCEPT -{ - return "bad_array_length"; -} - - bad_cast::bad_cast() _NOEXCEPT { } Index: libcxx/src/support/runtime/exception_glibcxx.ipp =================================================================== --- libcxx/src/support/runtime/exception_glibcxx.ipp +++ libcxx/src/support/runtime/exception_glibcxx.ipp @@ -22,11 +22,6 @@ { } -bad_array_length::bad_array_length() _NOEXCEPT -{ -} - - bad_cast::bad_cast() _NOEXCEPT { } Index: libcxx/src/support/runtime/exception_libcxxrt.ipp =================================================================== --- libcxx/src/support/runtime/exception_libcxxrt.ipp +++ libcxx/src/support/runtime/exception_libcxxrt.ipp @@ -23,19 +23,4 @@ return "std::bad_exception"; } - -bad_array_length::bad_array_length() _NOEXCEPT -{ -} - -bad_array_length::~bad_array_length() _NOEXCEPT -{ -} - -const char* -bad_array_length::what() const _NOEXCEPT -{ - return "bad_array_length"; -} - } // namespace std Index: libcxx/src/support/runtime/exception_msvc.ipp =================================================================== --- libcxx/src/support/runtime/exception_msvc.ipp +++ libcxx/src/support/runtime/exception_msvc.ipp @@ -83,20 +83,6 @@ return __uncaught_exceptions(); } -bad_array_length::bad_array_length() _NOEXCEPT -{ -} - -bad_array_length::~bad_array_length() _NOEXCEPT -{ -} - -const char* -bad_array_length::what() const _NOEXCEPT -{ - return "bad_array_length"; -} - #if defined(_LIBCPP_NO_VCRUNTIME) bad_cast::bad_cast() _NOEXCEPT { Index: libcxx/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.pass.cpp =================================================================== --- libcxx/test/libcxx/language.support/support.dynamic/alloc.errors/new.badlength/bad_array_length.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. -// -//===----------------------------------------------------------------------===// - -// 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 -#include -#include - -int main() -{ - static_assert((std::is_base_of::value), - "std::is_base_of::value"); - static_assert(std::is_polymorphic::value, - "std::is_polymorphic::value"); - std::bad_array_length b; - std::bad_array_length b2 = b; - b2 = b; - const char* w = b2.what(); - assert(w); -} Index: libcxxabi/src/stdlib_exception.cpp =================================================================== --- libcxxabi/src/stdlib_exception.cpp +++ libcxxabi/src/stdlib_exception.cpp @@ -69,34 +69,4 @@ return "bad_array_new_length"; } -// bad_array_length - -#ifndef _LIBCPP_BAD_ARRAY_LENGTH_DEFINED - -class _LIBCPP_EXCEPTION_ABI bad_array_length - : public bad_alloc -{ -public: - bad_array_length() _NOEXCEPT; - virtual ~bad_array_length() _NOEXCEPT; - virtual const char* what() const _NOEXCEPT; -}; - -#endif // _LIBCPP_BAD_ARRAY_LENGTH_DEFINED - -bad_array_length::bad_array_length() _NOEXCEPT -{ -} - -bad_array_length::~bad_array_length() _NOEXCEPT -{ -} - -const char* -bad_array_length::what() const _NOEXCEPT -{ - return "bad_array_length"; -} - - } // std