summaryrefslogtreecommitdiffstats
path: root/libcxx/include/string
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2017-07-29 02:54:41 +0000
committerShoaib Meenai <smeenai@fb.com>2017-07-29 02:54:41 +0000
commit191b7d18f1651f2171ab82fb0dc89cd05e9d9565 (patch)
treeb0ec2b95a56b7551235461a14786fda476e5ba84 /libcxx/include/string
parent15b5c8b2069a025566f13c4a81339c6f687ee312 (diff)
downloadbcm5719-llvm-191b7d18f1651f2171ab82fb0dc89cd05e9d9565.tar.gz
bcm5719-llvm-191b7d18f1651f2171ab82fb0dc89cd05e9d9565.zip
[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. llvm-svn: 309474
Diffstat (limited to 'libcxx/include/string')
-rw-r--r--libcxx/include/string3
1 files changed, 2 insertions, 1 deletions
diff --git a/libcxx/include/string b/libcxx/include/string
index cf42f529c70..610f19ecba2 100644
--- a/libcxx/include/string
+++ b/libcxx/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]
OpenPOWER on IntegriCloud