* include/bits/stl_deque.h (_Deque_impl): Move comment.
+ PR libstdc++/58764
+ * include/bits/stl_deque.h (deque::deque(const allocator_type&):
+ Split into separate default constructor and constructor taking
+ allocator.
+ * include/bits/stl_list.h (list::list(const allocator_type&): Likewise.
+ * include/bits/stl_vector.h (vector::vector(const allocator_type&):
+ Likewise.
+ * include/debug/deque (deque::deque(const allocator_type&)): Likewise.
+ * include/debug/list (list::list(const _Allocator&)): Likewise.
+ * include/debug/map.h (map::map(const _Compare&, const _Allocator&)):
+ Likewise.
+ * include/debug/multimap.h
+ (multimap::multimap(const _Compare&, const _Allocator&)): Likewise.
+ * include/debug/set.h (set::set(const _Compare&, const _Allocator&)):
+ Likewise.
+ * include/debug/multiset.h
+ (multiset::multiset(const _Compare&, const _Allocator&)): Likewise.
+ * include/debug/vector (vector::vector(const allocator_type&)):
+ Likewise.
+ * include/profile/deque (deque::deque(const _Allocator&)): Likewise.
+ * include/profile/list (list::list(const _Allocator&)): Likewise.
+ * include/profile/map.h
+ (map::map(const _Compare&, const _Allocator&)): Likewise.
+ * include/profile/multimap.h
+ (multimap::multimap(const _Compare&, const _Allocator&)): Likewise.
+ * include/profile/set.h
+ (set::set(const _Compare&, const _Allocator&)): Likewise.
+ * include/profile/multiset.h
+ (multiset::multiset(const _Compare&, const _Allocator&)): Likewise.
+ * include/profile/vector (vector::vector(const _Allocator&)):
+ Likewise.
+ * testsuite/23_containers/deque/58764.cc: New.
+ * testsuite/23_containers/list/58764.cc: New.
+ * testsuite/23_containers/map/58764.cc: New.
+ * testsuite/23_containers/multimap/58764.cc: New.
+ * testsuite/23_containers/set/58764.cc: New.
+ * testsuite/23_containers/multiset/58764.cc: New.
+ * testsuite/23_containers/vector/58764.cc: New.
+ * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
+ Adjust dg-error line number.
+ * testsuite/23_containers/deque/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/deque/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+ * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc:
+ Likewise.
+ * testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
+ Likewise.
+ * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
+ Likewise.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_1_neg.cc: Likewise.
+ * testsuite/23_containers/vector/requirements/dr438/
+ constructor_2_neg.cc: Likewise.
+ * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
+ Likewise.
+
2014-01-21 Tim Shen <timshen91@gmail.com>
* include/bits/regex.tcc: Remove incorrect `nosubs` handling.
public:
// [23.2.1.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section)
+
+ /**
+ * @brief Creates a %deque with no elements.
+ */
+ deque() : _Base() { }
+
/**
* @brief Creates a %deque with no elements.
* @param __a An allocator object.
*/
explicit
- deque(const allocator_type& __a = allocator_type())
+ deque(const allocator_type& __a)
: _Base(__a) { }
#if __cplusplus >= 201103L
public:
// [23.2.2.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section)
+
+ /**
+ * @brief Creates a %list with no elements.
+ */
+ list() _GLIBCXX_NOEXCEPT
+ : _Base() { }
+
/**
* @brief Creates a %list with no elements.
* @param __a An allocator object.
*/
explicit
- list(const allocator_type& __a = allocator_type()) _GLIBCXX_NOEXCEPT
+ list(const allocator_type& __a) _GLIBCXX_NOEXCEPT
: _Base(_Node_alloc_type(__a)) { }
#if __cplusplus >= 201103L
public:
// [23.2.4.1] construct/copy/destroy
// (assign() and get_allocator() are also listed in this section)
+
+ /**
+ * @brief Creates a %vector with no elements.
+ */
+ vector() _GLIBCXX_NOEXCEPT : _Base() { }
+
/**
* @brief Creates a %vector with no elements.
* @param __a An allocator object.
*/
explicit
- vector(const allocator_type& __a = allocator_type()) _GLIBCXX_NOEXCEPT
+ vector(const allocator_type& __a) _GLIBCXX_NOEXCEPT
: _Base(__a) { }
#if __cplusplus >= 201103L
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.2.1.1 construct/copy/destroy:
+
+ deque() : _Base() { }
+
explicit
- deque(const _Allocator& __a = _Allocator())
+ deque(const _Allocator& __a)
: _Base(__a) { }
#if __cplusplus >= 201103L
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.2.2.1 construct/copy/destroy:
+
+ list() _GLIBCXX_NOEXCEPT
+ : _Base() { }
+
explicit
- list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
+ list(const _Allocator& __a) _GLIBCXX_NOEXCEPT
: _Base(__a) { }
#if __cplusplus >= 201103L
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.3.1.1 construct/copy/destroy:
- explicit map(const _Compare& __comp = _Compare(),
+
+ map() : _Base() { }
+
+ explicit map(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.3.1.1 construct/copy/destroy:
- explicit multimap(const _Compare& __comp = _Compare(),
+
+ multimap() : _Base() { }
+
+ explicit multimap(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.3.3.1 construct/copy/destroy:
- explicit multiset(const _Compare& __comp = _Compare(),
+
+ multiset() : _Base() { }
+
+ explicit multiset(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.3.3.1 construct/copy/destroy:
- explicit set(const _Compare& __comp = _Compare(),
+
+ set() : _Base() { }
+
+ explicit set(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.2.4.1 construct/copy/destroy:
+
+ vector() _GLIBCXX_NOEXCEPT
+ : _Base(), _M_guaranteed_capacity(0) { }
+
explicit
- vector(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
+ vector(const _Allocator& __a) _GLIBCXX_NOEXCEPT
: _Base(__a), _M_guaranteed_capacity(0) { }
#if __cplusplus >= 201103L
typedef typename _Base::const_pointer const_pointer;
// 23.2.1.1 construct/copy/destroy:
+
+ deque()
+ : _Base() { }
+
explicit
- deque(const _Allocator& __a = _Allocator())
+ deque(const _Allocator& __a)
: _Base(__a) { }
#if __cplusplus >= 201103L
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.2.2.1 construct/copy/destroy:
+
+ list() _GLIBCXX_NOEXCEPT
+ : _Base()
+ {
+ __profcxx_list_construct(this); // list2slist
+ __profcxx_list_construct2(this); // list2vector
+ }
+
explicit
- list(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
+ list(const _Allocator& __a) _GLIBCXX_NOEXCEPT
: _Base(__a)
{
__profcxx_list_construct(this); // list2slist
typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
// 23.3.1.1 construct/copy/destroy:
+
+ map()
+ : _Base()
+ { __profcxx_map_to_unordered_map_construct(this); }
+
explicit
- map(const _Compare& __comp = _Compare(),
+ map(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a)
{ __profcxx_map_to_unordered_map_construct(this); }
typedef typename _Base::const_pointer const_pointer;
// 23.3.1.1 construct/copy/destroy:
- explicit multimap(const _Compare& __comp = _Compare(),
+
+ multimap()
+ : _Base() { }
+
+ explicit multimap(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef typename _Base::const_pointer const_pointer;
// 23.3.3.1 construct/copy/destroy:
- explicit multiset(const _Compare& __comp = _Compare(),
+
+ multiset()
+ : _Base() { }
+
+ explicit multiset(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
typedef typename _Base::const_pointer const_pointer;
// 23.3.3.1 construct/copy/destroy:
- explicit set(const _Compare& __comp = _Compare(),
+
+ set()
+ : _Base() { }
+
+ explicit set(const _Compare& __comp,
const _Allocator& __a = _Allocator())
: _Base(__comp, __a) { }
_M_base() const _GLIBCXX_NOEXCEPT { return *this; }
// 23.2.4.1 construct/copy/destroy:
+
+ vector() _GLIBCXX_NOEXCEPT
+ : _Base()
+ {
+ __profcxx_vector_construct(this, this->capacity());
+ __profcxx_vector_construct2(this);
+ }
+
explicit
- vector(const _Allocator& __a = _Allocator()) _GLIBCXX_NOEXCEPT
+ vector(const _Allocator& __a) _GLIBCXX_NOEXCEPT
: _Base(__a)
{
__profcxx_vector_construct(this, this->capacity());
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <deque>
+
+void test01()
+{
+ std::deque<int> a = {};
+}
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1758 }
+// { dg-error "no matching" "" { target *-*-* } 1764 }
#include <deque>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1691 }
+// { dg-error "no matching" "" { target *-*-* } 1697 }
#include <deque>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1691 }
+// { dg-error "no matching" "" { target *-*-* } 1697 }
#include <deque>
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1842 }
+// { dg-error "no matching" "" { target *-*-* } 1848 }
#include <deque>
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <list>
+
+void test01()
+{
+ std::list<int> a = {};
+}
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1646 }
+// { dg-error "no matching" "" { target *-*-* } 1653 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1598 }
+// { dg-error "no matching" "" { target *-*-* } 1605 }
#include <list>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1598 }
+// { dg-error "no matching" "" { target *-*-* } 1605 }
#include <list>
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1598 }
+// { dg-error "no matching" "" { target *-*-* } 1605 }
#include <list>
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <map>
+
+void test01()
+{
+ std::map<int, int> a = {};
+}
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <map>
+
+void test01()
+{
+ std::multimap<int, int> a = {};
+}
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <set>
+
+void test01()
+{
+ std::multiset<int> a = {};
+}
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <set>
+
+void test01()
+{
+ std::set<int> a = {};
+}
--- /dev/null
+// Copyright (C) 2014 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 }
+// { dg-options "-std=gnu++11" }
+
+// libstdc++/58764
+
+#include <vector>
+
+void test01()
+{
+ std::vector<int> a = {};
+ std::vector<bool> b = {};
+}
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1306 }
+// { dg-error "no matching" "" { target *-*-* } 1312 }
#include <vector>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-error "no matching" "" { target *-*-* } 1238 }
#include <vector>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-error "no matching" "" { target *-*-* } 1238 }
#include <vector>
#include <utility>
// <http://www.gnu.org/licenses/>.
// { dg-do compile }
-// { dg-error "no matching" "" { target *-*-* } 1347 }
+// { dg-error "no matching" "" { target *-*-* } 1353 }
#include <vector>