diff --git a/libcxx/.clang-format b/libcxx/.clang-format index f548119652c19..f7c32c3307dd4 100644 --- a/libcxx/.clang-format +++ b/libcxx/.clang-format @@ -33,7 +33,6 @@ AttributeMacros: [ '_LIBCPP_DISABLE_EXTENSION_WARNING', '_LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION', '_LIBCPP_EXPORTED_FROM_ABI', - '_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS', '_LIBCPP_FALLTHROUGH', '_LIBCPP_HIDDEN', '_LIBCPP_HIDE_FROM_ABI_AFTER_V1', diff --git a/libcxx/docs/DesignDocs/VisibilityMacros.rst b/libcxx/docs/DesignDocs/VisibilityMacros.rst index 83a9a62942bc9..bf9a1de801cc6 100644 --- a/libcxx/docs/DesignDocs/VisibilityMacros.rst +++ b/libcxx/docs/DesignDocs/VisibilityMacros.rst @@ -75,36 +75,6 @@ Visibility Macros **Windows Behavior**: DLLs do not support dllimport/export on class templates. The macro has an empty definition on this platform. -**_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS** - Mark the member functions, typeinfo, and vtable of the type named in - an extern template declaration as being exported by the libc++ library. - This attribute must be specified on all extern class template declarations. - - This macro is used to override the `_LIBCPP_TEMPLATE_VIS` attribute - specified on the primary template and to export the member functions produced - by the explicit instantiation in the dylib. - - **Windows Behavior**: `extern template` and `dllexport` are fundamentally - incompatible *on a class template* on Windows; the former suppresses - instantiation, while the latter forces it. Specifying both on the same - declaration makes the class template be instantiated, which is not desirable - inside headers. This macro therefore expands to `dllimport` outside of libc++ - but nothing inside of it (rather than expanding to `dllexport`); instead, the - explicit instantiations themselves are marked as exported. Note that this - applies *only* to extern *class* templates. Extern *function* templates obey - regular import/export semantics, and applying `dllexport` directly to the - extern template declaration (i.e. using `_LIBCPP_FUNC_VIS`) is the correct - thing to do for them. - -**_LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS** - Mark the member functions, typeinfo, and vtable of an explicit instantiation - of a class template as being exported by the libc++ library. This attribute - must be specified on all class template explicit instantiations. - - It is only necessary to mark the explicit instantiation itself (as opposed to - the extern template declaration) as exported on Windows, as discussed above. - On all other platforms, this macro has an empty definition. - **_LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS** Mark a symbol as hidden so it will not be exported from shared libraries. This is intended specifically for method templates of either classes marked with diff --git a/libcxx/include/__config b/libcxx/include/__config index ea51d30dcda99..be96aaac542b5 100644 --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -363,23 +363,12 @@ typedef __char32_t char32_t; # endif # if defined(_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS) || (defined(__MINGW32__) && !defined(_LIBCPP_BUILDING_LIBRARY)) -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS # define _LIBCPP_OVERRIDABLE_FUNC_VIS # define _LIBCPP_EXPORTED_FROM_ABI # elif defined(_LIBCPP_BUILDING_LIBRARY) -# if defined(__MINGW32__) -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllexport) -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS -# else -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __declspec(dllexport) -# endif # define _LIBCPP_OVERRIDABLE_FUNC_VIS __declspec(dllexport) # define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllexport) # else -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __declspec(dllimport) -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS # define _LIBCPP_OVERRIDABLE_FUNC_VIS # define _LIBCPP_EXPORTED_FROM_ABI __declspec(dllimport) # endif @@ -401,8 +390,6 @@ typedef __char32_t char32_t; # define _LIBCPP_HIDDEN _LIBCPP_VISIBILITY("hidden") # define _LIBCPP_TEMPLATE_DATA_VIS _LIBCPP_VISIBILITY("default") # define _LIBCPP_EXPORTED_FROM_ABI _LIBCPP_VISIBILITY("default") -# define _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS _LIBCPP_VISIBILITY("default") -# define _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS // TODO: Make this a proper customization point or remove the option to override it. # ifndef _LIBCPP_OVERRIDABLE_FUNC_VIS @@ -553,6 +540,17 @@ typedef __char32_t char32_t; # define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++2b-extensions") # endif +# if __has_warning("-Wdllexport-explicit-instantiation") +# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORE_DLLEXPORT \ + _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdllexport-explicit-instantiation") +# elif defined(_LIBCPP_OBJECT_FORMAT_COFF) +# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORE_DLLEXPORT \ + _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wignored-attributes") \ + _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wdllexport-explicit-instantiation-decl") +# else +# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORE_DLLEXPORT +# endif + // Clang modules take a significant compile time hit when pushing and popping diagnostics. // Since all the headers are marked as system headers in the modulemap, we can simply disable this // pushing and popping when building with clang modules. @@ -564,6 +562,7 @@ typedef __char32_t char32_t; _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \ _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION \ + _LIBCPP_CLANG_DIAGNOSTIC_IGNORE_DLLEXPORT \ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++14-extensions") \ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++17-extensions") \ _LIBCPP_GCC_DIAGNOSTIC_IGNORED("-Wc++20-extensions") \ diff --git a/libcxx/include/__locale b/libcxx/include/__locale index 5ae3228989749..89e82d1c7365c 100644 --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -237,9 +237,9 @@ long collate<_CharT>::do_hash(const char_type* __lo, const char_type* __hi) cons return static_cast(__h); } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate; +extern template class _LIBCPP_EXPORTED_FROM_ABI collate; #if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS collate; +extern template class _LIBCPP_EXPORTED_FROM_ABI collate; #endif // template class collate_byname; @@ -1251,17 +1251,17 @@ template codecvt_byname<_InternT, _ExternT, _StateT>::~codecvt_byname() {} _LIBCPP_SUPPRESS_DEPRECATED_POP -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; #if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; #endif extern template class _LIBCPP_DEPRECATED_IN_CXX20 -_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; // deprecated in C++20 +_LIBCPP_EXPORTED_FROM_ABI codecvt_byname; // deprecated in C++20 extern template class _LIBCPP_DEPRECATED_IN_CXX20 -_LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; // deprecated in C++20 +_LIBCPP_EXPORTED_FROM_ABI codecvt_byname; // deprecated in C++20 #if _LIBCPP_HAS_CHAR8_T -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; // C++20 -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS codecvt_byname; // C++20 +extern template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; // C++20 +extern template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; // C++20 #endif template diff --git a/libcxx/include/__ostream/basic_ostream.h b/libcxx/include/__ostream/basic_ostream.h index 12ec3694de93b..5f8074be8edd6 100644 --- a/libcxx/include/__ostream/basic_ostream.h +++ b/libcxx/include/__ostream/basic_ostream.h @@ -665,9 +665,9 @@ basic_ostream& operator<<(basic_ostream&, const ch # endif // _LIBCPP_STD_VER >= 20 -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ostream; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ostream; # endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/fstream b/libcxx/include/fstream index 43e3741897aa1..2217a82fd52f6 100644 --- a/libcxx/include/fstream +++ b/libcxx/include/fstream @@ -1563,9 +1563,9 @@ inline void basic_fstream<_CharT, _Traits>::close() { } # if _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ifstream; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ofstream; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_filebuf; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ifstream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ofstream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_filebuf; # endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/ios b/libcxx/include/ios index 98a088266539a..313efdee8eebf 100644 --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -745,10 +745,10 @@ inline _LIBCPP_HIDE_FROM_ABI void basic_ios<_CharT, _Traits>::set_rdbuf(basic_st ios_base::set_rdbuf(__sb); } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ios; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ios; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ios; # endif _LIBCPP_HIDE_FROM_ABI inline ios_base& boolalpha(ios_base& __str) { diff --git a/libcxx/include/istream b/libcxx/include/istream index 4b177c41cc325..ef7c199de8834 100644 --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -1365,11 +1365,11 @@ operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) { return __is; } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_istream; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_istream; # endif -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_iostream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_iostream; _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/locale b/libcxx/include/locale index fa15302223202..ec50be42d8117 100644 --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -561,9 +561,9 @@ int __num_get<_CharT>::__stage2_float_loop( return 0; } -extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get; +extern template struct _LIBCPP_EXPORTED_FROM_ABI __num_get; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_get; +extern template struct _LIBCPP_EXPORTED_FROM_ABI __num_get; # endif template > @@ -1042,9 +1042,9 @@ _InputIterator num_get<_CharT, _InputIterator>::do_get( return __b; } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI num_get; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI num_get; # endif struct _LIBCPP_EXPORTED_FROM_ABI __num_put_base { @@ -1160,9 +1160,9 @@ void __num_put<_CharT>::__widen_and_group_float( __op = __ob + (__np - __nb); } -extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put; +extern template struct _LIBCPP_EXPORTED_FROM_ABI __num_put; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template struct _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __num_put; +extern template struct _LIBCPP_EXPORTED_FROM_ABI __num_put; # endif template > @@ -1387,9 +1387,9 @@ num_put<_CharT, _OutputIterator>::do_put(iter_type __s, ios_base& __iob, char_ty return std::__pad_and_output(__s, __o, __op, __oe, __iob, __fl); } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI num_put; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS num_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI num_put; # endif template @@ -1923,9 +1923,9 @@ _InputIterator time_get<_CharT, _InputIterator>::do_get( return __b; } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_get; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_get; # endif class _LIBCPP_EXPORTED_FROM_ABI __time_get { @@ -2019,9 +2019,9 @@ private: _LIBCPP_HIDE_FROM_ABI_VIRTUAL const string_type& __X() const override { return this->__X_; } }; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_get_byname; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_get_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_get_byname; # endif class _LIBCPP_EXPORTED_FROM_ABI __time_put { @@ -2108,9 +2108,9 @@ _OutputIterator time_put<_CharT, _OutputIterator>::do_put( return std::copy(__nb, __ne, __s); } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_put; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_put; # endif template > @@ -2126,9 +2126,9 @@ protected: _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~time_put_byname() override {} }; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_put_byname; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS time_put_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI time_put_byname; # endif // money_base @@ -2192,11 +2192,11 @@ locale::id moneypunct<_CharT, _International>::id; template const bool moneypunct<_CharT, _International>::intl; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; # endif // moneypunct_byname @@ -2249,16 +2249,16 @@ template <> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname::init(const char*); template <> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname::init(const char*); -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; # if _LIBCPP_HAS_WIDE_CHARACTERS template <> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname::init(const char*); template <> _LIBCPP_EXPORTED_FROM_ABI void moneypunct_byname::init(const char*); -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS moneypunct_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; # endif // money_get @@ -2319,9 +2319,9 @@ void __money_get<_CharT>::__gather_info( } } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI __money_get; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI __money_get; # endif template > @@ -2633,9 +2633,9 @@ _InputIterator money_get<_CharT, _InputIterator>::do_get( return __b; } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI money_get; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_get; +extern template class _LIBCPP_EXPORTED_FROM_ABI money_get; # endif // money_put @@ -2811,9 +2811,9 @@ void __money_put<_CharT>::__format( __mi = __mb; } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI __money_put; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS __money_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI __money_put; # endif template > @@ -2957,9 +2957,9 @@ _OutputIterator money_put<_CharT, _OutputIterator>::do_put( return std::__pad_and_output(__s, __mb, __mi, __me, __iob, __fl); } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI money_put; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS money_put; +extern template class _LIBCPP_EXPORTED_FROM_ABI money_put; # endif // messages @@ -3042,9 +3042,9 @@ void messages<_CharT>::do_close(catalog __c) const { # endif // _LIBCPP_HAS_CATOPEN } -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages; +extern template class _LIBCPP_EXPORTED_FROM_ABI messages; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages; +extern template class _LIBCPP_EXPORTED_FROM_ABI messages; # endif template @@ -3061,9 +3061,9 @@ protected: _LIBCPP_HIDE_FROM_ABI_VIRTUAL ~messages_byname() override {} }; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI messages_byname; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS messages_byname; +extern template class _LIBCPP_EXPORTED_FROM_ABI messages_byname; # endif # if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_ENABLE_CXX26_REMOVED_WSTRING_CONVERT) diff --git a/libcxx/include/sstream b/libcxx/include/sstream index 5dcfb446a5d6a..f4e7de18b0a9e 100644 --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -1276,10 +1276,10 @@ swap(basic_stringstream<_CharT, _Traits, _Allocator>& __x, basic_stringstream<_C } # if _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringbuf; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_stringstream; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostringstream; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_istringstream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_stringbuf; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_stringstream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_ostringstream; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_istringstream; # endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/streambuf b/libcxx/include/streambuf index 3c4e9086e05ec..8d4bf8a252e1a 100644 --- a/libcxx/include/streambuf +++ b/libcxx/include/streambuf @@ -372,10 +372,10 @@ private: char_type* __eout_ = nullptr; }; -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_streambuf; # if _LIBCPP_HAS_WIDE_CHARACTERS -extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_streambuf; +extern template class _LIBCPP_EXPORTED_FROM_ABI basic_streambuf; # endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/src/ios.instantiations.cpp b/libcxx/src/ios.instantiations.cpp index a8d267f7cfd42..d4eb52e2ea39c 100644 --- a/libcxx/src/ios.instantiations.cpp +++ b/libcxx/src/ios.instantiations.cpp @@ -17,30 +17,30 @@ _LIBCPP_BEGIN_NAMESPACE_STD // Original explicit instantiations provided in the library -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ios; +template class _LIBCPP_EXPORTED_FROM_ABI basic_streambuf; +template class _LIBCPP_EXPORTED_FROM_ABI basic_istream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ostream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_iostream; #if _LIBCPP_HAS_WIDE_CHARACTERS -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ios; +template class _LIBCPP_EXPORTED_FROM_ABI basic_streambuf; +template class _LIBCPP_EXPORTED_FROM_ABI basic_istream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ostream; #endif // Additional instantiations added later. Whether programs rely on these being // available is protected by _LIBCPP_AVAILABILITY_HAS_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1. -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringbuf; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_stringstream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostringstream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istringstream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_stringbuf; +template class _LIBCPP_EXPORTED_FROM_ABI basic_stringstream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ostringstream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_istringstream; #if _LIBCPP_HAS_FILESYSTEM -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ifstream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ofstream; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_filebuf; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ifstream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_ofstream; +template class _LIBCPP_EXPORTED_FROM_ABI basic_filebuf; #endif // Add more here if needed... diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp index 9ea59a3a19ca4..88430119fafce 100644 --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -5660,71 +5660,71 @@ string __num_get<_CharT>::__stage2_int_prep(ios_base& __iob, _CharT* __atoms, _C return __np.grouping(); } -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS collate;) +template class _LIBCPP_EXPORTED_FROM_ABI collate; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI collate;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_get;) +template class _LIBCPP_EXPORTED_FROM_ABI num_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI num_get;) -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get; -_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_get;) +template struct _LIBCPP_EXPORTED_FROM_ABI __num_get; +_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_EXPORTED_FROM_ABI __num_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS num_put;) +template class _LIBCPP_EXPORTED_FROM_ABI num_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI num_put;) -template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put; -_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __num_put;) +template struct _LIBCPP_EXPORTED_FROM_ABI __num_put; +_LIBCPP_IF_WIDE_CHARACTERS(template struct _LIBCPP_EXPORTED_FROM_ABI __num_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get;) +template class _LIBCPP_EXPORTED_FROM_ABI time_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI time_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_get_byname;) +template class _LIBCPP_EXPORTED_FROM_ABI time_get_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI time_get_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put;) +template class _LIBCPP_EXPORTED_FROM_ABI time_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI time_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS time_put_byname;) +template class _LIBCPP_EXPORTED_FROM_ABI time_put_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI time_put_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct;) -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct;) +template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; +template class _LIBCPP_EXPORTED_FROM_ABI moneypunct; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI moneypunct;) +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI moneypunct;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname;) -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS moneypunct_byname;) +template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; +template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname;) +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI moneypunct_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_get;) +template class _LIBCPP_EXPORTED_FROM_ABI money_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI money_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_get;) +template class _LIBCPP_EXPORTED_FROM_ABI __money_get; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI __money_get;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS money_put;) +template class _LIBCPP_EXPORTED_FROM_ABI money_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI money_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS __money_put;) +template class _LIBCPP_EXPORTED_FROM_ABI __money_put; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI __money_put;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages;) +template class _LIBCPP_EXPORTED_FROM_ABI messages; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI messages;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname; -_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS messages_byname;) +template class _LIBCPP_EXPORTED_FROM_ABI messages_byname; +_LIBCPP_IF_WIDE_CHARACTERS(template class _LIBCPP_EXPORTED_FROM_ABI messages_byname;) -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; _LIBCPP_IF_WIDE_CHARACTERS( - template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname;) -template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS + template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname;) +template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; -template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS +template class _LIBCPP_DEPRECATED_IN_CXX20 _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; #if _LIBCPP_HAS_CHAR8_T -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; -template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS codecvt_byname; +template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; +template class _LIBCPP_EXPORTED_FROM_ABI codecvt_byname; #endif _LIBCPP_END_NAMESPACE_STD