public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Restore use of tr1::unordered_map in testsuite
@ 2019-10-22 21:47 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2019-10-22 21:47 UTC (permalink / raw)
  To: libstdc++, gcc-patches

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

My recent change to this file broke running the testsuite with
-std=c++98 because std::unordered_map isn't available. This fixes it.

	* testsuite/util/testsuite_abi.h: Restore use of tr1/unordered_map
	when compiled as C++98.

Tested x86_64-linux, committed to trunk.



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

commit 8ffc60659009bfca2152c6e3af846d8700393ece
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 22 22:45:42 2019 +0100

    Restore use of tr1::unordered_map in testsuite
    
    My recent change to this file broke running the testsuite with
    -std=c++98 because std::unordered_map isn't available. This fixes it.
    
            * testsuite/util/testsuite_abi.h: Restore use of tr1/unordered_map
            when compiled as C++98.

diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.h b/libstdc++-v3/testsuite/util/testsuite_abi.h
index 8f6a89e8739..4edf833bd59 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.h
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.h
@@ -22,7 +22,13 @@
 #include <stdexcept>
 #include <vector>
 #include <locale>
-#include <unordered_map>
+#if __cplusplus >= 201103L
+# include <unordered_map>
+namespace unord = std;
+#else
+# include <tr1/unordered_map>
+namespace unord = std::tr1;
+#endif
 #include <cxxabi.h>
 
 // Encapsulates symbol characteristics.
@@ -65,7 +71,7 @@ struct symbol
 };
 
 // Map type between symbol names and full symbol info.
-typedef std::unordered_map<std::string, symbol> 	symbols;
+typedef unord::unordered_map<std::string, symbol> 	symbols;
 
 
 // Check.

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

only message in thread, other threads:[~2019-10-22 21:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 21:47 [PATCH] Restore use of tr1::unordered_map in testsuite 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).