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.

commit 60fa713a0ceae1af80a26a7e459c1215e6eb0adc
Author: Jonathan Wakely <jwak...@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

Reply via email to