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]

[Patch] DR 438


Hi all, hi Howard,

before implementing the allocator::construct / destroy removal, I decided to take care of DR 438.
Overall, I think the issue is rather clear, basically we want to cast less than we used to do, that is only the first argument in the templated constructor, neither in assign, insert, etc.


I'd like to ask to Howard to have a look to the implementation of his own DR, in particular to the testcases. Thanks in advance.

Tested x86-linux.

Paolo.

/////////////


2007-04-27  Paolo Carlini  <pcarlini@suse.de>

	DR 438, [DR].
	* include/bits/basic_string.h (_S_construct_aux(_InIterator,
	_InIterator, const _Alloc&, __true_type)): Do not cast the
	second argument.
	* include/ext/rc_string_base.h (_S_construct_aux(_Integer,
	_Integer, const _Alloc&, std::__true_type)): Likewise.
	* include/ext/sso_string_base.h (_M_construct_aux(_InIterator,
	_InIterator, std::__true_type)): Likewise.
	* include/bits/stl_deque.h (_M_initialize_dispatch(_Integer,
	_Integer, __true_type)): Cast the first argument.
	(_M_assign_dispatch(_Integer, _Integer, __true_type)): Do
	not cast the arguments.
	(_M_insert_dispatch(iterator, _Integer, _Integer, __true_type)):
	Likewise.
	* include/bits/stl_list.h (_M_initialize_dispatch(_Integer,
	_Integer, __true_type)): Likewise.
	(_M_assign_dispatch(_Integer, _Integer, __true_type)): Do
	not cast both arguments.
	* include/bits/stl_bvector.h (_M_initialize_dispatch(_Integer,
	_Integer, __true_type)): Cast the first argument.
	(_M_assign_dispatch(_Integer, _Integer, __true_type)): Do not
	cast the arguments.
	* include/bits/stl_vector.h (_M_initialize_dispatch(_Integer,
	_Integer, __true_type)): Cast the first argument.
	(_M_assign_dispatch(_Integer, _Integer, __true_type)): Do not
	cast the arguments.
	(_M_insert_dispatch(iterator, _Integer, _Integer, __true_type)):
	Likewise.
	* testsuite/21_strings/basic_string/requirements/dr438/
	constructor.cc: New.
	* testsuite/ext/vstring/requirements/dr438/constructor.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/deque/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/deque/
	constructor.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/deque/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/deque/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/deque/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/list/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/list/
	constructor.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/list/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/list/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/list/
	insert_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/vector/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/vector/
	constructor.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/vector/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/vector/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/requirements/sequences/dr438/vector/
	insert_neg.cc: Likewise.
	* docs/html/ext/howto.html: Add an entry for DR 438.
Index: docs/html/ext/howto.html
===================================================================
--- docs/html/ext/howto.html	(revision 124150)
+++ docs/html/ext/howto.html	(working copy)
@@ -543,7 +543,7 @@
     </dd>
 
     <dt><a href="lwg-defects.html#432">432</a>:
-        <em>432. stringbuf::overflow() makes only one write position
+        <em>stringbuf::overflow() makes only one write position
 	    available</em>
     </dt>
     <dd>Implement the resolution, beyond DR 169.
@@ -555,6 +555,12 @@
     <dd>Add three overloads, taking fewer template arguments.
     </dd>
 
+    <dt><a href="lwg-defects.html#438">438</a>:
+        <em>Ambiguity in the "do the right thing" clause</em>
+    </dt>
+    <dd>Implement the resolution, basically cast less.
+    </dd>
+
     <dt><a href="lwg-defects.html#453">453</a>:
         <em>basic_stringbuf::seekoff need not always fail for an empty stream</em>
     </dt>
Index: include/ext/rc_string_base.h
===================================================================
--- include/ext/rc_string_base.h	(revision 124150)
+++ include/ext/rc_string_base.h	(working copy)
@@ -231,12 +231,13 @@
           return _S_construct(__beg, __end, __a, _Tag());
 	}
 
-      template<typename _InIterator>
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
+      template<typename _Integer>
         static _CharT*
-        _S_construct_aux(_InIterator __beg, _InIterator __end,
+        _S_construct_aux(_Integer __beg, _Integer __end,
 			 const _Alloc& __a, std::__true_type)
-	{ return _S_construct(static_cast<size_type>(__beg),
-			      static_cast<value_type>(__end), __a); }
+	{ return _S_construct(static_cast<size_type>(__beg), __end, __a); }
 
       template<typename _InIterator>
         static _CharT*
Index: include/ext/sso_string_base.h
===================================================================
--- include/ext/sso_string_base.h	(revision 124150)
+++ include/ext/sso_string_base.h	(working copy)
@@ -106,12 +106,12 @@
           _M_construct(__beg, __end, _Tag());
 	}
 
-      template<typename _InIterator>
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
+      template<typename _Integer>
         void
-        _M_construct_aux(_InIterator __beg, _InIterator __end, 
-			 std::__true_type)
-	{ _M_construct(static_cast<size_type>(__beg),
-		       static_cast<value_type>(__end)); }
+        _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type)
+	{ _M_construct(static_cast<size_type>(__beg), __end); }
 
       template<typename _InIterator>
         void
Index: include/bits/stl_list.h
===================================================================
--- include/bits/stl_list.h	(revision 124154)
+++ include/bits/stl_list.h	(working copy)
@@ -1,6 +1,6 @@
 // List implementation -*- C++ -*-
 
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
@@ -1098,13 +1098,13 @@
       // Internal constructor functions follow.
 
       // Called by the range constructor to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
-        {
-	  _M_fill_initialize(static_cast<size_type>(__n),
-			     static_cast<value_type>(__x));
-	}
+        { _M_fill_initialize(static_cast<size_type>(__n), __x); }
 
       // Called by the range constructor to implement [23.1.1]/9
       template<typename _InputIterator>
@@ -1129,13 +1129,13 @@
       // Internal assign functions follow.
 
       // Called by the range assign to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
-        {
-	  _M_fill_assign(static_cast<size_type>(__n),
-			 static_cast<value_type>(__val));
-	}
+        { _M_fill_assign(__n, __val); }
 
       // Called by the range assign to implement [23.1.1]/9
       template<typename _InputIterator>
Index: include/bits/basic_string.h
===================================================================
--- include/bits/basic_string.h	(revision 124154)
+++ include/bits/basic_string.h	(working copy)
@@ -1467,12 +1467,13 @@
           return _S_construct(__beg, __end, __a, _Tag());
 	}
 
-      template<class _InIterator>
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
+      template<class _Integer>
         static _CharT*
-        _S_construct_aux(_InIterator __beg, _InIterator __end,
+        _S_construct_aux(_Integer __beg, _Integer __end,
 			 const _Alloc& __a, __true_type)
-	{ return _S_construct(static_cast<size_type>(__beg),
-			      static_cast<value_type>(__end), __a); }
+        { return _S_construct(static_cast<size_type>(__beg), __end, __a); }
 
       template<class _InIterator>
         static _CharT*
Index: include/bits/stl_vector.h
===================================================================
--- include/bits/stl_vector.h	(revision 124154)
+++ include/bits/stl_vector.h	(working copy)
@@ -778,13 +778,19 @@
       // Internal constructor functions follow.
 
       // Called by the range constructor to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_initialize_dispatch(_Integer __n, _Integer __value, __true_type)
         {
-	  this->_M_impl._M_start = _M_allocate(__n);
-	  this->_M_impl._M_end_of_storage = this->_M_impl._M_start + __n;
-	  std::__uninitialized_fill_n_a(this->_M_impl._M_start, __n, __value,
+	  this->_M_impl._M_start = _M_allocate(static_cast<size_type>(__n));
+	  this->_M_impl._M_end_of_storage =
+	    this->_M_impl._M_start + static_cast<size_type>(__n);
+	  std::__uninitialized_fill_n_a(this->_M_impl._M_start,
+					static_cast<size_type>(__n),
+					__value,
 					_M_get_Tp_allocator());
 	  this->_M_impl._M_finish = this->_M_impl._M_end_of_storage;
 	}
@@ -830,13 +836,13 @@
       // assignment work for the range versions.
 
       // Called by the range assign to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
-        {
-	  _M_fill_assign(static_cast<size_type>(__n),
-			 static_cast<value_type>(__val));
-	}
+        { _M_fill_assign(__n, __val); }
 
       // Called by the range assign to implement [23.1.1]/9
       template<typename _InputIterator>
@@ -870,14 +876,14 @@
       // Internal insert functions follow.
 
       // Called by the range insert to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val,
 			   __true_type)
-        {
-	  _M_fill_insert(__pos, static_cast<size_type>(__n),
-			 static_cast<value_type>(__val));
-	}
+        { _M_fill_insert(__pos, __n, __val); }
 
       // Called by the range insert to implement [23.1.1]/9
       template<typename _InputIterator>
Index: include/bits/stl_deque.h
===================================================================
--- include/bits/stl_deque.h	(revision 124154)
+++ include/bits/stl_deque.h	(working copy)
@@ -1221,11 +1221,14 @@
       // Internal constructor functions follow.
 
       // called by the range constructor to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
         {
-	  _M_initialize_map(__n);
+	  _M_initialize_map(static_cast<size_type>(__n));
 	  _M_fill_initialize(__x);
 	}
 
@@ -1285,13 +1288,13 @@
       // assignment work for the range versions.
 
       // called by the range assign to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
-        {
-	  _M_fill_assign(static_cast<size_type>(__n),
-			 static_cast<value_type>(__val));
-	}
+        { _M_fill_assign(__n, __val); }
 
       // called by the range assign to implement [23.1.1]/9
       template<typename _InputIterator>
@@ -1364,14 +1367,14 @@
       // insertion work when all shortcuts fail.
 
       // called by the range insert to implement [23.1.1]/9
+
+      // _GLIBCXX_RESOLVE_LIB_DEFECTS
+      // 438. Ambiguity in the "do the right thing" clause
       template<typename _Integer>
         void
         _M_insert_dispatch(iterator __pos,
 			   _Integer __n, _Integer __x, __true_type)
-        {
-	  _M_fill_insert(__pos, static_cast<size_type>(__n),
-			 static_cast<value_type>(__x));
-	}
+        { _M_fill_insert(__pos, __n, __x); }
 
       // called by the range insert to implement [23.1.1]/9
       template<typename _InputIterator>
Index: include/bits/stl_bvector.h
===================================================================
--- include/bits/stl_bvector.h	(revision 124154)
+++ include/bits/stl_bvector.h	(working copy)
@@ -793,11 +793,14 @@
     }
 
     // Check whether it's an integral type.  If so, it's not an iterator.
+
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+    // 438. Ambiguity in the "do the right thing" clause
     template<typename _Integer>
       void
       _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type)
       {
-	_M_initialize(__n);
+	_M_initialize(static_cast<size_type>(__n));
 	std::fill(this->_M_impl._M_start._M_p, 
 		  this->_M_impl._M_end_of_storage, __x ? ~0 : 0);
       }
@@ -828,10 +831,12 @@
 	std::copy(__first, __last, this->_M_impl._M_start);
       }
 
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+    // 438. Ambiguity in the "do the right thing" clause
     template<typename _Integer>
       void
       _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
-      { _M_fill_assign((size_t) __n, (bool) __val); }
+      { _M_fill_assign(__n, __val); }
 
     template<class _InputIterator>
       void
@@ -888,6 +893,9 @@
       }
 
     // Check whether it's an integral type.  If so, it's not an iterator.
+
+    // _GLIBCXX_RESOLVE_LIB_DEFECTS
+    // 438. Ambiguity in the "do the right thing" clause
     template<typename _Integer>
       void
       _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
Index: testsuite/21_strings/basic_string/requirements/dr438/constructor.cc
===================================================================
--- testsuite/21_strings/basic_string/requirements/dr438/constructor.cc	(revision 0)
+++ testsuite/21_strings/basic_string/requirements/dr438/constructor.cc	(revision 0)
@@ -0,0 +1,28 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <string>
+
+void f()
+{
+  std::string s(10, 1);
+}
Index: testsuite/ext/vstring/requirements/dr438/constructor.cc
===================================================================
--- testsuite/ext/vstring/requirements/dr438/constructor.cc	(revision 0)
+++ testsuite/ext/vstring/requirements/dr438/constructor.cc	(revision 0)
@@ -0,0 +1,32 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <ext/vstring.h>
+
+void f()
+{
+  __gnu_cxx::__versa_string<char, std::char_traits<char>,
+    std::allocator<char>, __gnu_cxx::__sso_string_base> vs(10, 1);
+
+  __gnu_cxx::__versa_string<char, std::char_traits<char>,
+    std::allocator<char>, __gnu_cxx::__rc_string_base> vr(10, 1);  
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc	(revision 0)
@@ -0,0 +1,36 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 845 }
+// { dg-excess-errors "" }
+
+#include <vector>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::vector<A> v;
+  v.assign(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc	(revision 0)
@@ -0,0 +1,36 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 886 }
+// { dg-excess-errors "" }
+
+#include <vector>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::vector<A> v;
+  v.insert(v.begin(), 10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc	(revision 0)
@@ -0,0 +1,30 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no match" "" { target *-*-* } 706 }
+// { dg-excess-errors "" }
+
+#include <vector>
+
+void f()
+{
+  std::vector<std::vector<int> > v(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc	(revision 0)
@@ -0,0 +1,31 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no match" "" { target *-*-* } 706 }
+// { dg-excess-errors "" }
+
+#include <vector>
+#include <utility>
+
+void f()
+{
+  std::vector<std::vector<std::pair<char, char> > > v('a', 'b');
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc	(revision 0)
@@ -0,0 +1,28 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <vector>
+
+void f()
+{
+  std::vector<int> v(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc	(revision 0)
@@ -0,0 +1,28 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <vector>
+
+void f()
+{
+  std::vector<bool> vb(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc	(revision 0)
@@ -0,0 +1,36 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1297 }
+// { dg-excess-errors "" }
+
+#include <deque>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::deque<A> d;
+  d.assign(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc	(revision 0)
@@ -0,0 +1,37 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1377 }
+// { dg-excess-errors "" }
+
+#include <deque>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::deque<A> d;
+  d.insert(d.begin(), 10, 1);
+}
+
Index: testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc	(revision 0)
@@ -0,0 +1,30 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-excess-errors "" }
+
+#include <deque>
+
+void f()
+{
+  std::deque<std::deque<int> > d(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc	(revision 0)
@@ -0,0 +1,31 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1232 }
+// { dg-excess-errors "" }
+
+#include <deque>
+#include <utility>
+
+void f()
+{
+  std::deque<std::deque<std::pair<char, char> > > d('a', 'b');
+}
Index: testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc	(revision 0)
@@ -0,0 +1,28 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <deque>
+
+void f()
+{
+  std::deque<int> v(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc	(revision 0)
@@ -0,0 +1,36 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1138 }
+// { dg-excess-errors "" }
+
+#include <list>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::list<A> l;
+  l.assign(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc	(revision 0)
@@ -0,0 +1,36 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-excess-errors "" }
+
+#include <list>
+
+struct A
+{
+  explicit A(int) { }
+};
+
+void f()
+{
+  std::list<A> l;
+  l.insert(l.begin(), 10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc	(revision 0)
@@ -0,0 +1,30 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-excess-errors "" }
+
+#include <list>
+
+void f()
+{
+  std::list<std::list<int> > l(10, 1);
+}
Index: testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc	(revision 0)
@@ -0,0 +1,31 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+// { dg-error "no matching" "" { target *-*-* } 1107 }
+// { dg-excess-errors "" }
+
+#include <list>
+#include <utility>
+
+void f()
+{
+  std::list<std::list<std::pair<char, char> > > l('a', 'b');
+}
Index: testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc
===================================================================
--- testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc	(revision 0)
+++ testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc	(revision 0)
@@ -0,0 +1,28 @@
+// 2007-04-27  Paolo Carlini  <pcarlini@suse.de>
+
+// Copyright (C) 2007 Free Software Foundation
+//
+// 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 2, 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 COPYING.  If not, write to the Free
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+// USA.
+
+// { dg-do compile }
+
+#include <list>
+
+void f()
+{
+  std::list<int> l(10, 1);
+}

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