@@ -293,7 +293,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
_Fwd_list_node_base _M_head;
_Fwd_list_impl()
- noexcept( noexcept(_Node_alloc_type()) )
+ noexcept(is_nothrow_default_constructible<_Node_alloc_type>::value)
: _Node_alloc_type(), _M_head()
{ }
@@ -473,8 +473,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
: public _Bit_alloc_type, public _Bvector_impl_data
{
public:
- _Bvector_impl()
- _GLIBCXX_NOEXCEPT_IF( noexcept(_Bit_alloc_type()) )
+ _Bvector_impl() _GLIBCXX_NOEXCEPT_IF(
+ is_nothrow_default_constructible<_Bit_alloc_type>::value)
: _Bit_alloc_type()
{ }
@@ -372,7 +372,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CXX11
{
__detail::_List_node_header _M_node;
- _List_impl() _GLIBCXX_NOEXCEPT_IF( noexcept(_Node_alloc_type()) )
+ _List_impl() _GLIBCXX_NOEXCEPT_IF(
+ is_nothrow_default_constructible<_Node_alloc_type>::value)
: _Node_alloc_type()
{ }
@@ -125,7 +125,8 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
struct _Vector_impl
: public _Tp_alloc_type, public _Vector_impl_data
{
- _Vector_impl() _GLIBCXX_NOEXCEPT_IF( noexcept(_Tp_alloc_type()) )
+ _Vector_impl() _GLIBCXX_NOEXCEPT_IF(
+ is_nothrow_default_constructible<_Tp_alloc_type>::value)
: _Tp_alloc_type()
{ }
new file mode 100644
@@ -0,0 +1,42 @@
+// 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
+// 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-do compile { target c++11 } }
+
+#include <forward_list>
+
+template <typename T>
+struct Alloc
+{
+ using value_type = T;
+
+ T* allocate(unsigned n);
+ void deallocate(T* p, unsigned n);
+
+ Alloc(int) { }
+
+ template<typename U>
+ Alloc(const Alloc<U>&) { }
+};
+
+template<typename T, typename U>
+ bool operator==(Alloc<T>, Alloc<U>) { return true; }
+template<typename T, typename U>
+ bool operator!=(Alloc<T>, Alloc<U>) { return false; }
+
+constexpr bool b
+ = std::is_default_constructible<std::forward_list<bool, Alloc<bool>>>::value;
new file mode 100644
@@ -0,0 +1,42 @@
+// 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
+// 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-do compile { target c++11 } }
+
+#include <list>
+
+template <typename T>
+struct Alloc
+{
+ using value_type = T;
+
+ T* allocate(unsigned n);
+ void deallocate(T* p, unsigned n);
+
+ Alloc(int) { }
+
+ template<typename U>
+ Alloc(const Alloc<U>&) { }
+};
+
+template<typename T, typename U>
+ bool operator==(Alloc<T>, Alloc<U>) { return true; }
+template<typename T, typename U>
+ bool operator!=(Alloc<T>, Alloc<U>) { return false; }
+
+constexpr bool b
+ = std::is_default_constructible<std::list<bool, Alloc<bool>>>::value;
new file mode 100644
@@ -0,0 +1,42 @@
+// 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
+// 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-do compile { target c++11 } }
+
+#include <vector>
+
+template <typename T>
+struct Alloc
+{
+ using value_type = T;
+
+ T* allocate(unsigned n);
+ void deallocate(T* p, unsigned n);
+
+ Alloc(int) { }
+
+ template<typename U>
+ Alloc(const Alloc<U>&) { }
+};
+
+template<typename T, typename U>
+ bool operator==(Alloc<T>, Alloc<U>) { return true; }
+template<typename T, typename U>
+ bool operator!=(Alloc<T>, Alloc<U>) { return false; }
+
+constexpr bool b
+ = std::is_default_constructible<std::vector<bool, Alloc<bool>>>::value;
new file mode 100644
@@ -0,0 +1,42 @@
+// 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
+// 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-do compile { target c++11 } }
+
+#include <vector>
+
+template <typename T>
+struct Alloc
+{
+ using value_type = T;
+
+ T* allocate(unsigned n);
+ void deallocate(T* p, unsigned n);
+
+ Alloc(int) { }
+
+ template<typename U>
+ Alloc(const Alloc<U>&) { }
+};
+
+template<typename T, typename U>
+ bool operator==(Alloc<T>, Alloc<U>) { return true; }
+template<typename T, typename U>
+ bool operator!=(Alloc<T>, Alloc<U>) { return false; }
+
+constexpr bool b
+ = std::is_default_constructible<std::vector<int, Alloc<int>>>::value;