summaryrefslogtreecommitdiffstats
path: root/libcxx
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-11-06 21:08:48 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-11-06 21:08:48 +0000
commitcd47cbc7a44604a65d3ef391822a32b79b2f61e4 (patch)
treea8a24b04b88d31cf33571aeadc5d3252ca45e831 /libcxx
parentdc4ecaff07b62f7ddf4be17d72b336182382b0e5 (diff)
downloadbcm5719-llvm-cd47cbc7a44604a65d3ef391822a32b79b2f61e4.tar.gz
bcm5719-llvm-cd47cbc7a44604a65d3ef391822a32b79b2f61e4.zip
Provide a way to disable use of extern templates in libc++. This is intended for the clients of libc++, not the libc++ build. The dylib should always contain the extern templates. To disable the client needs to put -D'_LIBCPP_EXTERN_TEMPLATE(...)=' on the command line.
llvm-svn: 167486
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/include/__config4
-rw-r--r--libcxx/include/__locale12
-rw-r--r--libcxx/include/algorithm66
-rw-r--r--libcxx/include/istream6
-rw-r--r--libcxx/include/locale72
-rw-r--r--libcxx/include/ostream4
-rw-r--r--libcxx/include/streambuf8
-rw-r--r--libcxx/include/string6
-rw-r--r--libcxx/include/valarray6
-rw-r--r--libcxx/include/vector2
10 files changed, 95 insertions, 91 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index 4e69964bae1..2bbe1d97242 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -427,6 +427,10 @@ template <unsigned> struct __static_assert_check {};
#define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x)
#endif // _LIBCPP_HAS_NO_STRONG_ENUMS
+#ifndef _LIBCPP_EXTERN_TEMPLATE
+#define _LIBCPP_EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
+#endif
+
#if __APPLE__ || __FreeBSD__ || _WIN32 || __sun__
#define _LIBCPP_LOCALE__L_EXTENSIONS 1
#endif
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index e6c357f9e53..4176720c661 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -254,8 +254,8 @@ collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) const
return static_cast<long>(__h);
}
-extern template class _LIBCPP_VISIBLE collate<char>;
-extern template class _LIBCPP_VISIBLE collate<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<char>)
+_LIBCPP_EXTERN_TEMPLATE(class _LIBCPP_VISIBLE collate<wchar_t>)
// template <class CharT> class collate_byname;
@@ -1135,10 +1135,10 @@ codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname()
{
}
-extern template class codecvt_byname<char, char, mbstate_t>;
-extern template class codecvt_byname<wchar_t, char, mbstate_t>;
-extern template class codecvt_byname<char16_t, char, mbstate_t>;
-extern template class codecvt_byname<char32_t, char, mbstate_t>;
+_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<wchar_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char16_t, char, mbstate_t>)
+_LIBCPP_EXTERN_TEMPLATE(class codecvt_byname<char32_t, char, mbstate_t>)
_LIBCPP_VISIBLE void __throw_runtime_error(const char*);
diff --git a/libcxx/include/algorithm b/libcxx/include/algorithm
index 1ce14b46d42..0f6107bdde0 100644
--- a/libcxx/include/algorithm
+++ b/libcxx/include/algorithm
@@ -3782,39 +3782,39 @@ sort(__wrap_iter<_Tp*> __first, __wrap_iter<_Tp*> __last, _Compare __comp)
#pragma warning( push )
#pragma warning( disable: 4231)
#endif // _MSC_VER
-extern template void __sort<__less<char>&, char*>(char*, char*, __less<char>&);
-extern template void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
-extern template void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template void __sort<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template void __sort<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template void __sort<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template void __sort<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template void __sort<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&);
-extern template bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&);
-extern template bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&);
-extern template bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&);
-extern template bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&);
-extern template bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&);
-extern template bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&);
-extern template bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&);
-extern template bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&);
-extern template bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&);
-extern template bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&);
-extern template bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&);
-extern template bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&);
-extern template bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&);
-extern template bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&);
-
-extern template unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&);
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<char>&, char*>(char*, char*, __less<char>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<short>&, short*>(short*, short*, __less<short>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<int>&, int*>(int*, int*, __less<int>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<long>&, long*>(long*, long*, __less<long>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<float>&, float*>(float*, float*, __less<float>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<double>&, double*>(double*, double*, __less<double>&))
+_LIBCPP_EXTERN_TEMPLATE(void __sort<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
+
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<char>&, char*>(char*, char*, __less<char>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<wchar_t>&, wchar_t*>(wchar_t*, wchar_t*, __less<wchar_t>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<signed char>&, signed char*>(signed char*, signed char*, __less<signed char>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<unsigned char>&, unsigned char*>(unsigned char*, unsigned char*, __less<unsigned char>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<short>&, short*>(short*, short*, __less<short>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<unsigned short>&, unsigned short*>(unsigned short*, unsigned short*, __less<unsigned short>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<int>&, int*>(int*, int*, __less<int>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<unsigned>&, unsigned*>(unsigned*, unsigned*, __less<unsigned>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<long>&, long*>(long*, long*, __less<long>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<unsigned long>&, unsigned long*>(unsigned long*, unsigned long*, __less<unsigned long>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<long long>&, long long*>(long long*, long long*, __less<long long>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<unsigned long long>&, unsigned long long*>(unsigned long long*, unsigned long long*, __less<unsigned long long>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<float>&, float*>(float*, float*, __less<float>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<double>&, double*>(double*, double*, __less<double>&))
+_LIBCPP_EXTERN_TEMPLATE(bool __insertion_sort_incomplete<__less<long double>&, long double*>(long double*, long double*, __less<long double>&))
+
+_LIBCPP_EXTERN_TEMPLATE(unsigned __sort5<__less<long double>&, long double*>(long double*, long double*, long double*, long double*, long double*, __less<long double>&))
#ifdef _MSC_VER
#pragma warning( pop )
#endif // _MSC_VER
diff --git a/libcxx/include/istream b/libcxx/include/istream
index 7b481864250..dc1c52be639 100644
--- a/libcxx/include/istream
+++ b/libcxx/include/istream
@@ -1710,9 +1710,9 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x)
return __is;
}
-extern template class basic_istream<char>;
-extern template class basic_istream<wchar_t>;
-extern template class basic_iostream<char>;
+_LIBCPP_EXTERN_TEMPLATE(class basic_istream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_istream<wchar_t>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_iostream<char>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/locale b/libcxx/include/locale
index 0d77a4a13e7..72b4729bae4 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -692,8 +692,8 @@ __num_get<_CharT>::__stage2_float_loop(_CharT __ct, bool& __in_units, char& __ex
return 0;
}
-extern template struct __num_get<char>;
-extern template struct __num_get<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(struct __num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE(struct __num_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_VISIBLE num_get
@@ -1314,8 +1314,8 @@ num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-extern template class num_get<char>;
-extern template class num_get<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class num_get<char>)
+_LIBCPP_EXTERN_TEMPLATE(class num_get<wchar_t>)
struct __num_put_base
{
@@ -1464,8 +1464,8 @@ __num_put<_CharT>::__widen_and_group_float(char* __nb, char* __np, char* __ne,
__op = __ob + (__np - __nb);
}
-extern template struct __num_put<char>;
-extern template struct __num_put<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(struct __num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE(struct __num_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_VISIBLE num_put
@@ -1938,8 +1938,8 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob,
return __pad_and_output(__s, __o, __op, __oe, __iob, __fl);
}
-extern template class num_put<char>;
-extern template class num_put<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class num_put<char>)
+_LIBCPP_EXTERN_TEMPLATE(class num_put<wchar_t>)
template <class _CharT, class _InputIterator>
_LIBCPP_HIDDEN
@@ -2605,8 +2605,8 @@ time_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-extern template class time_get<char>;
-extern template class time_get<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class time_get<char>)
+_LIBCPP_EXTERN_TEMPLATE(class time_get<wchar_t>)
class __time_get
{
@@ -2688,8 +2688,8 @@ private:
virtual const string_type& __X() const {return this->__X_;}
};
-extern template class time_get_byname<char>;
-extern template class time_get_byname<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class time_get_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE(class time_get_byname<wchar_t>)
class __time_put
{
@@ -2801,8 +2801,8 @@ time_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base&,
return _VSTD::copy(__nb, __ne, __s);
}
-extern template class time_put<char>;
-extern template class time_put<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class time_put<char>)
+_LIBCPP_EXTERN_TEMPLATE(class time_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_VISIBLE time_put_byname
@@ -2822,8 +2822,8 @@ protected:
~time_put_byname() {}
};
-extern template class time_put_byname<char>;
-extern template class time_put_byname<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class time_put_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE(class time_put_byname<wchar_t>)
// money_base
@@ -2885,10 +2885,10 @@ template <class _CharT, bool _International>
locale::id
moneypunct<_CharT, _International>::id;
-extern template class moneypunct<char, false>;
-extern template class moneypunct<char, true>;
-extern template class moneypunct<wchar_t, false>;
-extern template class moneypunct<wchar_t, true>;
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, false>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct<char, true>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct<wchar_t, true>)
// moneypunct_byname
@@ -2942,10 +2942,10 @@ template<> void moneypunct_byname<char, true>::init(const char*);
template<> void moneypunct_byname<wchar_t, false>::init(const char*);
template<> void moneypunct_byname<wchar_t, true>::init(const char*);
-extern template class moneypunct_byname<char, false>;
-extern template class moneypunct_byname<char, true>;
-extern template class moneypunct_byname<wchar_t, false>;
-extern template class moneypunct_byname<wchar_t, true>;
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<char, false>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<char, true>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<wchar_t, false>)
+_LIBCPP_EXTERN_TEMPLATE(class moneypunct_byname<wchar_t, true>)
// money_get
@@ -3001,8 +3001,8 @@ __money_get<_CharT>::__gather_info(bool __intl, const locale& __loc,
}
}
-extern template class __money_get<char>;
-extern template class __money_get<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class __money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE(class __money_get<wchar_t>)
template <class _CharT, class _InputIterator = istreambuf_iterator<_CharT> >
class _LIBCPP_VISIBLE money_get
@@ -3383,8 +3383,8 @@ money_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
return __b;
}
-extern template class money_get<char>;
-extern template class money_get<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class money_get<char>)
+_LIBCPP_EXTERN_TEMPLATE(class money_get<wchar_t>)
// money_put
@@ -3558,8 +3558,8 @@ __money_put<_CharT>::__format(char_type* __mb, char_type*& __mi, char_type*& __m
__mi = __mb;
}
-extern template class __money_put<char>;
-extern template class __money_put<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class __money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE(class __money_put<wchar_t>)
template <class _CharT, class _OutputIterator = ostreambuf_iterator<_CharT> >
class _LIBCPP_VISIBLE money_put
@@ -3715,8 +3715,8 @@ money_put<_CharT, _OutputIterator>::do_put(iter_type __s, bool __intl,
return __pad_and_output(__s, __mb, __mi, __me, __iob, __fl);
}
-extern template class money_put<char>;
-extern template class money_put<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class money_put<char>)
+_LIBCPP_EXTERN_TEMPLATE(class money_put<wchar_t>)
// messages
@@ -3825,8 +3825,8 @@ messages<_CharT>::do_close(catalog __c) const
#endif // !_WIN32
}
-extern template class messages<char>;
-extern template class messages<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class messages<char>)
+_LIBCPP_EXTERN_TEMPLATE(class messages<wchar_t>)
template <class _CharT>
class _LIBCPP_VISIBLE messages_byname
@@ -3849,8 +3849,8 @@ protected:
~messages_byname() {}
};
-extern template class messages_byname<char>;
-extern template class messages_byname<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class messages_byname<char>)
+_LIBCPP_EXTERN_TEMPLATE(class messages_byname<wchar_t>)
template<class _Codecvt, class _Elem = wchar_t,
class _Wide_alloc = allocator<_Elem>,
diff --git a/libcxx/include/ostream b/libcxx/include/ostream
index b135ddb7713..9d26a41e829 100644
--- a/libcxx/include/ostream
+++ b/libcxx/include/ostream
@@ -1287,8 +1287,8 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x)
use_facet<ctype<_CharT> >(__os.getloc()).widen('1'));
}
-extern template class basic_ostream<char>;
-extern template class basic_ostream<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class basic_ostream<char>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_ostream<wchar_t>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf
index e34ad23eb72..d6880241022 100644
--- a/libcxx/include/streambuf
+++ b/libcxx/include/streambuf
@@ -553,11 +553,11 @@ basic_streambuf<_CharT, _Traits>::overflow(int_type)
return traits_type::eof();
}
-extern template class basic_streambuf<char>;
-extern template class basic_streambuf<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class basic_streambuf<char>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_streambuf<wchar_t>)
-extern template class basic_ios<char>;
-extern template class basic_ios<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class basic_ios<char>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_ios<wchar_t>)
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/string b/libcxx/include/string
index 00016ee9801..5bf42f023a4 100644
--- a/libcxx/include/string
+++ b/libcxx/include/string
@@ -1031,7 +1031,7 @@ __basic_string_common<__b>::__throw_out_of_range() const
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _MSC_VER
-extern template class __basic_string_common<true>;
+_LIBCPP_EXTERN_TEMPLATE(class __basic_string_common<true>)
#ifdef _MSC_VER
#pragma warning( pop )
#endif // _MSC_VER
@@ -3975,8 +3975,8 @@ getline(basic_istream<_CharT, _Traits>&& __is,
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-extern template class basic_string<char>;
-extern template class basic_string<wchar_t>;
+_LIBCPP_EXTERN_TEMPLATE(class basic_string<char>)
+_LIBCPP_EXTERN_TEMPLATE(class basic_string<wchar_t>)
extern template
string
diff --git a/libcxx/include/valarray b/libcxx/include/valarray
index 4091d0f71b3..c56dd125d6a 100644
--- a/libcxx/include/valarray
+++ b/libcxx/include/valarray
@@ -4770,9 +4770,9 @@ end(const valarray<_Tp>& __v)
return __v.__end_;
}
-extern template valarray<size_t>::valarray(size_t);
-extern template valarray<size_t>::~valarray();
-extern template void valarray<size_t>::resize(size_t, size_t);
+_LIBCPP_EXTERN_TEMPLATE(valarray<size_t>::valarray(size_t))
+_LIBCPP_EXTERN_TEMPLATE(valarray<size_t>::~valarray())
+_LIBCPP_EXTERN_TEMPLATE(void valarray<size_t>::resize(size_t, size_t))
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/vector b/libcxx/include/vector
index ee7143555ca..0c280682833 100644
--- a/libcxx/include/vector
+++ b/libcxx/include/vector
@@ -313,7 +313,7 @@ __vector_base_common<__b>::__throw_out_of_range() const
#pragma warning( push )
#pragma warning( disable: 4231 )
#endif // _MSC_VER
-extern template class __vector_base_common<true>;
+_LIBCPP_EXTERN_TEMPLATE(class __vector_base_common<true>)
#ifdef _MSC_VER
#pragma warning( pop )
#endif // _MSC_VER
OpenPOWER on IntegriCloud