summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-08-18 20:59:31 +0000
committerHans Wennborg <hans@hanshq.net>2017-08-18 20:59:31 +0000
commit3fa4f9bbd1408f9b42b5a92c937cc832f3061ee8 (patch)
treeba593ef571ef46076f0ce878cf2e16f82ff01c25
parentef34b82889be4aa6438da96868f3c5d9fd38edcc (diff)
------------------------------------------------------------------------ r309474 | smeenai | 2017-07-28 19:54:41 -0700 (Fri, 28 Jul 2017) | 9 lines [libc++] Hoist extern template above first use This function template is referenced inside class basic_string as a friend function. The extern template declaration needs to be above that friend declaration to actually take effect. This is important because this function was marked as exported in r307966, so without the extern template taking effect, it can leak into other DSOs as a visible symbol. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/libcxx/branches/release_50@311197 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/string3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/string b/include/string
index cf42f529c..610f19ecb 100644
--- a/include/string
+++ b/include/string
@@ -556,6 +556,8 @@ template<class _CharT, class _Traits, class _Allocator>
basic_string<_CharT, _Traits, _Allocator>
operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y);
+_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
+
template <bool>
class _LIBCPP_TEMPLATE_VIS __basic_string_common
{
@@ -3999,7 +4001,6 @@ basic_string<_CharT, _Traits, _Allocator>::__subscriptable(const const_iterator*
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<char>)
_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_string<wchar_t>)
-_LIBCPP_EXTERN_TEMPLATE(_LIBCPP_FUNC_VIS string operator+<char, char_traits<char>, allocator<char> >(char const*, string const&))
#if _LIBCPP_STD_VER > 11
// Literal suffixes for basic_string [basic.string.literals]