Index: libcxx/include/string =================================================================== --- libcxx/include/string +++ libcxx/include/string @@ -1834,6 +1834,9 @@ #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS template +#ifndef _LIBCPP_BUILDING_STRING +inline _LIBCPP_INLINE_VISIBILITY +#endif basic_string<_CharT, _Traits, _Allocator>::~basic_string() { #if _LIBCPP_DEBUG_LEVEL >= 2 Index: libcxx/src/string.cpp =================================================================== --- libcxx/src/string.cpp +++ libcxx/src/string.cpp @@ -7,6 +7,9 @@ // //===----------------------------------------------------------------------===// +// For keeping the definition of ~basic_string in this translation unit. +#define _LIBCPP_BUILDING_STRING + #include "string" #include "cstdlib" #include "cwchar"