+2019-06-03 Jonathan Wakely <jwakely@redhat.com>
+
+ * 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.
+
2019-05-31 Gerald Pfeifer <gerald@pfeifer.com>
* doc/xml/manual/allocator.xml: Move hoard.org back to http.
<entry align="center"> 9.1 </entry>
<entry />
</row>
+
+ <row>
+ <entry>
+ Mandating the Standard Library:
+ Clause 21 - Containers library
+ </entry>
+ <entry>
+ <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1463r1.pdf">
+ P1463R1
+ </link>
+ </entry>
+ <entry align="center"> 10 </entry>
+ <entry/>
+ </row>
+
</tbody>
</tgroup>
</table>
{
static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
"std::forward_list must have a non-const, non-volatile value_type");
-#ifdef __STRICT_ANSI__
+#if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
"std::forward_list must have the same value_type as its allocator");
#endif
{
static_assert(is_same<typename remove_cv<_Value>::type, _Value>::value,
"unordered container must have a non-const, non-volatile value_type");
-#ifdef __STRICT_ANSI__
+#if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Value>{},
"unordered container must have the same value_type as its allocator");
#endif
#if __cplusplus >= 201103L
static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
"std::deque must have a non-const, non-volatile value_type");
-# ifdef __STRICT_ANSI__
+# if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
"std::deque must have the same value_type as its allocator");
# endif
#if __cplusplus >= 201103L
static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
"std::list must have a non-const, non-volatile value_type");
-# ifdef __STRICT_ANSI__
+# if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
"std::list must have the same value_type as its allocator");
# endif
__glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
#endif
-#if __cplusplus >= 201103L && defined(__STRICT_ANSI__)
+#if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, value_type>::value,
"std::map must have the same value_type as its allocator");
#endif
__glibcxx_class_requires2(value_type, _Alloc_value_type, _SameTypeConcept)
#endif
-#if __cplusplus >= 201103L && defined(__STRICT_ANSI__)
+#if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, value_type>::value,
"std::multimap must have the same value_type as its allocator");
#endif
#if __cplusplus >= 201103L
static_assert(is_same<typename remove_cv<_Key>::type, _Key>::value,
"std::multiset must have a non-const, non-volatile value_type");
-# ifdef __STRICT_ANSI__
+# if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Key>::value,
"std::multiset must have the same value_type as its allocator");
# endif
#if __cplusplus >= 201103L
static_assert(is_same<typename remove_cv<_Key>::type, _Key>::value,
"std::set must have a non-const, non-volatile value_type");
-# ifdef __STRICT_ANSI__
+# if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Key>::value,
"std::set must have the same value_type as its allocator");
# endif
#if __cplusplus >= 201103L
static_assert(is_same<typename remove_cv<_Tp>::type, _Tp>::value,
"std::vector must have a non-const, non-volatile value_type");
-# ifdef __STRICT_ANSI__
+# if __cplusplus > 201703L || defined __STRICT_ANSI__
static_assert(is_same<typename _Alloc::value_type, _Tp>::value,
"std::vector must have the same value_type as its allocator");
# endif
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <deque>
+
+void
+test01()
+{
+ std::deque<int, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <forward_list>
+
+void
+test01()
+{
+ std::forward_list<int, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <list>
+
+void
+test01()
+{
+ std::list<int, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <map>
+
+void
+test01()
+{
+ std::map<int, int, std::less<int>, std::allocator<int>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <map>
+
+void
+test01()
+{
+ std::multimap<int, int, std::less<int>, std::allocator<int>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <set>
+
+void
+test01()
+{
+ std::multiset<int, std::less<int>, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <set>
+
+void
+test01()
+{
+ std::set<int, std::less<int>, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <unordered_map>
+
+void
+test01()
+{
+ using namespace std;
+ unordered_map<int, int, hash<int>, equal_to<int>, allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <unordered_map>
+
+void
+test01()
+{
+ using namespace std;
+ unordered_multimap<int, int, hash<int>, equal_to<int>, allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <unordered_set>
+
+void
+test01()
+{
+ using namespace std;
+ unordered_multiset<int, hash<int>, equal_to<int>, allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <unordered_set>
+
+void
+test01()
+{
+ using namespace std;
+ unordered_set<int, hash<int>, equal_to<int>, allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }
--- /dev/null
+// Copyright (C) 2017-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/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <vector>
+
+void
+test01()
+{
+ std::vector<int, std::allocator<long>> c;
+}
+
+// { dg-error "same value_type as its allocator" "" { target *-*-* } 0 }