This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Enforce allocator::value_type consistency for containers in C++2a


On 03/06/19 14:23 +0100, Jonathan Wakely wrote:
In previous standards it is undefined for a container and its allocator
to have a different value_type. Libstdc++ has traditionally allowed it
as an extension, automatically rebinding the allocator to the
container's value_type. Since GCC 8.1 that extension has been disabled
for C++11 and later when __STRICT_ANSI__ is defined (i.e. for
-std=c++11, -std=c++14, -std=c++17 and -std=c++2a).

Since the acceptance of P1463R1 into the C++2a draft an incorrect
allocator::value_type now requires a diagnostic. This patch implements
that by enabling the static_assert for -std=gnu++2a as well.

	* doc/xml/manual/status_cxx2020.xml: Document P1463R1 status.
	* include/bits/forward_list.h [__cplusplus > 201703]: Enable
	allocator::value_type assertion for C++2a.
	* include/bits/hashtable.h: Likewise.
	* include/bits/stl_deque.h: Likewise.
	* include/bits/stl_list.h: Likewise.
	* include/bits/stl_map.h: Likewise.
	* include/bits/stl_multimap.h: Likewise.
	* include/bits/stl_multiset.h: Likewise.
	* include/bits/stl_set.h: Likewise.
	* include/bits/stl_vector.h: Likewise.
	* testsuite/23_containers/deque/48101-3_neg.cc: New test.
	* testsuite/23_containers/forward_list/48101-3_neg.cc: New test.
	* testsuite/23_containers/list/48101-3_neg.cc: New test.
	* testsuite/23_containers/map/48101-3_neg.cc: New test.
	* testsuite/23_containers/multimap/48101-3_neg.cc: New test.
	* testsuite/23_containers/multiset/48101-3_neg.cc: New test.
	* testsuite/23_containers/set/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_map/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_multimap/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_multiset/48101-3_neg.cc: New test.
	* testsuite/23_containers/unordered_set/48101-3_neg.cc: New test.
	* testsuite/23_containers/vector/48101-3_neg.cc: New test.

The tests for this extension now fail when run with -std=gnu++2a. This
fixes them. Tested x86_64-linux with various -std options. Committed
to trunk.


commit a0791bda52523601ffd7208d59947460b8853773
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Jun 6 14:27:31 2019 +0100

    Fix tests that fail in C++2a mode
    
    The GNU extension that allows using the wrong allocator type with a
    container is disabled for C++2a mode, because the standard now requires
    a diagnostic. Fix the tests that fail when -std=gnu++2a is used.
    
    Also remove some reundant tests that are duplicates of another test
    except for a target specifier of c++11. Those tests previously set
    -std=gnu++11 explicitly but that was replaced globally with a target
    specifier. These tests existed to verify that explicit instantiation
    worked for both C++98 and C++11 modes, but now do nothing because both
    copies of the test use -std=gnu++14 by default. Instead of duplicating
    the test we should be regularly running the whole testsuite with
    different -std options.
    
            * testsuite/23_containers/deque/requirements/explicit_instantiation/
            1_c++0x.cc: Remove redundant test.
            * testsuite/23_containers/deque/requirements/explicit_instantiation/
            2.cc: Use target selector instead of preprocessor condition.
            * testsuite/23_containers/deque/requirements/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/forward_list/requirements/
            explicit_instantiation/3.cc: Likewise.
            * testsuite/23_containers/forward_list/requirements/
            explicit_instantiation/5.cc: Do not test allocator rebinding extension
            for C++2a.
            * testsuite/23_containers/list/requirements/explicit_instantiation/
            1_c++0x.cc: Remove redundant test.
            * testsuite/23_containers/list/requirements/explicit_instantiation/
            2.cc: Use target selector instead of preprocessor condition.
            * testsuite/23_containers/list/requirements/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/list/requirements/explicit_instantiation/
            5.cc: Do not test allocator rebinding extension for C++2a.
            * testsuite/23_containers/map/requirements/explicit_instantiation/
            1_c++0x.cc: Remove redundant test.
            * testsuite/23_containers/map/requirements/explicit_instantiation/
            2.cc: Adjust comment.
            * testsuite/23_containers/map/requirements/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/map/requirements/explicit_instantiation/
            5.cc: Do not test allocator rebinding extension for C++2a.
            * testsuite/23_containers/multimap/requirements/explicit_instantiation/
            1_c++0x.cc: Remove redundant test.
            * testsuite/23_containers/multimap/requirements/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/multimap/requirements/explicit_instantiation/
            5.cc: Do not test allocator rebinding extension for C++2a.
            * testsuite/23_containers/multiset/requirements/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/multiset/requirements/explicit_instantiation/
            5.cc: Do not test allocator rebinding extension for C++2a.
            * testsuite/23_containers/set/requirements/explicit_instantiation/3.cc:
            Do not run test for C++2a.
            * testsuite/23_containers/set/requirements/explicit_instantiation/
            1_c++0x.cc: Remove redundant test.
            * testsuite/23_containers/set/requirements/explicit_instantiation/5.cc:
            Do not test allocator rebinding extension for C++2a.
            * testsuite/23_containers/unordered_map/requirements/
            explicit_instantiation/3.cc: Likewise.
            * testsuite/23_containers/unordered_map/requirements/
            explicit_instantiation/5.cc: Do not test allocator rebinding extension
            for C++2a.
            * testsuite/23_containers/unordered_multimap/requirements/
            explicit_instantiation/3.cc: Do not run test for C++2a.
            * testsuite/23_containers/unordered_multimap/requirements/
            explicit_instantiation/5.cc: Do not test allocator rebinding extension
            for C++2a.
            * testsuite/23_containers/unordered_multiset/requirements/
            explicit_instantiation/3.cc: Do not run test for C++2a.
            * testsuite/23_containers/unordered_multiset/requirements/
            explicit_instantiation/5.cc: Do not test allocator rebinding extension
            for C++2a.
            * testsuite/23_containers/unordered_set/requirements/
            explicit_instantiation/3.cc: Do not run test for C++2a.
            * testsuite/23_containers/unordered_set/requirements/
            explicit_instantiation/5.cc: Do not test allocator rebinding extension
            for C++2a.
            * testsuite/23_containers/vector/ext_pointer/explicit_instantiation/
            2.cc: Remove redundant test.
            * testsuite/23_containers/vector/ext_pointer/explicit_instantiation/
            3.cc: Do not run test for C++2a.
            * testsuite/23_containers/vector/requirements/explicit_instantiation/
            3.cc: Likewise.

diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/1_c++0x.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/1_c++0x.cc
deleted file mode 100644
index 83dba98e2ac..00000000000
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/1_c++0x.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// { dg-do compile { target c++11 } }
-
-// Copyright (C) 2009-2019 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/>.
-
-// This file tests explicit instantiation of library containers
-
-#include <deque>
-
-template class std::deque<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/2.cc
index bbd84a53318..c8f8b7985b8 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/2.cc
@@ -21,10 +21,8 @@
 #include <deque>
 #include <testsuite_api.h>
 
-// { dg-do compile }
+// { dg-do compile { target c++98_only } }
 
-// N.B. In C++0x mode we cannot instantiate with T == NonDefaultConstructible
-// because of 23.3.2.1.4
-#if __cplusplus < 201103L
+// N.B. Since C++11 we cannot instantiate with T == NonDefaultConstructible
+// because of [deque.cons] p4: "Requires: T shall be DefaultConstructible."
 template class std::deque<__gnu_test::NonDefaultConstructible>;
-#endif
diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/3.cc
index f6fd591f9d0..0ae076876a8 100644
--- a/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <deque>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::deque<int, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc
index 0410d7ed4cf..037fc60a21b 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/3.cc
@@ -22,7 +22,8 @@
 #include <forward_list>
 
 // { dg-do compile { target c++11 } }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::forward_list<int, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc
index fff2e00ae27..0ad9df9ce8d 100644
--- a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/explicit_instantiation/5.cc
@@ -25,6 +25,6 @@
 
 // libstdc++/50118
 template class std::forward_list<int, __gnu_test::ExplicitConsAlloc<int>>;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::forward_list<int, __gnu_test::ExplicitConsAlloc<char>>;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/1_c++0x.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/1_c++0x.cc
deleted file mode 100644
index 830ceec84d3..00000000000
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/1_c++0x.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// { dg-do compile { target c++11 } }
-
-// Copyright (C) 2009-2019 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/>.
-
-// This file tests explicit instantiation of library containers
-
-#include <list>
-
-template class std::list<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/2.cc
index 8b279df0623..35818d98721 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/2.cc
@@ -21,10 +21,8 @@
 #include <list>
 #include <testsuite_api.h>
 
-// { dg-do compile }
+// { dg-do compile { target c++98_only } }
 
-// N.B. In C++0x mode we cannot instantiate with T == NonDefaultConstructible
-// because of 23.3.4.1.4
-#if __cplusplus < 201103L
+// N.B. Since C++11 we cannot instantiate with T == NonDefaultConstructible
+// because of [list.cons] p4: "Requires: T shall be DefaultConstructible."
 template class std::list<__gnu_test::NonDefaultConstructible>;
-#endif
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/3.cc
index 818d20f2654..e40e9b2ec97 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <list>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::list<int, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc
index b469fa6a801..82107199df4 100644
--- a/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/5.cc
@@ -24,6 +24,6 @@
 
 // libstdc++/50118
 template class std::list<int, __gnu_test::ExplicitConsAlloc<int> >;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::list<int, __gnu_test::ExplicitConsAlloc<char> >;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/1_c++0x.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/1_c++0x.cc
deleted file mode 100644
index ea902794fca..00000000000
--- a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/1_c++0x.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// { dg-do compile { target c++11 } }
-
-// Copyright (C) 2009-2019 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/>.
-
-// This file tests explicit instantiation of library containers
-
-#include <map>
-
-template class std::map<int, double>;
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/2.cc
index b887697d6f7..6ce727fd9eb 100644
--- a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/2.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/2.cc
@@ -25,5 +25,5 @@
 // { dg-do compile }
 
 // N.B. We cannot instantiate with T == NonDefaultConstructible
-// because of 23.3.1.2.
+// because of [map.access] p2: "mapped_type shall be DefaultConstructible."
 template class std::map<__gnu_test::NonDefaultConstructible, double>;
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/3.cc
index 23b31019b72..8e58ba7e43d 100644
--- a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <map>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::map<int, double, std::less<int>, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc
index 0076bb6f9f4..1793bb08ecb 100644
--- a/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/5.cc
@@ -27,7 +27,7 @@ using __gnu_test::ExplicitConsAlloc;
 // libstdc++/50118
 template class std::map<int, int, std::less<int>,
 			ExplicitConsAlloc<std::pair<const int, int> > >;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::map<int, int, std::less<int>,
 			ExplicitConsAlloc<char> >;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/1_c++0x.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/1_c++0x.cc
deleted file mode 100644
index 8e1261a63d9..00000000000
--- a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/1_c++0x.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// { dg-do compile { target c++11 } }
-
-// Copyright (C) 2009-2019 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/>.
-
-// This file tests explicit instantiation of library containers
-
-#include <map>
-
-template class std::multimap<int, double>;
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/3.cc
index 19f9ea43fdb..8b828163e17 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <map>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::multimap<int, double, std::less<int>, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc
index 4d97d62cdc8..fb7784550e7 100644
--- a/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/5.cc
@@ -27,7 +27,7 @@ using __gnu_test::ExplicitConsAlloc;
 // libstdc++/50118
 template class std::multimap<int, int, std::less<int>,
 			     ExplicitConsAlloc<std::pair<const int, int> > >;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::multimap<int, int, std::less<int>,
 			     ExplicitConsAlloc<char> >;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/3.cc
index f42ef24569d..d6e4b7f3060 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <set>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::multiset<int, std::less<int>, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc
index 6716556ea84..899055ba385 100644
--- a/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/explicit_instantiation/5.cc
@@ -25,7 +25,7 @@
 // libstdc++/50118
 template class std::multiset<int, std::less<int>,
 			     __gnu_test::ExplicitConsAlloc<int> >;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::multiset<int, std::less<int>,
 			     __gnu_test::ExplicitConsAlloc<char> >;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/1_c++0x.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/1_c++0x.cc
deleted file mode 100644
index e053f8db420..00000000000
--- a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/1_c++0x.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-// { dg-do compile { target c++11 } }
-
-// Copyright (C) 2009-2019 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/>.
-
-// This file tests explicit instantiation of library containers
-
-#include <set>
-
-template class std::set<int>;
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/3.cc
index ff14e9163a2..2e8a80e58a0 100644
--- a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <set>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::set<int, std::less<int>, std::allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc
index d504443c806..a05c2f856ec 100644
--- a/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/5.cc
@@ -25,7 +25,7 @@
 // libstdc++/50118
 template class std::set<int, std::less<int>,
 			__gnu_test::ExplicitConsAlloc<int> >;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::set<int, std::less<int>,
 			__gnu_test::ExplicitConsAlloc<char> >;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
index 8939d5713b4..bfcb046ae7a 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/3.cc
@@ -1,5 +1,6 @@
 // { dg-do compile { target c++11 } }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // Copyright (C) 2007-2019 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc
index cc4f8473b23..ee91d16804d 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/explicit_instantiation/5.cc
@@ -28,7 +28,7 @@ using __gnu_test::ExplicitConsAlloc;
 // libstdc++/50118
 template class std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
 				  ExplicitConsAlloc<std::pair<const int, int>>>;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::unordered_map<int, int, std::hash<int>, std::equal_to<int>,
 				  ExplicitConsAlloc<char>>;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
index faec6aec74c..101449c915b 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/3.cc
@@ -1,5 +1,6 @@
 // { dg-do compile { target c++11 } }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // Copyright (C) 2007-2019 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc
index 885ab2212d6..0a5848b0087 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/explicit_instantiation/5.cc
@@ -28,7 +28,7 @@ using __gnu_test::ExplicitConsAlloc;
 template class
   std::unordered_multimap<int, int, std::hash<int>, std::equal_to<int>,
 			  ExplicitConsAlloc<std::pair<const int, int>>>;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::unordered_multimap<int, int, std::hash<int>,
 				       std::equal_to<int>,
 				       ExplicitConsAlloc<char>>;
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
index bb1154b6423..dc9afeb292e 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/3.cc
@@ -1,5 +1,6 @@
 // { dg-do compile { target c++11 } }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // Copyright (C) 2007-2019 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc
index 48498a340d1..e9e1bcb2448 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/explicit_instantiation/5.cc
@@ -26,7 +26,7 @@
 // libstdc++/50118
 template class std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
 				       __gnu_test::ExplicitConsAlloc<int>>;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::unordered_multiset<int, std::hash<int>, std::equal_to<int>,
 				       __gnu_test::ExplicitConsAlloc<char>>;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
index b3f43f55694..2f7193493bd 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/3.cc
@@ -1,5 +1,6 @@
 // { dg-do compile { target c++11 } }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // Copyright (C) 2007-2019 Free Software Foundation, Inc.
 //
diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc
index 3e4f4ff5180..c58b68fca78 100644
--- a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc
+++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/explicit_instantiation/5.cc
@@ -26,7 +26,7 @@
 // libstdc++/50118
 template class std::unordered_set<int, std::hash<int>, std::equal_to<int>,
 				  __gnu_test::ExplicitConsAlloc<int>>;
-#ifndef __STRICT_ANSI__
+#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L
 template class std::unordered_set<int, std::hash<int>, std::equal_to<int>,
 				  __gnu_test::ExplicitConsAlloc<char>>;
 #endif
diff --git a/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc b/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc
deleted file mode 100644
index 23510b4524e..00000000000
--- a/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-// Test for Container using non-standard pointer types.
-
-// Copyright (C) 2011-2019 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/>.
-
-
-#include <vector>
-#include <ext/extptr_allocator.h>
-
-// { dg-do compile { target c++11 } }
-
-template class std::vector<int, __gnu_cxx::_ExtPtr_allocator<int> >;
diff --git a/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc
index d7ba99a8552..7ff2037e77f 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/3.cc
@@ -24,7 +24,8 @@
 #include <ext/extptr_allocator.h>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::vector<int, __gnu_cxx::_ExtPtr_allocator<char> >;
diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc
index 09237ca4277..97582de58f7 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/explicit_instantiation/3.cc
@@ -21,7 +21,8 @@
 #include <vector>
 
 // { dg-do compile }
-// { dg-skip-if "no extensions in strict dialects" { *-*-* } { "-std=c++*" } }
+// The extension that implicitly rebinds allocators is in gnu++98/11/14/17 only
+// { dg-skip-if "" { *-*-* } { "-std=c++*" "-std=gnu++2*" } }
 
 // libstdc++/21770
 template class std::vector<int, std::allocator<char> >;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]