Restore use of tr1::unordered_map in testsuite
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Oct 2019 21:48:57 +0000 (22:48 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 22 Oct 2019 21:48:57 +0000 (22:48 +0100)
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.

From-SVN: r277302

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/util/testsuite_abi.h

index 6ffe6fa12b5b56f98696aac0b3524d1d526bce39..87ee636ceb873fcf03c2406284d1a19772c1c6d9 100644 (file)
@@ -1,5 +1,8 @@
 2019-10-22  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/util/testsuite_abi.h: Restore use of tr1/unordered_map
+       when compiled as C++98.
+
        * include/bits/memoryfwd.h (uses_allocator): Do not declare for C++98.
        * testsuite/17_intro/names.cc: Check uses_allocator in C++98.
 
index 8f6a89e873986313ef15326f8e3aed58226f6d67..4edf833bd593c43d7437319de8a8fdd82fea71f1 100644 (file)
 #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.