From 94857fa1a96a639ae089aa54d098540e76a4384d Mon Sep 17 00:00:00 2001 From: redi Date: Fri, 24 Aug 2018 17:43:18 +0000 Subject: [PATCH] Forward declare debug containers so std::pmr aliases work Prior to this change, including a header when _GLIBCXX_DEBUG is also defined would fail to compile in C++17 or later. The header would include the standard 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 after the inclusion of ). This adds declarations of the debug containers before including the non-Debug Mode 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263839 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 31 ++++++++++++++++ libstdc++-v3/include/debug/deque | 5 +++ libstdc++-v3/include/debug/forward_list | 5 +++ libstdc++-v3/include/debug/list | 5 +++ libstdc++-v3/include/debug/map | 8 +++++ libstdc++-v3/include/debug/set | 6 ++++ libstdc++-v3/include/debug/unordered_map | 10 ++++++ libstdc++-v3/include/debug/unordered_set | 7 ++++ libstdc++-v3/include/debug/vector | 5 +++ .../types/pmr_typedefs_debug.cc} | 39 +++++--------------- .../pmr_typedefs_debug.cc} | 39 +++++--------------- .../pmr_typedefs_debug.cc} | 39 +++++--------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 41 ++++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../pmr_typedefs_debug.cc} | 40 +++++---------------- .../vector/cons/destructible_debug_neg.cc | 2 +- .../pmr_typedefs_debug.cc} | 39 +++++--------------- 22 files changed, 188 insertions(+), 373 deletions(-) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => deque/types/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => forward_list/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => list/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => map/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => multimap/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => multiset/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => set/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => unordered_map/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => unordered_multimap/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => unordered_multiset/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/{vector/cons/destructible_debug_neg.cc => unordered_set/pmr_typedefs_debug.cc} (55%) copy libstdc++-v3/testsuite/23_containers/vector/{cons/destructible_debug_neg.cc => types/pmr_typedefs_debug.cc} (55%) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 53fbb8c5621..48a63667430 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,34 @@ +2018-08-24 Jonathan Wakely + + * 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 * testsuite/util/testsuite_allocator.h (__gnu_test::memory_resource): diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque index a6047dbed1b..ad86b5c8f38 100644 --- a/libstdc++-v3/include/debug/deque +++ b/libstdc++-v3/include/debug/deque @@ -31,6 +31,11 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template class deque; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/include/debug/forward_list b/libstdc++-v3/include/debug/forward_list index 840ed093302..e542447badd 100644 --- a/libstdc++-v3/include/debug/forward_list +++ b/libstdc++-v3/include/debug/forward_list @@ -31,6 +31,11 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template class forward_list; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list index e6df4dc3396..8add1d596e0 100644 --- a/libstdc++-v3/include/debug/list +++ b/libstdc++-v3/include/debug/list @@ -31,6 +31,11 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template class list; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/include/debug/map b/libstdc++-v3/include/debug/map index 8bd513b13d3..7151e8ee832 100644 --- a/libstdc++-v3/include/debug/map +++ b/libstdc++-v3/include/debug/map @@ -31,6 +31,14 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template + class map; + template + class multimap; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/include/debug/set b/libstdc++-v3/include/debug/set index 08806ca5475..f5d41a20334 100644 --- a/libstdc++-v3/include/debug/set +++ b/libstdc++-v3/include/debug/set @@ -31,6 +31,12 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template class set; + template class multiset; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map index 095a7521f04..e558f3957f7 100644 --- a/libstdc++-v3/include/debug/unordered_map +++ b/libstdc++-v3/include/debug/unordered_map @@ -34,6 +34,16 @@ #if __cplusplus < 201103L # include #else +# include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template + class unordered_map; + template + class unordered_multimap; +} } // namespace std::__debug + # include #include diff --git a/libstdc++-v3/include/debug/unordered_set b/libstdc++-v3/include/debug/unordered_set index ced9b1854d7..a883d3204b0 100644 --- a/libstdc++-v3/include/debug/unordered_set +++ b/libstdc++-v3/include/debug/unordered_set @@ -34,6 +34,13 @@ #if __cplusplus < 201103L # include #else +# include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template + class unordered_set; + template + class unordered_multiset; +} } // namespace std::__debug # include #include diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector index e8d0928c7c0..ff9f5f47c24 100644 --- a/libstdc++-v3/include/debug/vector +++ b/libstdc++-v3/include/debug/vector @@ -31,6 +31,11 @@ #pragma GCC system_header +#include +namespace std _GLIBCXX_VISIBILITY(default) { namespace __debug { + template class vector; +} } // namespace std::__debug + #include #include #include diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc index a3acaf420a4..85c725ad535 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/types/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,11 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::deque, + __gnu_debug::deque> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc index a3acaf420a4..410ed82deed 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/forward_list/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,11 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::forward_list, + __gnu_debug::forward_list> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc index a3acaf420a4..671c12e43d1 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,11 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::list, + __gnu_debug::list> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc index a3acaf420a4..e3978a1ec53 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/map/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::map, + __gnu_debug::map, + std::pmr::polymorphic_allocator>> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc index a3acaf420a4..cbd4d95176a 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/multimap/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::multimap, + __gnu_debug::multimap, + std::pmr::polymorphic_allocator>> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc index a3acaf420a4..d8ff08d04b5 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/multiset/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::multiset, + __gnu_debug::multiset, + std::pmr::polymorphic_allocator> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc index a3acaf420a4..f44f68a49a4 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/set/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::set, + __gnu_debug::set, + std::pmr::polymorphic_allocator> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc index a3acaf420a4..2c423bc79e2 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::unordered_map, + __gnu_debug::unordered_map, std::equal_to, + std::pmr::polymorphic_allocator>> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc index a3acaf420a4..30ae2a732b6 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,13 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::unordered_multimap, + __gnu_debug::unordered_multimap, + std::equal_to, + std::pmr::polymorphic_allocator>> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc index a3acaf420a4..5f0ed27a1d0 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::unordered_multiset, + __gnu_debug::unordered_multiset, std::equal_to, + std::pmr::polymorphic_allocator> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc index a3acaf420a4..73ad1e0f01f 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,12 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::unordered_set, + __gnu_debug::unordered_set, std::equal_to, + std::pmr::polymorphic_allocator> + >); diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc index a3acaf420a4..587c67fe936 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc @@ -45,4 +45,4 @@ test02() // { dg-error "value type is destructible" "" { target *-*-* } 0 } // In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +// { dg-error "required from here" "" { target *-*-* } 163 } diff --git a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc similarity index 55% copy from libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc copy to libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc index a3acaf420a4..f0da4ca511f 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/cons/destructible_debug_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/types/pmr_typedefs_debug.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2018 Free Software Foundation, Inc. +// 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 @@ -15,34 +15,11 @@ // with this library; see the file COPYING3. If not see // . -// { dg-options "-D_GLIBCXX_DEBUG" } -// { dg-do compile { target c++11 } } +// { dg-options "-std=gnu++17 -D_GLIBCXX_DEBUG" } +// { dg-do compile { target c++17 } } -#include - -// PR libstdc++/80553 - -struct DeletedDtor { - ~DeletedDtor() = delete; -}; - -class PrivateDtor { - ~PrivateDtor() { } -}; - -void -test01() -{ - std::vector v; -} - -void -test02() -{ - std::vector v; -} - -// { dg-error "value type is destructible" "" { target *-*-* } 0 } - -// In Debug Mode the "required from here" errors come from -// { dg-error "required from here" "" { target *-*-* } 158 } +#include +static_assert(std::is_same_v< + std::pmr::vector, + __gnu_debug::vector> + >); -- 2.11.4.GIT