Forward declare debug containers so std::pmr aliases work
authorJonathan Wakely <jwakely@redhat.com>
Fri, 24 Aug 2018 17:43:18 +0000 (18:43 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 24 Aug 2018 17:43:18 +0000 (18:43 +0100)
Prior to this change, including a <debug/xxx> header when _GLIBCXX_DEBUG
is also defined would fail to compile in C++17 or later. The <debug/xxx>
header would include the standard <xxx> header which defined
std::pmr::xxx as an alias for std::xxx. But in Debug Mode std::xxx
refers to std::__debug::xxx which has not been defined yet (because it
is in <debug/xxx> after the inclusion of <xxx>).

This adds declarations of the debug containers before including the
non-Debug Mode <xxx> header, so that the std::pmr::xxx aliases work.

* include/debug/deque (std::__debug::deque): Declare.
* include/debug/forward_list (std::__debug::forward_list): Declare.
* include/debug/list (std::__debug::list): Declare.
* include/debug/map (std::__debug::map): Declare.
* include/debug/set (std::__debug::set): Declare.
* include/debug/unordered_map (std::__debug::unordered_map): Declare.
* include/debug/unordered_set (std::__debug::unordered_set): Declare.
* include/debug/vector (std::__debug::vector): Declare.
* testsuite/23_containers/deque/types/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/forward_list/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/list/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/map/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/multimap/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/multiset/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/set/pmr_typedefs_debug.cc: New test.
* testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc:
New test.
* testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc:
New test.
* testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc: New
test.
* testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
Adjust dg-error lineno.
* testsuite/23_containers/vector/types/pmr_typedefs_debug.cc: New
test.

From-SVN: r263839

22 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/include/debug/deque
libstdc++-v3/include/debug/forward_list
libstdc++-v3/include/debug/list
libstdc++-v3/include/debug/map
libstdc++-v3/include/debug/set
libstdc++-v3/include/debug/unordered_map
libstdc++-v3/include/debug/unordered_set
libstdc++-v3/include/debug/vector
libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc [new file with mode: 0644]
libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc
libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc [new file with mode: 0644]

index 53fbb8c56217dad86baa9aa1c0482b7ba190bf96..48a63667430279c280e6e12161fa533f1d79005f 100644 (file)
@@ -1,3 +1,34 @@
+2018-08-24  Jonathan Wakely  <jwakely@redhat.com>
+
+       * include/debug/deque (std::__debug::deque): Declare.
+       * include/debug/forward_list (std::__debug::forward_list): Declare.
+       * include/debug/list (std::__debug::list): Declare.
+       * include/debug/map (std::__debug::map): Declare.
+       * include/debug/set (std::__debug::set): Declare.
+       * include/debug/unordered_map (std::__debug::unordered_map): Declare.
+       * include/debug/unordered_set (std::__debug::unordered_set): Declare.
+       * include/debug/vector (std::__debug::vector): Declare.
+       * testsuite/23_containers/deque/types/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/forward_list/pmr_typedefs_debug.cc: New
+       test.
+       * testsuite/23_containers/list/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/map/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/multimap/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/multiset/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/set/pmr_typedefs_debug.cc: New test.
+       * testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc: New
+       test.
+       * testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc:
+       New test.
+       * testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc:
+       New test.
+       * testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc: New
+       test.
+       * testsuite/23_containers/vector/cons/destructible_debug_neg.cc:
+       Adjust dg-error lineno.
+       * testsuite/23_containers/vector/types/pmr_typedefs_debug.cc: New
+       test.
+
 2018-08-23  Jonathan Wakely  <jwakely@redhat.com>
 
        * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource):
index a6047dbed1b69329fa1afedd6ccb106566eef362..ad86b5c8f384cb2a602f9c6eacf84be517541861 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Tp, typename _Allocator> class deque;
+} } // namespace std::__debug
+
 #include <deque>
 #include <debug/safe_sequence.h>
 #include <debug/safe_container.h>
index 840ed093302a817d9705877e6b34ac05f896ab20..e542447badd8b59811ead1335585b1608cba0df8 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Tp, typename _Allocator> class forward_list;
+} } // namespace std::__debug
+
 #include <forward_list>
 #include <debug/safe_sequence.h>
 #include <debug/safe_container.h>
index e6df4dc3396ea5e8c8b82fa4372df2de866fc60e..8add1d596e06ae53bf0f0d636303ae67f7549e53 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Tp, typename _Allocator> class list;
+} } // namespace std::__debug
+
 #include <list>
 #include <debug/safe_sequence.h>
 #include <debug/safe_container.h>
index 8bd513b13d339e6a6576d1e21fd01f92d496aee8..7151e8ee832a6fc85dff56bbaeaa6100e103b84d 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Key, typename _Tp, typename _Cmp, typename _Allocator>
+    class map;
+  template<typename _Key, typename _Tp, typename _Cmp, typename _Allocator>
+    class multimap;
+} } // namespace std::__debug
+
 #include <map>
 #include <debug/map.h>
 #include <debug/multimap.h>
index 08806ca54757f2617fedc35989d285ee51bd0063..f5d41a203346841c29fa2bc00e3a1a8de83d3be0 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Key, typename _Cmp, typename _Allocator> class set;
+  template<typename _Key, typename _Cmp, typename _Allocator> class multiset;
+} } // namespace std::__debug
+
 #include <set>
 #include <debug/set.h>
 #include <debug/multiset.h>
index 095a7521f045a951282bd448f3e95cdedc4c90db..e558f3957f7023f7aaeebf1bdee734cd7e0a0364 100644 (file)
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
+# include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Key, typename _Tp, typename _Hash, typename _Pred,
+          typename _Allocator>
+    class unordered_map;
+  template<typename _Key, typename _Tp, typename _Hash, typename _Pred,
+          typename _Allocator>
+    class unordered_multimap;
+} } // namespace std::__debug
+
 # include <unordered_map>
 
 #include <debug/safe_unordered_container.h>
index ced9b1854d717545ef83ac1dbca84dedbb8a81dc..a883d3204b04f87715ed19105eba2cb83961946a 100644 (file)
 #if __cplusplus < 201103L
 # include <bits/c++0x_warning.h>
 #else
+# include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Key, typename _Hash, typename _Pred, typename _Allocator>
+    class unordered_set;
+  template<typename _Key, typename _Hash, typename _Pred, typename _Allocator>
+    class unordered_multiset;
+} } // namespace std::__debug
 # include <unordered_set>
 
 #include <debug/safe_unordered_container.h>
index e8d0928c7c07d26f704baf17cafd2d43d1b794ea..ff9f5f47c24c25754264ed6f147199e70f42d2fb 100644 (file)
 
 #pragma GCC system_header
 
+#include <bits/c++config.h>
+namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug {
+  template<typename _Tp, typename _Allocator> class vector;
+} } // namespace std::__debug
+
 #include <vector>
 #include <utility>
 #include <debug/safe_sequence.h>
diff --git a/libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..85c725a
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/deque>
+static_assert(std::is_same_v<
+    std::pmr::deque<int>,
+    __gnu_debug::deque<int, std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..410ed82
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/forward_list>
+static_assert(std::is_same_v<
+    std::pmr::forward_list<int>,
+    __gnu_debug::forward_list<int, std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..671c12e
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/list>
+static_assert(std::is_same_v<
+    std::pmr::list<int>,
+    __gnu_debug::list<int, std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..e3978a1
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/map>
+static_assert(std::is_same_v<
+    std::pmr::map<int, int>,
+    __gnu_debug::map<int, int, std::less<int>,
+      std::pmr::polymorphic_allocator<std::pair<const int, int>>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..cbd4d95
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/map>
+static_assert(std::is_same_v<
+    std::pmr::multimap<int, int>,
+    __gnu_debug::multimap<int, int, std::less<int>,
+      std::pmr::polymorphic_allocator<std::pair<const int, int>>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..d8ff08d
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/set>
+static_assert(std::is_same_v<
+    std::pmr::multiset<int>,
+    __gnu_debug::multiset<int, std::less<int>,
+      std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..f44f68a
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/set>
+static_assert(std::is_same_v<
+    std::pmr::set<int>,
+    __gnu_debug::set<int, std::less<int>,
+      std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..2c423bc
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/unordered_map>
+static_assert(std::is_same_v<
+    std::pmr::unordered_map<int, int>,
+    __gnu_debug::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
+      std::pmr::polymorphic_allocator<std::pair<const int, int>>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..30ae2a7
--- /dev/null
@@ -0,0 +1,27 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/unordered_map>
+static_assert(std::is_same_v<
+    std::pmr::unordered_multimap<int, int>,
+    __gnu_debug::unordered_multimap<int, int, std::hash<int>,
+      std::equal_to<int>,
+      std::pmr::polymorphic_allocator<std::pair<const int, int>>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..5f0ed27
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/unordered_set>
+static_assert(std::is_same_v<
+    std::pmr::unordered_multiset<int>,
+    __gnu_debug::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
+      std::pmr::polymorphic_allocator<int>>
+    >);
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..73ad1e0
--- /dev/null
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/unordered_set>
+static_assert(std::is_same_v<
+    std::pmr::unordered_set<int>,
+    __gnu_debug::unordered_set<int, std::hash<int>, std::equal_to<int>,
+      std::pmr::polymorphic_allocator<int>>
+    >);
index a3acaf420a4b23d5aee11fac60ca7bb52bc37d10..587c67fe9366a2762475af435a8a54ff674c0303 100644 (file)
@@ -45,4 +45,4 @@ test02()
 // { dg-error "value type is destructible" "" { target *-*-* } 0 }
 
 // In Debug Mode the "required from here" errors come from <debug/vector>
-// { dg-error "required from here" "" { target *-*-* } 158 }
+// { dg-error "required from here" "" { target *-*-* } 163 }
diff --git a/libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc b/libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc
new file mode 100644 (file)
index 0000000..f0da4ca
--- /dev/null
@@ -0,0 +1,25 @@
+// Copyright (C) 2018 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library.  This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING3.  If not see
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" }
+// { dg-do compile { target c++17 } }
+
+#include <debug/vector>
+static_assert(std::is_same_v<
+    std::pmr::vector<int>,
+    __gnu_debug::vector<int, std::pmr::polymorphic_allocator<int>>
+    >);