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)
commit9ca2ac699ab2eee4ef6a2904426fa38f58af5a0b
tree249a4e4031c0f5bb629ba4f9e37eb943d1b6bd78
parent3413d168824e022555c8246095dfdea297b4c4cc
Forward declare debug containers so std::pmr aliases work

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]