Skip to content

Commit 98c7630

Browse files
committed
[LIBCXX] std::ostream::sentry should be exported
for testing by CI. std::istream::sentry is left original to ensure test detects this defect.
1 parent 827e89b commit 98c7630

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libcxx/include/__ostream/basic_ostream.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,12 @@ basic_ostream<char, _Traits>& operator<<(basic_ostream<char, _Traits>&, const ch
665665

666666
# endif // _LIBCPP_STD_VER >= 20
667667

668+
extern template _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>::sentry::sentry(basic_ostream<char>& __os);
669+
extern template _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>::sentry::~sentry();
668670
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<char>;
669671
# if _LIBCPP_HAS_WIDE_CHARACTERS
672+
extern template _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>::sentry::sentry(basic_ostream<wchar_t>& __os);
673+
extern template _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>::sentry::~sentry();
670674
extern template class _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS basic_ostream<wchar_t>;
671675
# endif
672676

libcxx/src/ios.instantiations.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,21 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<char>;
2121
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<char>;
2222
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<char>;
23+
#ifdef _MSC_VER
24+
template _LIBCPP_EXPORTED_FROM_ABI basic_ostream<char>::sentry::sentry(basic_ostream<char>& __os);
25+
template _LIBCPP_EXPORTED_FROM_ABI basic_ostream<char>::sentry::~sentry();
26+
#endif
2327
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<char>;
2428
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_iostream<char>;
2529

2630
#if _LIBCPP_HAS_WIDE_CHARACTERS
2731
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ios<wchar_t>;
2832
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_streambuf<wchar_t>;
2933
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_istream<wchar_t>;
34+
#ifdef _MSC_VER
35+
template _LIBCPP_EXPORTED_FROM_ABI basic_ostream<wchar_t>::sentry::sentry(basic_ostream<wchar_t>& __os);
36+
template _LIBCPP_EXPORTED_FROM_ABI basic_ostream<wchar_t>::sentry::~sentry();
37+
#endif
3038
template class _LIBCPP_CLASS_TEMPLATE_INSTANTIATION_VIS basic_ostream<wchar_t>;
3139
#endif
3240

0 commit comments

Comments
 (0)