From 739fd6a6b37a914454431a7ab1f0a8f4e022b64c Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 9 Mar 2012 10:37:34 +0000 Subject: formatter.h (enum _Debug_msg_id): Add __msg_self_move_assign. 2012-03-09 Paolo Carlini * include/debug/formatter.h (enum _Debug_msg_id): Add __msg_self_move_assign. * include/debug/macros.h (__glibcxx_check_self_move_assign): Add. * src/c++11/debug.cc (_S_debug_messages): Update. * include/debug/safe_iterator.h (_Safe_iterator<>::operator= (_Safe_iterator&&)): Add check for self move assignment. * include/debug/set.h: Likewise. * include/debug/unordered_map: Likewise. * include/debug/multiset.h: Likewise. * include/debug/forward_list: Likewise. * include/debug/unordered_set: Likewise. * include/debug/vector: Likewise. * include/debug/map.h: Likewise. * include/debug/deque: Likewise. * include/debug/string: Likewise. * include/debug/list: Likewise. * include/debug/multimap.h: Likewise. * testsuite/21_strings/debug/self_move_assign_neg.cc: New. * testsuite/21_strings/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_map/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_map/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multimap/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multimap/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/set/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/ self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multimap/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/forward_list/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_set/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/vector/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/vector/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/deque/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/deque/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/multiset/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/list/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/list/debug/iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/ self_move_assign_neg.cc: Likewise. * testsuite/23_containers/unordered_multiset/debug/ iterator_self_move_assign_neg.cc: Likewise. * testsuite/23_containers/map/debug/self_move_assign_neg.cc: Likewise. * testsuite/23_containers/map/debug/iterator_self_move_assign_neg.cc: Likewise. From-SVN: r185134 --- .../set/debug/iterator_self_move_assign_neg.cc | 35 ++++++++++++++++++++++ .../set/debug/self_move_assign_neg.cc | 34 +++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc create mode 100644 libstdc++-v3/testsuite/23_containers/set/debug/self_move_assign_neg.cc (limited to 'libstdc++-v3/testsuite/23_containers/set/debug') diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc new file mode 100644 index 00000000000..079ecd9b49a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/iterator_self_move_assign_neg.cc @@ -0,0 +1,35 @@ +// Copyright (C) 2012 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 +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++11" } +// { dg-do run { xfail *-*-* } } + +#include + +void test01() +{ + std::set s1; + auto it1 = s1.begin(); + it1 = std::move(it1); +} + +int main() +{ + test01(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/debug/self_move_assign_neg.cc b/libstdc++-v3/testsuite/23_containers/set/debug/self_move_assign_neg.cc new file mode 100644 index 00000000000..dd2bf9fb15c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/debug/self_move_assign_neg.cc @@ -0,0 +1,34 @@ +// Copyright (C) 2012 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 +// . +// +// { dg-require-debug-mode "" } +// { dg-options "-std=gnu++11" } +// { dg-do run { xfail *-*-* } } + +#include + +void test01() +{ + std::set s1; + s1 = std::move(s1); +} + +int main() +{ + test01(); + return 0; +} -- cgit v1.2.1