From: Benjamin Kosnik Date: Fri, 1 Jan 2010 03:38:58 +0000 (+0000) Subject: PR libstdc++/21772 part 3 X-Git-Tag: releases/gcc-4.5.0~1464 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c0f2830ac9f8a97acbceb5af706d518a46250a1;p=thirdparty%2Fgcc.git PR libstdc++/21772 part 3 2009-12-31 Benjamin Kosnik PR libstdc++/21772 part 3 * include/ext/throw_allocator.h: Add _GLIBCXX_IS_AGGREGATE. * testsuite/util/testsuite_container_traits.h (traits): Add has_insert. (traits): Add has_insert. (traits): Add has_size_type_constructor. * testsuite/23_containers/array/requirements/exception/ generation_prohibited.cc: New. * testsuite/21_strings/basic_string/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/ext/vstring/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/unordered_map/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/multimap/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/set/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/unordered_multimap/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/forward_list/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/unordered_set/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/vector/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/deque/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/multiset/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/unordered_multiset/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. * testsuite/23_containers/map/requirements/exception/ basic.cc: New. generation_prohibited.cc: New. propagation_consistent.cc: New. From-SVN: r155545 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 434ef19b1d6f..e5064a33dc96 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,66 @@ +2009-12-31 Benjamin Kosnik + + PR libstdc++/21772 part 3 + * include/ext/throw_allocator.h: Add _GLIBCXX_IS_AGGREGATE. + * testsuite/util/testsuite_container_traits.h (traits): + Add has_insert. + (traits): Add has_insert. + (traits): Add has_size_type_constructor. + * testsuite/23_containers/array/requirements/exception/ + generation_prohibited.cc: New. + * testsuite/21_strings/basic_string/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/ext/vstring/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/unordered_map/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/multimap/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/set/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/unordered_multimap/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/forward_list/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/unordered_set/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/vector/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/deque/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/multiset/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/unordered_multiset/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + * testsuite/23_containers/map/requirements/exception/ + basic.cc: New. + generation_prohibited.cc: New. + propagation_consistent.cc: New. + 2009-12-31 Benjamin Kosnik * doc/xml/manual/intro.xml: Order TR's at the end of status. diff --git a/libstdc++-v3/include/ext/throw_allocator.h b/libstdc++-v3/include/ext/throw_allocator.h index fd939b2e168e..f2e7553099db 100644 --- a/libstdc++-v3/include/ext/throw_allocator.h +++ b/libstdc++-v3/include/ext/throw_allocator.h @@ -457,16 +457,16 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) std::size_t _M_i; +#ifndef _GLIBCXX_IS_AGGREGATE throw_value_base() : _M_i(0) { throw_conditionally(); } - throw_value_base(const throw_value_base& __v) - : _M_i(__v._M_i) + throw_value_base(const throw_value_base& __v) : _M_i(__v._M_i) { throw_conditionally(); } - explicit throw_value_base(const std::size_t __i) - : _M_i(__i) + explicit throw_value_base(const std::size_t __i) : _M_i(__i) { throw_conditionally(); } +#endif throw_value_base& operator=(const throw_value_base& __v) @@ -553,17 +553,20 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) return __ret; } + /// Type throwing via limit condition. struct throw_value_limit : public throw_value_base { typedef throw_value_base base_type; +#ifndef _GLIBCXX_IS_AGGREGATE throw_value_limit() { } throw_value_limit(const throw_value_limit& __other) : base_type(__other._M_i) { } explicit throw_value_limit(const std::size_t __i) : base_type(__i) { } +#endif }; /// Type throwing via random condition. @@ -571,6 +574,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) { typedef throw_value_base base_type; +#ifndef _GLIBCXX_IS_AGGREGATE throw_value_random() { } throw_value_random(const throw_value_random& __other) @@ -578,6 +582,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) explicit throw_value_random(const std::size_t __i) : base_type(__i) { } +#endif }; diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/basic.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/basic.cc new file mode 100644 index 000000000000..1f6b970d2bfc --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/basic.cc @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-10 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::char_traits traits_type; + typedef std::basic_string test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..211d7c21d89e --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/generation_prohibited.cc @@ -0,0 +1,54 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-14 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +char_allocator() +{ + typedef char value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::char_traits traits_type; + typedef std::basic_string test_type; + __gnu_test::generation_prohibited test; +} + +void +wchar_allocator() +{ + typedef wchar_t value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::char_traits traits_type; + typedef std::basic_string test_type; + __gnu_test::generation_prohibited test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + // throw_allocator + char_allocator(); + wchar_allocator(); + + return 0; +} diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..8e27a919ce13 --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/basic_string/requirements/exception/propagation_consistent.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// { dg-do run { xfail *-*-* } } + +// 2009-09-14 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::char_traits traits_type; + typedef std::basic_string test_type; + __gnu_test::propagation_consistent test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..5ecf8fb2e394 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/exception/generation_prohibited.cc @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x -D_GLIBCXX_IS_AGGREGATE" } +// { dg-require-cstdint "" } +// { dg-do run { xfail *-*-* } } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef std::array test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/basic.cc new file mode 100644 index 000000000000..25629c1563e2 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/basic.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::deque test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..23cde13f4dff --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/generation_prohibited.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// { dg-do run { xfail *-*-* } } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::deque test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..14892344e9fd --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/deque/requirements/exception/propagation_consistent.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// { dg-do run { xfail *-*-* } } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::deque test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc new file mode 100644 index 000000000000..672daf84018e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/basic.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::forward_list test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..7d1764799d17 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/generation_prohibited.cc @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::forward_list test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..5c426c93c18a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/forward_list/requirements/exception/propagation_consistent.cc @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::forward_list test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/basic.cc new file mode 100644 index 000000000000..d51f9f27d717 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/basic.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::map test_type; + + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..b01bba47dc8c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::less compare_type; + typedef std::map test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/map/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..20cf5e489037 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/map/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::map test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/basic.cc new file mode 100644 index 000000000000..62fba44e0243 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/basic.cc @@ -0,0 +1,43 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::multimap test_type; + + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..817c3c8feb36 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::less compare_type; + typedef std::multimap test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..76087165ab92 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multimap/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit key_type; + typedef std::pair value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::multimap test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/basic.cc new file mode 100644 index 000000000000..4525843e12b4 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/basic.cc @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::multiset test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..889b1067be09 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/generation_prohibited.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::less compare_type; + typedef std::multiset test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..b1dd057eb760 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/multiset/requirements/exception/propagation_consistent.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::multiset test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/basic.cc new file mode 100644 index 000000000000..d9146e30c354 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/basic.cc @@ -0,0 +1,41 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::set test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..0536b99ac60a --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/generation_prohibited.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::less compare_type; + typedef std::set test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/set/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..dccfd3a5fc83 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/set/requirements/exception/propagation_consistent.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::less compare_type; + typedef std::set test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc new file mode 100644 index 000000000000..9da9817c0927 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/basic.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..5a3c6f8020b8 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..6399149b8b42 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_map/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x -O1" } // XXX -O1 via PR42346 +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_map test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc new file mode 100644 index 000000000000..c695f9c1a71e --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/basic.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multimap test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..9426e9d4444b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multimap test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..921c54812a93 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multimap/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multimap test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/basic.cc new file mode 100644 index 000000000000..b0344e844d7c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/basic.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multiset test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..a0d8abb542c6 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multiset test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..b0303c14d33b --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_multiset/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_multiset test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/basic.cc new file mode 100644 index 000000000000..6d0e3f52be3f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/basic.cc @@ -0,0 +1,42 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_set test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..0841cf0135bd --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/generation_prohibited.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_set test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..ab1d74d03db3 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/unordered_set/requirements/exception/propagation_consistent.cc @@ -0,0 +1,36 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::hash hash_type; + typedef std::equal_to pred_type; + typedef std::unordered_set test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc new file mode 100644 index 000000000000..a31a05a06db5 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/basic.cc @@ -0,0 +1,40 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-30 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::vector test_type; + __gnu_test::basic_safety test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..133928040ddd --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/generation_prohibited.cc @@ -0,0 +1,35 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } +// { dg-do run { xfail *-*-* } } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_random value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::vector test_type; + __gnu_test::generation_prohibited test; + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..7487ac372a73 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/vector/requirements/exception/propagation_consistent.cc @@ -0,0 +1,34 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-09 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +// Container requirement testing, exceptional behavior +int main() +{ + typedef __gnu_cxx::throw_value_limit value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::vector test_type; + __gnu_test::propagation_consistent test; + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/exception/basic.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/basic.cc new file mode 100644 index 000000000000..a0042d488265 --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/basic.cc @@ -0,0 +1,55 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-11-10 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ +#if 1 + typedef char value_type; +#else + // XXX + // __gnu_cxx::__rc_string_base<>::_Rep::_M_align’ with constructor + // not allowed in union + // typedef __gnu_cxx::throw_value_limit value_type; +#endif + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::char_traits traits_type; + + typedef __gnu_cxx::__versa_string test_type_rc; + + typedef __gnu_cxx::__versa_string test_type_sso; + + __gnu_test::basic_safety test_rc; + __gnu_test::basic_safety test_sso; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/exception/generation_prohibited.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/generation_prohibited.cc new file mode 100644 index 000000000000..4ffe0df3bc4a --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/generation_prohibited.cc @@ -0,0 +1,52 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-14 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +char_instance() +{ + typedef char value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::char_traits traits_type; + typedef __gnu_cxx::__versa_string test_type; + __gnu_test::generation_prohibited test; +} + +void +wchar_instance() +{ + typedef wchar_t value_type; + typedef __gnu_cxx::throw_allocator_random allocator_type; + typedef std::char_traits traits_type; + typedef __gnu_cxx::__versa_string test_type; + __gnu_test::generation_prohibited test; +} + +// Container requirement testing, exceptional behavior +int main() +{ + char_instance(); + wchar_instance(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/vstring/requirements/exception/propagation_consistent.cc b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/propagation_consistent.cc new file mode 100644 index 000000000000..09d8618ab80c --- /dev/null +++ b/libstdc++-v3/testsuite/ext/vstring/requirements/exception/propagation_consistent.cc @@ -0,0 +1,55 @@ +// { dg-options "-std=gnu++0x" } +// { dg-require-cstdint "" } + +// 2009-09-14 Benjamin Kosnik + +// Copyright (C) 2009 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 +// . + +#include +#include + +void +value() +{ +#if 1 + typedef char value_type; +#else + // XXX + // __gnu_cxx::__rc_string_base<>::_Rep::_M_align’ with constructor + // not allowed in union + // typedef __gnu_cxx::throw_value_limit value_type; +#endif + typedef __gnu_cxx::throw_allocator_limit allocator_type; + typedef std::char_traits traits_type; + + typedef __gnu_cxx::__versa_string test_type_rc; + + typedef __gnu_cxx::__versa_string test_type_sso; + + __gnu_test::propagation_consistent test_rc; + __gnu_test::propagation_consistent test_sso; +} + +// Container requirement testing, exceptional behavior +int main() +{ + value(); + return 0; +} diff --git a/libstdc++-v3/testsuite/util/testsuite_container_traits.h b/libstdc++-v3/testsuite/util/testsuite_container_traits.h index 85d04c5728ca..8e9405cac0e9 100644 --- a/libstdc++-v3/testsuite/util/testsuite_container_traits.h +++ b/libstdc++-v3/testsuite/util/testsuite_container_traits.h @@ -99,6 +99,45 @@ namespace __gnu_test typedef std::true_type has_size_type_constructor; }; + template + struct traits> : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_reversible; + typedef std::true_type is_allocator_aware; + typedef std::true_type is_pointer_aware; + + typedef std::true_type has_erase; + typedef std::true_type has_insert; + typedef std::true_type has_size_type_constructor; + }; + + template + struct traits> : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_reversible; + typedef std::true_type is_allocator_aware; + typedef std::true_type is_pointer_aware; + + typedef std::true_type has_erase; + typedef std::true_type has_insert; + }; + + template class _Tp4> + struct traits<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> + : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_reversible; + typedef std::true_type is_allocator_aware; + typedef std::true_type is_pointer_aware; + + typedef std::true_type has_erase; + //typedef std::true_type has_insert; XXX no vstring::insert + }; + template struct traits> : public traits_base { @@ -121,6 +160,20 @@ namespace __gnu_test typedef std::true_type is_pointer_aware; typedef std::true_type is_associative; typedef std::true_type is_mapped; + + typedef std::true_type has_insert; + }; + + template + struct traits> : public traits_base + { + typedef std::true_type is_container; + typedef std::true_type is_reversible; + typedef std::true_type is_allocator_aware; + typedef std::true_type is_pointer_aware; + typedef std::true_type is_associative; + + typedef std::true_type has_insert; }; template @@ -147,18 +200,6 @@ namespace __gnu_test typedef std::true_type is_adaptor; }; - template - struct traits> : public traits_base - { - typedef std::true_type is_container; - typedef std::true_type is_reversible; - typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; - typedef std::true_type is_associative; - - typedef std::true_type has_insert; - }; - template struct traits > : public traits_base { @@ -203,6 +244,7 @@ namespace __gnu_test typedef std::true_type is_pointer_aware; typedef std::true_type is_unordered; + typedef std::true_type has_size_type_constructor; typedef std::true_type has_insert; }; @@ -218,47 +260,6 @@ namespace __gnu_test typedef std::true_type has_size_type_constructor; typedef std::true_type has_insert; }; - - template - struct traits> : public traits_base - { - typedef std::true_type is_container; - typedef std::true_type is_reversible; - typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; - - typedef std::true_type has_erase; - typedef std::true_type has_insert; - typedef std::true_type has_size_type_constructor; - }; - - template - struct traits> : public traits_base - { - typedef std::true_type is_container; - typedef std::true_type is_reversible; - typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; - - typedef std::true_type has_erase; - typedef std::true_type has_insert; - }; - - template class _Tp4> - struct traits<__gnu_cxx::__versa_string<_Tp1, _Tp2, _Tp3, _Tp4>> - : public traits_base - { - typedef std::true_type is_container; - typedef std::true_type is_reversible; - typedef std::true_type is_allocator_aware; - typedef std::true_type is_pointer_aware; - - typedef std::true_type has_erase; - - // XXX no vstring::insert - // typedef std::true_type has_insert; - }; } // namespace __gnu_test #endif