diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 295a3580f72..8084c5c4c98 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,70 @@ +2007-04-27 Paolo Carlini + + 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. + * testsuite/23_containers/requirements/sequences/dr438/vector/ + bool/constructor.cc: Likewise. + * docs/html/ext/howto.html: Add an entry for DR 438. + 2007-04-25 Paolo Carlini * include/bits/locale_classes.h: Remove redundant inline specifiers. diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html index c3dcca4d213..fff3410180f 100644 --- a/libstdc++-v3/docs/html/ext/howto.html +++ b/libstdc++-v3/docs/html/ext/howto.html @@ -543,7 +543,7 @@
432: - 432. stringbuf::overflow() makes only one write position + stringbuf::overflow() makes only one write position available
Implement the resolution, beyond DR 169. @@ -555,6 +555,12 @@
Add three overloads, taking fewer template arguments.
+
438: + Ambiguity in the "do the right thing" clause +
+
Implement the resolution, basically cast less. +
+
453: basic_stringbuf::seekoff need not always fail for an empty stream
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h index a6e3d6dffaa..6317b17cab3 100644 --- a/libstdc++-v3/include/bits/basic_string.h +++ b/libstdc++-v3/include/bits/basic_string.h @@ -1467,12 +1467,13 @@ _GLIBCXX_BEGIN_NAMESPACE(std) return _S_construct(__beg, __end, __a, _Tag()); } - template + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 438. Ambiguity in the "do the right thing" clause + template 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(__beg), - static_cast(__end), __a); } + { return _S_construct(static_cast(__beg), __end, __a); } template static _CharT* diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h index ba29650831b..be0ec9075d2 100644 --- a/libstdc++-v3/include/bits/stl_bvector.h +++ b/libstdc++-v3/include/bits/stl_bvector.h @@ -793,11 +793,14 @@ template } // 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 void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { - _M_initialize(__n); + _M_initialize(static_cast(__n)); std::fill(this->_M_impl._M_start._M_p, this->_M_impl._M_end_of_storage, __x ? ~0 : 0); } @@ -828,10 +831,12 @@ template std::copy(__first, __last, this->_M_impl._M_start); } + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 438. Ambiguity in the "do the right thing" clause template void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { _M_fill_assign((size_t) __n, (bool) __val); } + { _M_fill_assign(__n, __val); } template void @@ -888,6 +893,9 @@ template } // 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 void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h index 2030a937e5c..0c7d7582557 100644 --- a/libstdc++-v3/include/bits/stl_deque.h +++ b/libstdc++-v3/include/bits/stl_deque.h @@ -1221,11 +1221,14 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) { - _M_initialize_map(__n); + _M_initialize_map(static_cast(__n)); _M_fill_initialize(__x); } @@ -1285,13 +1288,13 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast(__n), - static_cast(__val)); - } + { _M_fill_assign(__n, __val); } // called by the range assign to implement [23.1.1]/9 template @@ -1364,14 +1367,14 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x, __true_type) - { - _M_fill_insert(__pos, static_cast(__n), - static_cast(__x)); - } + { _M_fill_insert(__pos, __n, __x); } // called by the range insert to implement [23.1.1]/9 template diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h index e37e5ee36f3..55f3208297d 100644 --- a/libstdc++-v3/include/bits/stl_list.h +++ b/libstdc++-v3/include/bits/stl_list.h @@ -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 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_initialize_dispatch(_Integer __n, _Integer __x, __true_type) - { - _M_fill_initialize(static_cast(__n), - static_cast(__x)); - } + { _M_fill_initialize(static_cast(__n), __x); } // Called by the range constructor to implement [23.1.1]/9 template @@ -1129,13 +1129,13 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast(__n), - static_cast(__val)); - } + { _M_fill_assign(__n, __val); } // Called by the range assign to implement [23.1.1]/9 template diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h index f2c4b4ba9d7..93843f0a77e 100644 --- a/libstdc++-v3/include/bits/stl_vector.h +++ b/libstdc++-v3/include/bits/stl_vector.h @@ -1,6 +1,6 @@ // Vector 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 @@ -778,13 +778,19 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 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(__n)); + this->_M_impl._M_end_of_storage = + this->_M_impl._M_start + static_cast(__n); + std::__uninitialized_fill_n_a(this->_M_impl._M_start, + static_cast(__n), + __value, _M_get_Tp_allocator()); this->_M_impl._M_finish = this->_M_impl._M_end_of_storage; } @@ -830,13 +836,13 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_assign_dispatch(_Integer __n, _Integer __val, __true_type) - { - _M_fill_assign(static_cast(__n), - static_cast(__val)); - } + { _M_fill_assign(__n, __val); } // Called by the range assign to implement [23.1.1]/9 template @@ -870,14 +876,14 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD) // 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 void _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __val, __true_type) - { - _M_fill_insert(__pos, static_cast(__n), - static_cast(__val)); - } + { _M_fill_insert(__pos, __n, __val); } // Called by the range insert to implement [23.1.1]/9 template diff --git a/libstdc++-v3/include/ext/rc_string_base.h b/libstdc++-v3/include/ext/rc_string_base.h index 9a6c9a63ad6..7c0934a3084 100644 --- a/libstdc++-v3/include/ext/rc_string_base.h +++ b/libstdc++-v3/include/ext/rc_string_base.h @@ -231,12 +231,13 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) return _S_construct(__beg, __end, __a, _Tag()); } - template + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 438. Ambiguity in the "do the right thing" clause + template 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(__beg), - static_cast(__end), __a); } + { return _S_construct(static_cast(__beg), __end, __a); } template static _CharT* diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h index a97d1e111b6..3b87879c4ca 100644 --- a/libstdc++-v3/include/ext/sso_string_base.h +++ b/libstdc++-v3/include/ext/sso_string_base.h @@ -106,12 +106,12 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) _M_construct(__beg, __end, _Tag()); } - template + // _GLIBCXX_RESOLVE_LIB_DEFECTS + // 438. Ambiguity in the "do the right thing" clause + template void - _M_construct_aux(_InIterator __beg, _InIterator __end, - std::__true_type) - { _M_construct(static_cast(__beg), - static_cast(__end)); } + _M_construct_aux(_Integer __beg, _Integer __end, std::__true_type) + { _M_construct(static_cast(__beg), __end); } template void diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc new file mode 100644 index 00000000000..2f16545f4c6 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/dr438/constructor.cc @@ -0,0 +1,28 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::string s(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc new file mode 100644 index 00000000000..0c47da04033 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/assign_neg.cc @@ -0,0 +1,36 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::deque d; + d.assign(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc new file mode 100644 index 00000000000..f378b0b1178 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor.cc @@ -0,0 +1,28 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::deque v(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc new file mode 100644 index 00000000000..fc0beffae3e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_1_neg.cc @@ -0,0 +1,30 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::deque > d(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc new file mode 100644 index 00000000000..403f6473f6b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/constructor_2_neg.cc @@ -0,0 +1,31 @@ +// 2007-04-27 Paolo Carlini + +// 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 +#include + +void f() +{ + std::deque > > d('a', 'b'); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc new file mode 100644 index 00000000000..2e2abc56c4b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/deque/insert_neg.cc @@ -0,0 +1,37 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::deque d; + d.insert(d.begin(), 10, 1); +} + diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc new file mode 100644 index 00000000000..4ad1127b9e5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/assign_neg.cc @@ -0,0 +1,36 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::list l; + l.assign(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc new file mode 100644 index 00000000000..c20ac14e202 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor.cc @@ -0,0 +1,28 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::list l(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc new file mode 100644 index 00000000000..5df6fc8532c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_1_neg.cc @@ -0,0 +1,30 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::list > l(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc new file mode 100644 index 00000000000..6783727be7a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/constructor_2_neg.cc @@ -0,0 +1,31 @@ +// 2007-04-27 Paolo Carlini + +// 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 +#include + +void f() +{ + std::list > > l('a', 'b'); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc new file mode 100644 index 00000000000..c8f2026052e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/list/insert_neg.cc @@ -0,0 +1,36 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::list l; + l.insert(l.begin(), 10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc new file mode 100644 index 00000000000..873c27f86ed --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/assign_neg.cc @@ -0,0 +1,36 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::vector v; + v.assign(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc new file mode 100644 index 00000000000..15b4a77a10b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/bool/constructor.cc @@ -0,0 +1,28 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::vector vb(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc new file mode 100644 index 00000000000..74968bd4b64 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor.cc @@ -0,0 +1,28 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::vector v(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc new file mode 100644 index 00000000000..c66faaec941 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_1_neg.cc @@ -0,0 +1,30 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + std::vector > v(10, 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc new file mode 100644 index 00000000000..8e0130bc9cf --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/constructor_2_neg.cc @@ -0,0 +1,31 @@ +// 2007-04-27 Paolo Carlini + +// 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 +#include + +void f() +{ + std::vector > > v('a', 'b'); +} diff --git a/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc new file mode 100644 index 00000000000..c82a5c4602d --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/requirements/sequences/dr438/vector/insert_neg.cc @@ -0,0 +1,36 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +struct A +{ + explicit A(int) { } +}; + +void f() +{ + std::vector v; + v.insert(v.begin(), 10, 1); +} diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/dr438/constructor.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/dr438/constructor.cc new file mode 100644 index 00000000000..95d31db3a01 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/dr438/constructor.cc @@ -0,0 +1,32 @@ +// 2007-04-27 Paolo Carlini + +// 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 + +void f() +{ + __gnu_cxx::__versa_string, + std::allocator, __gnu_cxx::__sso_string_base> vs(10, 1); + + __gnu_cxx::__versa_string, + std::allocator, __gnu_cxx::__rc_string_base> vr(10, 1); +}