From a2dbc0bf2aa42f0f078d0d46f7d9cdafc5383d93 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 6 Jun 2019 14:36:27 +0100 Subject: [PATCH] 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. From-SVN: r272001 --- libstdc++-v3/ChangeLog | 70 +++++++++++++++++++ .../explicit_instantiation/1_c++0x.cc | 24 ------- .../requirements/explicit_instantiation/2.cc | 8 +-- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../explicit_instantiation/1_c++0x.cc | 24 ------- .../requirements/explicit_instantiation/2.cc | 8 +-- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../explicit_instantiation/1_c++0x.cc | 24 ------- .../requirements/explicit_instantiation/2.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../explicit_instantiation/1_c++0x.cc | 24 ------- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../explicit_instantiation/1_c++0x.cc | 24 ------- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../requirements/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/5.cc | 2 +- .../ext_pointer/explicit_instantiation/2.cc | 26 ------- .../ext_pointer/explicit_instantiation/3.cc | 3 +- .../requirements/explicit_instantiation/3.cc | 3 +- 33 files changed, 113 insertions(+), 180 deletions(-) delete mode 100644 libstdc++-v3/testsuite/23_containers/deque/requirements/explicit_instantiation/1_c++0x.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/list/requirements/explicit_instantiation/1_c++0x.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/map/requirements/explicit_instantiation/1_c++0x.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/multimap/requirements/explicit_instantiation/1_c++0x.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/set/requirements/explicit_instantiation/1_c++0x.cc delete mode 100644 libstdc++-v3/testsuite/23_containers/vector/ext_pointer/explicit_instantiation/2.cc diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 3dd82b637ff..afb41cb83a5 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,75 @@ 2019-06-06 Jonathan Wakely + * 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. + * include/std/type_traits (is_empty, is_polymorphic, is_final) (is_abstract, is_aggregate): Remove static_assert. * testsuite/20_util/is_abstract/incomplete_neg.cc: Check for error 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 -// . - -// This file tests explicit instantiation of library containers - -#include - -template class std::deque; 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 #include -// { 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 // { 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 >; 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 // { 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 >; 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>; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::forward_list>; #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 -// . - -// This file tests explicit instantiation of library containers - -#include - -template class std::list; 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 #include -// { 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 // { 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 >; 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 >; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::list >; #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 -// . - -// This file tests explicit instantiation of library containers - -#include - -template class std::map; 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 // { 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, std::allocator >; 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, ExplicitConsAlloc > >; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::map, ExplicitConsAlloc >; #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 -// . - -// This file tests explicit instantiation of library containers - -#include - -template class std::multimap; 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 // { 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, std::allocator >; 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, ExplicitConsAlloc > >; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::multimap, ExplicitConsAlloc >; #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 // { 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, std::allocator >; 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, __gnu_test::ExplicitConsAlloc >; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::multiset, __gnu_test::ExplicitConsAlloc >; #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 -// . - -// This file tests explicit instantiation of library containers - -#include - -template class std::set; 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 // { 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, std::allocator >; 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, __gnu_test::ExplicitConsAlloc >; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::set, __gnu_test::ExplicitConsAlloc >; #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, std::equal_to, ExplicitConsAlloc>>; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::unordered_map, std::equal_to, ExplicitConsAlloc>; #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, std::equal_to, ExplicitConsAlloc>>; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::unordered_multimap, std::equal_to, ExplicitConsAlloc>; 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, std::equal_to, __gnu_test::ExplicitConsAlloc>; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::unordered_multiset, std::equal_to, __gnu_test::ExplicitConsAlloc>; #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, std::equal_to, __gnu_test::ExplicitConsAlloc>; -#ifndef __STRICT_ANSI__ +#if !defined __STRICT_ANSI__ && __cplusplus <= 201703L template class std::unordered_set, std::equal_to, __gnu_test::ExplicitConsAlloc>; #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 -// . - - -#include -#include - -// { dg-do compile { target c++11 } } - -template class std::vector >; 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 // { 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 >; 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 // { 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 >; -- 2.30.2