+2018-06-27 Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/86138
+ * include/bits/basic_string.tcc: [_GLIBCXX_EXTERN_TEMPLATE < 0]
+ Declare explicit instantiations of COW empty reps and I/O functions.
+
2018-06-26 David Edelsohn <dje.gcc@gmail.com>
* testsuite/experimental/algorithm/sample-2.cc: Add TLS DejaGNU
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
-#if _GLIBCXX_EXTERN_TEMPLATE > 0
+#if _GLIBCXX_EXTERN_TEMPLATE
// The explicit instantiations definitions in src/c++11/string-inst.cc
// are compiled as C++14, so the new C++17 members aren't instantiated.
// Until those definitions are compiled as C++17 suppress the declaration,
// so C++17 code will implicitly instantiate std::string and std::wstring
// as needed.
-# if __cplusplus <= 201402L
+# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
extern template class basic_string<char>;
# elif ! _GLIBCXX_USE_CXX11_ABI
// Still need to prevent implicit instantiation of the COW empty rep,
getline(basic_istream<char>&, string&);
#ifdef _GLIBCXX_USE_WCHAR_T
-# if __cplusplus <= 201402L
+# if __cplusplus <= 201402L && _GLIBCXX_EXTERN_TEMPLATE > 0
extern template class basic_string<wchar_t>;
# elif ! _GLIBCXX_USE_CXX11_ABI
extern template basic_string<wchar_t>::size_type
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
#endif // _GLIBCXX_USE_WCHAR_T
-#endif // _GLIBCXX_EXTERN_TEMPLATE > 0
+#endif // _GLIBCXX_EXTERN_TEMPLATE
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std