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

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

I see no reason to use tr1::unordered_map unless we have to (because
we're compiling a test in C++98 mode).

	* testsuite/util/testsuite_abi.h: Use std::unordered_map instead of
	std::tr1::unordered_map.
	* testsuite/util/testsuite_allocator.h: Likewise.

Tested x86_64-linux, committed to trunk.


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

commit 60fa713a0ceae1af80a26a7e459c1215e6eb0adc
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Oct 4 14:21:31 2019 +0100

    Replace uses of std::tr1::unordered_map in testsuite
    
            * testsuite/util/testsuite_abi.h: Use std::unordered_map instead of
            std::tr1::unordered_map.
            * testsuite/util/testsuite_allocator.h: Likewise.

diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.h b/libstdc++-v3/testsuite/util/testsuite_abi.h
index 47fbd76bb96..8f6a89e8739 100644
--- a/libstdc++-v3/testsuite/util/testsuite_abi.h
+++ b/libstdc++-v3/testsuite/util/testsuite_abi.h
@@ -22,7 +22,7 @@
 #include <stdexcept>
 #include <vector>
 #include <locale>
-#include <tr1/unordered_map>
+#include <unordered_map>
 #include <cxxabi.h>
 
 // Encapsulates symbol characteristics.
@@ -65,7 +65,7 @@ struct symbol
 };
 
 // Map type between symbol names and full symbol info.
-typedef std::tr1::unordered_map<std::string, symbol> 	symbols;
+typedef std::unordered_map<std::string, symbol> 	symbols;
 
 
 // Check.
diff --git a/libstdc++-v3/testsuite/util/testsuite_allocator.h b/libstdc++-v3/testsuite/util/testsuite_allocator.h
index 34dba16669f..67e70a29edb 100644
--- a/libstdc++-v3/testsuite/util/testsuite_allocator.h
+++ b/libstdc++-v3/testsuite/util/testsuite_allocator.h
@@ -26,7 +26,6 @@
 #ifndef _GLIBCXX_TESTSUITE_ALLOCATOR_H
 #define _GLIBCXX_TESTSUITE_ALLOCATOR_H
 
-#include <tr1/unordered_map>
 #include <bits/move.h>
 #include <ext/pointer.h>
 #include <ext/alloc_traits.h>
@@ -36,6 +35,14 @@
 # include <new>
 #endif
 
+#if __cplusplus >= 201103L
+# include <unordered_map>
+namespace unord = std;
+#else
+# include <tr1/unordered_map>
+namespace unord = std::tr1;
+#endif
+
 namespace __gnu_test
 {
   class tracker_allocator_counter
@@ -269,7 +276,7 @@ namespace __gnu_test
   // (see N1599).
   struct uneq_allocator_base
   {
-    typedef std::tr1::unordered_map<void*, int>   map_type;
+    typedef unord::unordered_map<void*, int>   map_type;
 
     // Avoid static initialization troubles and/or bad interactions
     // with tests linking testsuite_allocator.o and playing globally

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

only message in thread, other threads:[~2019-10-04 15:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-04 15:06 [PATCH] Replace uses of std::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).