[libcxx] r311197 - Merging r309474:

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 13:59:31 PDT 2017


Author: hans
Date: Fri Aug 18 13:59:31 2017
New Revision: 311197

URL: http://llvm.org/viewvc/llvm-project?rev=311197&view=rev
Log:
Merging r309474:
------------------------------------------------------------------------
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.
------------------------------------------------------------------------

Modified:
    libcxx/branches/release_50/   (props changed)
    libcxx/branches/release_50/include/string

Propchange: libcxx/branches/release_50/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 18 13:59:31 2017
@@ -1,2 +1,2 @@
 /libcxx/branches/apple:136569-137939
-/libcxx/trunk:309296,309307,309838,309851,309917,309920
+/libcxx/trunk:309296,309307,309474,309838,309851,309917,309920

Modified: libcxx/branches/release_50/include/string
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_50/include/string?rev=311197&r1=311196&r2=311197&view=diff
==============================================================================
--- libcxx/branches/release_50/include/string (original)
+++ libcxx/branches/release_50/include/string Fri Aug 18 13:59:31 2017
@@ -556,6 +556,8 @@ template<class _CharT, class _Traits, cl
 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
 
 _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]




More information about the cfe-commits mailing list