diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2013-06-27 09:51:21 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2013-06-27 09:51:21 +0000 |
commit | 7b61c5a9cb77eefe5db28b3e3805f042191ad7c3 (patch) | |
tree | 34f47ec02fbda70b1690f99110cc522ce6e593a0 /libstdc++-v3/testsuite | |
parent | 5a3fe9b6077ab7fbc9dc200dc9621dabf939c7a9 (diff) | |
download | gcc-7b61c5a9cb77eefe5db28b3e3805f042191ad7c3.zip gcc-7b61c5a9cb77eefe5db28b3e3805f042191ad7c3.tar.gz gcc-7b61c5a9cb77eefe5db28b3e3805f042191ad7c3.tar.bz2 |
stl_deque.h (deque<>::insert(iterator, const value_type&), [...]): Adjust C++11 signatures to take a const_iterator.
2013-06-27 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_deque.h (deque<>::insert(iterator,
const value_type&), deque<>::insert(iterator, value_type&&),
deque<>::emplace(iterator, _Args&&...)): Adjust C++11 signatures to
take a const_iterator.
(deque<>::erase): Simplify.
* include/bits/stl_list.h: Likewise.
(_List_iterator<>::_M_const_cast): Add.
* include/bits/stl_vector.h: Likewise.
* include/bits/stl_bvector.h: Likewise.
(_Bit_iterator::_M_const_cast): Add.
* include/bits/deque.tcc: Adjust definitions.
* include/bits/list.tcc: Likewise.
* include/bits/vector.tcc: Likewise.
* include/bits/stl_iterator.h (__normal_iterator<>::_M_const_cast):
Define trivial version in C++98 mode.
* include/ext/vstring.h (__versa_string<>::insert(iterator, _CharT),
__versa_string<>::replace(iterator, iterator, const __versa_string&),
__versa_string<>::replace(iterator, iterator, const _CharT*,
size_type), __versa_string<>::replace(iterator, iterator,
const _CharT*), __versa_string<>::replace(iterator, iterator,
size_type, _CharT)): Adjust C++11 signatures to take a pair of
const_iterators.
* include/debug/deque: Adjust.
* include/debug/list: Likewise.
* include/debug/vector: Likewise.
* include/profile/deque: Likewise.
* include/profile/list: Likewise.
* include/profile/vector: Likewise.
(vector<>::emplace): Add.
* testsuite/util/exception/safety.h: Update.
* testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc:
New.
* testsuite/23_containers/deque/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/23_containers/list/modifiers/emplace/const_iterator.cc:
Likewise.
* testsuite/23_containers/list/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/23_containers/vector/bool/modifiers/insert/
const_iterator.cc: Likewise.
* testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc:
Likewise.
* testsuite/23_containers/vector/modifiers/insert/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc:
Likewise.
* testsuite/ext/vstring/modifiers/char/54577.cc: Move to testsuite/
ext/vstring/modifiers/erase/char/.
* testsuite/ext/vstring/modifiers/wchar_t/54577.cc: Move to testsuite/
ext/vstring/modifiers/wchar_t/.
* testsuite/ext/vstring/modifiers/char/pop_back.cc: Move to testsuite/
ext/vstring/modifiers/pop_back/char/.
* testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc: Move to
testsuite/ext/vstring/modifiers/pop_back/wchar_t/.
* 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.
From-SVN: r200458
Diffstat (limited to 'libstdc++-v3/testsuite')
28 files changed, 330 insertions, 77 deletions
diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc new file mode 100644 index 0000000..d4898b3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/emplace/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <deque> + +void test01() +{ + std::deque<int> d1; + d1.emplace(d1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc new file mode 100644 index 0000000..915aa68 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/modifiers/insert/const_iterator.cc @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <deque> + +void test01() +{ + std::deque<int> d1; + int n = 0; + d1.insert(d1.cbegin(), n); + d1.insert(d1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc index ccb63ef..9788b4d 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1714 } +// { dg-error "no matching" "" { target *-*-* } 1724 } #include <deque> diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc index 0a5db63..a85b5c3 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1647 } +// { dg-error "no matching" "" { target *-*-* } 1657 } #include <deque> diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc index 7572322..162bdf0 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1647 } +// { dg-error "no matching" "" { target *-*-* } 1657 } #include <deque> #include <utility> diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc index b109d38..7e8356f 100644 --- a/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1798 } +// { dg-error "no matching" "" { target *-*-* } 1808 } #include <deque> diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc new file mode 100644 index 0000000..d5aef75 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/emplace/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <list> + +void test01() +{ + std::list<int> l1; + l1.emplace(l1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc new file mode 100644 index 0000000..156bc0a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/list/modifiers/insert/const_iterator.cc @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <list> + +void test01() +{ + std::list<int> l1; + int n = 0; + l1.insert(l1.cbegin(), n); + l1.insert(l1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc index 4ccd652..218b862 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1545 } +// { dg-error "no matching" "" { target *-*-* } 1559 } #include <list> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc index 6bc01b7..3f0b749 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1497 } +// { dg-error "no matching" "" { target *-*-* } 1511 } #include <list> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc index 1f39056..b861f46 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1497 } +// { dg-error "no matching" "" { target *-*-* } 1511 } #include <list> #include <utility> diff --git a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc index 902f55a..fd38c0b 100644 --- a/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1497 } +// { dg-error "no matching" "" { target *-*-* } 1511 } #include <list> diff --git a/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/const_iterator.cc new file mode 100644 index 0000000..b8993d8 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/bool/modifiers/insert/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <vector> + +void test01() +{ + std::vector<bool> vb1; + vb1.insert(vb1.cbegin(), true); +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc new file mode 100644 index 0000000..8e2a194 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/emplace/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <vector> + +void test01() +{ + std::vector<int> v1; + v1.emplace(v1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc b/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc new file mode 100644 index 0000000..5e5ef9e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/modifiers/insert/const_iterator.cc @@ -0,0 +1,29 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <vector> + +void test01() +{ + std::vector<int> v1; + int n = 0; + v1.insert(v1.cbegin(), n); + v1.insert(v1.cbegin(), 1); +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc index 2dbc602..e943467 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1252 } +// { dg-error "no matching" "" { target *-*-* } 1264 } #include <vector> diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc index 7fc56bd..ba14bce 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1178 } +// { dg-error "no matching" "" { target *-*-* } 1190 } #include <vector> diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc index 6a37461..c9ac437 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1178 } +// { dg-error "no matching" "" { target *-*-* } 1190 } #include <vector> #include <utility> diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc index 3f5abb9..343edc2 100644 --- a/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc @@ -18,7 +18,7 @@ // <http://www.gnu.org/licenses/>. // { dg-do compile } -// { dg-error "no matching" "" { target *-*-* } 1293 } +// { dg-error "no matching" "" { target *-*-* } 1305 } #include <vector> diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/char/54577.cc index 979828b..979828b 100644 --- a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/54577.cc +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/char/54577.cc diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/54577.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/wchar_t/54577.cc index f514099..f514099 100644 --- a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/54577.cc +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/erase/wchar_t/54577.cc diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc new file mode 100644 index 0000000..223ab66 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/char/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <ext/vstring.h> + +void test01() +{ + __gnu_cxx::__vstring vs1; + vs1.insert(vs1.cbegin(), '1'); +} diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc new file mode 100644 index 0000000..57fee54 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/insert/wchar_t/const_iterator.cc @@ -0,0 +1,27 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <ext/vstring.h> + +void test01() +{ + __gnu_cxx::__wvstring wvs1; + wvs1.insert(wvs1.cbegin(), L'1'); +} diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/char/1.cc index cec1d22..cec1d22 100644 --- a/libstdc++-v3/testsuite/ext/vstring/modifiers/char/pop_back.cc +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/char/1.cc diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/wchar_t/1.cc index ee8de53..ee8de53 100644 --- a/libstdc++-v3/testsuite/ext/vstring/modifiers/wchar_t/pop_back.cc +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/pop_back/wchar_t/1.cc diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc new file mode 100644 index 0000000..0838443 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/char/const_iterator.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <ext/vstring.h> + +void test01() +{ + __gnu_cxx::__vstring vs1; + vs1.replace(vs1.cbegin(), vs1.cend(), vs1); + vs1.replace(vs1.cbegin(), vs1.cend(), "1", 1); + vs1.replace(vs1.cbegin(), vs1.cend(), "2"); + vs1.replace(vs1.cbegin(), vs1.cend(), 1, '3'); +} diff --git a/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc new file mode 100644 index 0000000..a909c9c --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/modifiers/replace/wchar_t/const_iterator.cc @@ -0,0 +1,30 @@ +// { dg-options "-std=gnu++11" } +// { dg-do compile } + +// Copyright (C) 2013 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/>. + +#include <ext/vstring.h> + +void test01() +{ + __gnu_cxx::__wvstring wvs1; + wvs1.replace(wvs1.cbegin(), wvs1.cend(), wvs1); + wvs1.replace(wvs1.cbegin(), wvs1.cend(), L"1", 1); + wvs1.replace(wvs1.cbegin(), wvs1.cend(), L"2"); + wvs1.replace(wvs1.cbegin(), wvs1.cend(), 1, L'3'); +} diff --git a/libstdc++-v3/testsuite/util/exception/safety.h b/libstdc++-v3/testsuite/util/exception/safety.h index c063c9b..5ba9b13 100644 --- a/libstdc++-v3/testsuite/util/exception/safety.h +++ b/libstdc++-v3/testsuite/util/exception/safety.h @@ -265,7 +265,7 @@ namespace __gnu_test : _F_erase_point(&_Tp::erase), _F_erase_range(&_Tp::erase) { } }; - // Specializations, old C++03 signatures. + // Specialization, old C++03 signature. template<typename _Tp1, typename _Tp2, typename _Tp3> struct erase_base<std::basic_string<_Tp1, _Tp2, _Tp3>> { @@ -280,24 +280,6 @@ namespace __gnu_test _F_erase_range(&container_type::erase) { } }; - template<typename _Tp1, typename _Tp2, typename _Tp3, - template <typename, typename, typename> class _Tp4> - struct erase_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> - { - typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::const_iterator const_iterator; - - iterator (container_type::* _F_erase_point)(const_iterator); - iterator (container_type::* _F_erase_range)(const_iterator, - const_iterator); - - erase_base() - : _F_erase_point(&container_type::erase), - _F_erase_range(&container_type::erase) { } - }; - // Specialization, as forward_list has erase_after. template<typename _Tp1, typename _Tp2> struct erase_base<std::forward_list<_Tp1, _Tp2>> @@ -698,47 +680,7 @@ namespace __gnu_test insert_base() : _F_insert_point(&_Tp::insert) { } }; - // Specializations, old C++03 signatures. - template<typename _Tp1, typename _Tp2> - struct insert_base<std::deque<_Tp1, _Tp2>> - { - typedef std::deque<_Tp1, _Tp2> container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::value_type value_type; - - iterator (container_type::* _F_insert_point)(iterator, - const value_type&); - - insert_base() : _F_insert_point(&container_type::insert) { } - }; - - template<typename _Tp1, typename _Tp2> - struct insert_base<std::list<_Tp1, _Tp2>> - { - typedef std::list<_Tp1, _Tp2> container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::value_type value_type; - - iterator (container_type::* _F_insert_point)(iterator, - const value_type&); - - insert_base() : _F_insert_point(&container_type::insert) { } - }; - - template<typename _Tp1, typename _Tp2> - struct insert_base<std::vector<_Tp1, _Tp2>> - { - typedef std::vector<_Tp1, _Tp2> container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::value_type value_type; - - iterator (container_type::* _F_insert_point)(iterator, - const value_type&); - - insert_base() : _F_insert_point(&container_type::insert) { } - }; - - // Specialization, as string insertion has a different signature. + // Specialization, old C++03 signature. template<typename _Tp1, typename _Tp2, typename _Tp3> struct insert_base<std::basic_string<_Tp1, _Tp2, _Tp3>> { @@ -751,17 +693,19 @@ namespace __gnu_test insert_base() : _F_insert_point(&container_type::insert) { } }; - // Likewise for __versa_string. + // Specialization, by value. template<typename _Tp1, typename _Tp2, typename _Tp3, template <typename, typename, typename> class _Tp4> struct insert_base<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> { typedef __gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4> - container_type; - typedef typename container_type::iterator iterator; - typedef typename container_type::value_type value_type; + container_type; + typedef typename container_type::iterator iterator; + typedef typename container_type::const_iterator const_iterator; + typedef typename container_type::value_type value_type; - iterator (container_type::* _F_insert_point)(iterator, value_type); + iterator (container_type::* _F_insert_point)(const_iterator, + value_type); insert_base() : _F_insert_point(&container_type::insert) { } }; |