public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Disable std::string and std::wstring extern templates for C++17
@ 2016-08-01 16:06 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2016-08-01 16:06 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 636 bytes --]

As I mentioned last week, the explicit instantiation definitions for
std::string and std::wstring are compiled as C++11, so do not
instantiate the new member functions added for C++17.

Rather than change what we instantiate and export from the library I'd
prefer to suppress the explicit instantiation declarations for C++17.
Once C++17 is stable and we know which new symbols are needed we can
decide whether to change how we compile the instantiations, and add
new exports to the linker script.

	* include/bits/basic_string.tcc: Disable explicit instantiation
	declarations for C++17.

Tested powerpc64-linux, committed to trunk.



[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 904 bytes --]

commit 248b39f993ea5f1fcc9668e38b7683e58c0facb8
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Aug 1 16:28:09 2016 +0100

    Disable std::string and std::wstring extern templates for C++17
    
    	* include/bits/basic_string.tcc: Disable explicit instantiation
    	declarations for C++17.

diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index 2b6644d..0560b46 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -1569,7 +1569,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   // Inhibit implicit instantiations for required instantiations,
   // which are defined via explicit instantiations elsewhere.
-#if _GLIBCXX_EXTERN_TEMPLATE > 0
+#if _GLIBCXX_EXTERN_TEMPLATE > 0 && __cplusplus <= 201402L
   extern template class basic_string<char>;
   extern template
     basic_istream<char>&

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-01 16:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-01 16:06 [PATCH] Disable std::string and std::wstring extern templates for C++17 Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).