diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -618,18 +618,6 @@ _LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+, allocator >(char const*, string const&)) -#ifndef _LIBCPP_ABI_NO_BASIC_STRING_BASE_CLASS -template -struct __basic_string_common; - -template <> -struct __basic_string_common { - // Both are defined in string.cpp - _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_length_error() const; - _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_out_of_range() const; -}; -#endif - template struct __string_is_trivial_iterator : public false_type {}; @@ -682,9 +670,6 @@ _LIBCPP_PREFERRED_NAME(u32string) #endif basic_string -#ifndef _LIBCPP_ABI_NO_BASIC_STRING_BASE_CLASS - : private __basic_string_common // This base class is historical, but it needs to remain for ABI compatibility -#endif { public: typedef basic_string __self; diff --git a/libcxx/src/string.cpp b/libcxx/src/string.cpp --- a/libcxx/src/string.cpp +++ b/libcxx/src/string.cpp @@ -22,13 +22,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD #ifndef _LIBCPP_ABI_NO_BASIC_STRING_BASE_CLASS -void __basic_string_common::__throw_length_error() const { - _VSTD::__throw_length_error("basic_string"); -} -void __basic_string_common::__throw_out_of_range() const { - _VSTD::__throw_out_of_range("basic_string"); -} +template +struct __basic_string_common; + +template <> +struct __basic_string_common { + // Both are defined in string.cpp + _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_length_error() const { + _VSTD::__throw_length_error("basic_string"); + } + _LIBCPP_NORETURN _LIBCPP_EXPORTED_FROM_ABI void __throw_out_of_range() const { + _VSTD::__throw_out_of_range("basic_string"); + } +}; + #endif #define _LIBCPP_EXTERN_TEMPLATE_DEFINE(...) template __VA_ARGS__;