From 4394642dae0b7d809969a2e9cc9f96923c306f34 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Tue, 2 Nov 2010 02:35:28 +0000 Subject: * include/std/chrono: Extend constexpr application. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible, constexpr_single_value_constructible) : Add comments about implied constraints. * testsuite/20_util/duration/cons/constexpr.cc: Activate all tests. * testsuite/20_util/time_point/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Adjust line numbers. * testsuite/20_util/time_point_cast/constexpr.cc: New. * include/std/bitset: Use __SIZEOF_* macros to re-create original logic instead of slipshod application of std::numeric_limits::max() macros. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Modify. * include/std/chrono: Tested constexpr. * testsuite/20_util/duration_cast/constexpr.cc: New. * testsuite/20_util/time_point/cons/constexpr.cc: New. * testsuite/20_util/duration/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust line numbers. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/time_point/cons/constexpr.cc: Add single_value tests. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Add. * testsuite/util/testsuite_common_types.h: Adjust init. * include/std/chrono (duration): Remove defaulted constructor, replace with mem-init list. * testsuite/20_util/duration/cons/constexpr.cc: Add single value. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Add non-static member functions. * testsuite/20_util/default_delete/cons/constexpr.cc: New, xfail. * testsuite/20_util/enable_shared_from_this/cons/constexpr.cc: Same. * testsuite/20_util/shared_ptr/cons/constexpr.cc: Same. * testsuite/20_util/time_point/requirements/constexpr_functions.cc: Same. * testsuite/20_util/unique_ptr/cons/constexpr.cc: Same. * testsuite/20_util/weak_ptr/cons/constexpr.cc: Same. * include/std/bitset: Add constexpr as per N3126 draft. * testsuite/23_containers/bitset/cons/constexpr.cc: New. * testsuite/23_containers/bitset/requirements/constexpr_functions.cc: New. * testsuite/util/testsuite_common_types.h: Reset condition. * include/bits/random.h: Remove misleading comments. * include/bits/regex.h: Add constexpr. * testsuite/28_regex/05_constants/syntax_option_type.cc: Add tests. * testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc: New. PR libstdc++/46134 * include/std/chrono: Use default constructor. * testsuite/util/testsuite_common_types.h (constexpr_default_constructible): Adjust condition. PR libstdc++/46133 * include/std/complex: Adjust complex specialization default constructors for constexpr. * testsuite/26_numerics/complex/cons/constexpr.cc: Enable tests. * include/bits/random.h: Adjust for constexpr as per N3126 draft. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/discard_block_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/independent_bits_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/linear_congruential_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/mersenne_twister_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/shuffle_order_engine/requirements/ constexpr_functions.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_data.cc: New. * testsuite/26_numerics/random/subtract_with_carry_engine/requirements/ constexpr_functions.cc: New. * include/bits/stream_iterator.h: Add constexpr as per N3126 draft. * include/bits/streambuf_iterator.h: Same. * include/std/complex: Same. * testsuite/24_iterators/istream_iterator/cons/constexpr.cc: New. * testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc: New. * testsuite/26_numerics/complex/cons/constexpr.cc: New. * testsuite/26_numerics/complex/requirements/constexpr_functions.cc: New. * include/bits/char_traits.h: Add constexpr as per N3126 draft. * testsuite/21_strings/char_traits/requirements/constexpr_functions.cc: New. * include/tr1_impl/array: Add constexpr as per N3126 draft. * testsuite/23_containers/array/requirements/ constexpr_functions.cc: New. * include/bits/shared_ptr.h: Revert changes. * include/bits/unique_ptr.h: Same. * include/std/chrono: Adjust. * include/tr1_impl/type_traits: Same. * testsuite/util/testsuite_common_types.h: Add test functors. * testsuite/20_util/duration/cons/constexpr.cc: New. * testsuite/20_util/duration/requirements/constexpr_functions.cc: Same. * testsuite/20_util/pair/cons/constexpr.cc: Same. * testsuite/20_util/ratio/requirements/constexpr_data.cc: Same. * testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc: Same. * testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc: Same. * testsuite/30_threads/call_once/constexpr.cc: Same. * testsuite/30_threads/mutex/cons/constexpr.cc: Same. * testsuite/30_threads/once_flag/cons/constexpr.cc: Same. * testsuite/tr1/4_metaprogramming/integral_constant/requirements/ constexpr_data.cc: Same. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * include/bits/allocator.h: Add constexpr as per N3126 draft. * include/bits/ios_base.h: Same. * include/bits/shared_ptr.h: Same. * include/bits/unique_ptr.h: Same. * include/bits/stl_iterator.h: Same. * include/bits/stl_pair.h: Same. * include/std/tuple: Same. * include/tr1_impl/type_traits: Same. * include/std/chrono: Same. * include/std/ratio: Same. * include/std/mutex: Same. * src/mutex.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust. * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Same. * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Same. * testsuite/20_util/weak_ptr/comparison/cmp_neg.cc: Same. * testsuite/27_io/ios_base/cons/assign_neg.cc: Same. * testsuite/27_io/ios_base/cons/copy_neg.cc: Same. * doc/doxygen/user.cfg.in: Replace _GLIBCXX_USE_CONSTEXPR, _GLIBCXX_CONSTEXPR for doxygen generation. * src/limits.cc: Undef. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.c: Same. * testsuite/18_support/numeric_limits/constexpr.cc: To... * testsuite/18_support/numeric_limits/requirements/ constexpr_data.cc, constexpr_functions.cc: ...this * testsuite/util/testsuite_common_types.h (constexpr_single_value_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: Adjust name. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_address/cons/constexpr.cc: New. * testsuite/18_support/numeric_limits/constexpr.cc: New. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Adjust line numbers. * testsuite/29_atomics/atomic/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: Same. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Same. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Same. * include/bits/c++config (_GLIBCXX_CONSTEXPR): Add. (_GLIBCXX_USE_CONSTEXPR): Add. * include/std/limits: Use it. * src/limits.cc: Adjust. * testsuite/ext/profile/mutex_extensions.cc: Change line number. * include/bits/atomic_0.h: Rework for N3126 draft, add constexpr. * include/bits/atomic_2.h: Same. * include/bits/atomic_base.h: Same. * include/std/atomic: Same. * src/atomic.cc: Same. * include/bits/atomicfwd_c.h: Remove. * include/bits/atomicfwd_cxx.h: Remove. * include/c_compatibility/stdatomic.h: Remove. * include/Makefile.am: Remove atomicfwd_c.h, atomicfwd_cxx.h, stdatomic.h. * include/Makefile.in: Regenerate. * doc/xml/manual/using.xml: Update list of header files for changes. * testsuite/util/testsuite_common_types.h (constexpr_constructible): Add. * testsuite/29_atomics/atomic/cons/constexpr.cc: New. * testsuite/29_atomics/atomic_integral/cons/constexpr.cc: New. * testsuite/17_intro/headers/c++200x/stdc++.cc: Modify. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_address/cons/assign_neg.cc: Same. * testsuite/29_atomics/atomic_flag/cons/1.cc: Same. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Same. * testsuite/29_atomics/headers/atomic/macros.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc: Same. * testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc: Same. * testsuite/29_atomics/atomic_flag/test_and_set/implicit.c: Remove. * testsuite/29_atomics/atomic_flag/test_and_set/explicit.c: Same. * testsuite/29_atomics/atomic_flag/clear/1.c: Same. * testsuite/29_atomics/headers/stdatomic.h/debug_mode.c: Same. * testsuite/29_atomics/headers/stdatomic.h/functions.c: Same. * testsuite/29_atomics/headers/stdatomic.h/macros.c: Same. * testsuite/29_atomics/headers/stdatomic.h/types.c: Same. * testsuite/util/testsuite_abi.cc: Add GLIBCXX_3.4.16. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@166171 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../testsuite/17_intro/headers/c++200x/stdc++.cc | 3 +- .../18_support/numeric_limits/cons/default.cc | 26 +++++ .../numeric_limits/cons/default_c++0x.cc | 28 +++++ .../numeric_limits/requirements/constexpr_data.cc | 75 ++++++++++++++ .../requirements/constexpr_functions.cc | 61 +++++++++++ .../20_util/default_delete/cons/constexpr.cc | 29 ++++++ .../testsuite/20_util/duration/cons/constexpr.cc | 33 ++++++ .../duration/requirements/constexpr_functions.cc | 58 +++++++++++ .../20_util/duration/requirements/typedefs_neg1.cc | 4 +- .../20_util/duration/requirements/typedefs_neg2.cc | 2 +- .../20_util/duration/requirements/typedefs_neg3.cc | 2 +- .../testsuite/20_util/duration_cast/constexpr.cc | 37 +++++++ .../enable_shared_from_this/cons/constexpr.cc | 35 +++++++ .../testsuite/20_util/pair/cons/constexpr.cc | 29 ++++++ .../20_util/ratio/requirements/constexpr_data.cc | 52 ++++++++++ .../testsuite/20_util/shared_ptr/cons/constexpr.cc | 33 ++++++ .../testsuite/20_util/time_point/cons/constexpr.cc | 37 +++++++ .../time_point/requirements/constexpr_functions.cc | 56 ++++++++++ .../testsuite/20_util/time_point_cast/constexpr.cc | 39 +++++++ .../testsuite/20_util/unique_ptr/cons/constexpr.cc | 32 ++++++ .../20_util/weak_ptr/comparison/cmp_neg.cc | 4 +- .../testsuite/20_util/weak_ptr/cons/constexpr.cc | 32 ++++++ .../requirements/constexpr_functions.cc | 67 ++++++++++++ .../array/requirements/constexpr_functions.cc | 54 ++++++++++ .../23_containers/bitset/cons/constexpr.cc | 37 +++++++ .../bitset/requirements/constexpr_functions.cc | 55 ++++++++++ .../istream_iterator/cons/constexpr.cc | 29 ++++++ .../istreambuf_iterator/cons/constexpr.cc | 29 ++++++ .../26_numerics/complex/cons/constexpr.cc | 37 +++++++ .../complex/requirements/constexpr_functions.cc | 57 +++++++++++ .../requirements/constexpr_data.cc | 57 +++++++++++ .../requirements/constexpr_functions.cc | 57 +++++++++++ .../requirements/constexpr_functions.cc | 60 +++++++++++ .../requirements/constexpr_data.cc | 55 ++++++++++ .../requirements/constexpr_functions.cc | 53 ++++++++++ .../requirements/constexpr_data.cc | 65 ++++++++++++ .../requirements/constexpr_functions.cc | 53 ++++++++++ .../requirements/constexpr_data.cc | 59 +++++++++++ .../requirements/constexpr_functions.cc | 60 +++++++++++ .../requirements/constexpr_data.cc | 55 ++++++++++ .../requirements/constexpr_functions.cc | 53 ++++++++++ .../testsuite/27_io/ios_base/cons/assign_neg.cc | 2 +- .../testsuite/27_io/ios_base/cons/copy_neg.cc | 2 +- .../ios_base/types/fmtflags/constexpr_operators.cc | 28 +++++ .../ios_base/types/iostate/constexpr_operators.cc | 28 +++++ .../ios_base/types/openmode/constexpr_operators.cc | 28 +++++ .../28_regex/05_constants/syntax_option_type.cc | 65 +++++++++--- .../08_basic_regex/requirements/constexpr_data.cc | 61 +++++++++++ .../testsuite/29_atomics/atomic/cons/assign_neg.cc | 2 +- .../testsuite/29_atomics/atomic/cons/constexpr.cc | 32 ++++++ .../testsuite/29_atomics/atomic/cons/copy_neg.cc | 2 +- .../29_atomics/atomic_address/cons/assign_neg.cc | 2 +- .../29_atomics/atomic_address/cons/constexpr.cc | 29 ++++++ .../testsuite/29_atomics/atomic_flag/clear/1.c | 34 ------ .../testsuite/29_atomics/atomic_flag/cons/1.cc | 2 +- .../29_atomics/atomic_flag/test_and_set/explicit.c | 30 ------ .../29_atomics/atomic_flag/test_and_set/implicit.c | 30 ------ .../29_atomics/atomic_integral/cons/assign_neg.cc | 2 +- .../29_atomics/atomic_integral/cons/constexpr.cc | 31 ++++++ .../29_atomics/atomic_integral/cons/copy_neg.cc | 2 +- .../atomic_integral/operators/bitwise_neg.cc | 6 +- .../atomic_integral/operators/decrement_neg.cc | 6 +- .../atomic_integral/operators/increment_neg.cc | 6 +- .../testsuite/29_atomics/headers/atomic/macros.cc | 85 +++++++++++++-- .../29_atomics/headers/atomic/types_std_c++0x.cc | 3 +- .../headers/atomic/types_std_c++0x_neg.cc | 94 ++++++++++++++++- .../29_atomics/headers/stdatomic.h/debug_mode.c | 22 ---- .../29_atomics/headers/stdatomic.h/functions.c | 36 ------- .../29_atomics/headers/stdatomic.h/macros.c | 114 --------------------- .../29_atomics/headers/stdatomic.h/types.c | 77 -------------- .../testsuite/30_threads/call_once/constexpr.cc | 29 ++++++ .../testsuite/30_threads/mutex/cons/constexpr.cc | 29 ++++++ .../30_threads/once_flag/cons/constexpr.cc | 29 ++++++ .../testsuite/ext/profile/mutex_extensions.cc | 2 +- .../requirements/constexpr_data.cc | 52 ++++++++++ libstdc++-v3/testsuite/util/testsuite_abi.cc | 1 + .../testsuite/util/testsuite_common_types.h | 69 +++++++++++++ 77 files changed, 2377 insertions(+), 394 deletions(-) create mode 100644 libstdc++-v3/testsuite/18_support/numeric_limits/cons/default.cc create mode 100644 libstdc++-v3/testsuite/18_support/numeric_limits/cons/default_c++0x.cc create mode 100644 libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/duration/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/duration/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/20_util/duration_cast/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/enable_shared_from_this/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/pair/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/20_util/shared_ptr/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/time_point/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/time_point/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/20_util/time_point_cast/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/unique_ptr/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/20_util/weak_ptr/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/23_containers/bitset/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/23_containers/bitset/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/24_iterators/istream_iterator/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/complex/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/complex/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_functions.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc create mode 100644 libstdc++-v3/testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc create mode 100644 libstdc++-v3/testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc create mode 100644 libstdc++-v3/testsuite/29_atomics/atomic/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_address/cons/constexpr.cc delete mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c delete mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.c delete mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.c create mode 100644 libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/constexpr.cc delete mode 100644 libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c delete mode 100644 libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/functions.c delete mode 100644 libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/macros.c delete mode 100644 libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/types.c create mode 100644 libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc create mode 100644 libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc create mode 100644 libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc (limited to 'libstdc++-v3/testsuite') diff --git a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc index f3e19f5003b..357373a0a82 100644 --- a/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc +++ b/libstdc++-v3/testsuite/17_intro/headers/c++200x/stdc++.cc @@ -3,7 +3,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2007, 2008, 2009, 2010 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 @@ -44,7 +44,6 @@ #include #include #include -#include #include #ifdef _GLIBCXX_HAVE_STDBOOL_H #include diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default.cc new file mode 100644 index 00000000000..6b492569c3d --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default.cc @@ -0,0 +1,26 @@ +// Copyright (C) 2008, 2009, 2010 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 + +int main() +{ + __gnu_test::default_constructible test; + __gnu_cxx::typelist::apply_generator(test, __gnu_test::limits_tl()); + return 0; +} diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default_c++0x.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default_c++0x.cc new file mode 100644 index 00000000000..17ee4c79e87 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/cons/default_c++0x.cc @@ -0,0 +1,28 @@ +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2008, 2009, 2010 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 + +int main() +{ + __gnu_test::default_constructible test; + __gnu_cxx::typelist::apply_generator(test, __gnu_test::limits_tl()); + return 0; +} diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc new file mode 100644 index 00000000000..d5f3b3f3926 --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_data.cc @@ -0,0 +1,75 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + using std::float_denorm_style; + using std::float_round_style; + constexpr bool v1(_Ttesttype::is_specialized); + constexpr int v2(_Ttesttype::digits); + constexpr int v3(_Ttesttype::digits10); + constexpr int v4(_Ttesttype::max_digits10); + constexpr bool v5(_Ttesttype::is_signed); + constexpr bool v6(_Ttesttype::is_integer); + constexpr bool v7(_Ttesttype::is_exact); + constexpr int v8(_Ttesttype::radix); + constexpr int v9(_Ttesttype::min_exponent); + constexpr int v10(_Ttesttype::min_exponent10); + constexpr int v11(_Ttesttype::max_exponent); + constexpr int v12(_Ttesttype::max_exponent10); + constexpr bool v13(_Ttesttype::has_infinity); + constexpr bool v14(_Ttesttype::has_quiet_NaN); + constexpr bool v15(_Ttesttype::has_signaling_NaN); + constexpr float_denorm_style v16(_Ttesttype::has_denorm); + constexpr bool v17(_Ttesttype::has_denorm_loss); + constexpr bool v18(_Ttesttype::is_iec559); + constexpr bool v19(_Ttesttype::is_bounded); + constexpr bool v20(_Ttesttype::is_modulo); + constexpr bool v21(_Ttesttype::traps); + constexpr bool v22(_Ttesttype::tinyness_before); + constexpr float_round_style v23(_Ttesttype::round_style); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + __gnu_cxx::typelist::apply_generator(test, __gnu_test::limits_tl()); + return 0; +} diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..7c4852b2bbb --- /dev/null +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/requirements/constexpr_functions.cc @@ -0,0 +1,61 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr _Tbasetype v1(_Ttesttype::min()); + constexpr _Tbasetype v2(_Ttesttype::max()); + constexpr _Tbasetype v3(_Ttesttype::lowest()); + constexpr _Tbasetype v4(_Ttesttype::epsilon()); + constexpr _Tbasetype v5(_Ttesttype::round_error()); + constexpr _Tbasetype v6(_Ttesttype::infinity()); + constexpr _Tbasetype v7(_Ttesttype::quiet_NaN()); + constexpr _Tbasetype v8(_Ttesttype::signaling_NaN()); + constexpr _Tbasetype v9(_Ttesttype::denorm_min()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + __gnu_cxx::typelist::apply_generator(test, + __gnu_test::limits_tl(), + __gnu_test::integral_types::type()); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc new file mode 100644 index 00000000000..897394a57b2 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/default_delete/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile { xfail *-*-* } } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()>(); // { dg-excess-errors "" } + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/duration/cons/constexpr.cc new file mode 100644 index 00000000000..6f78dbb37e3 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/cons/constexpr.cc @@ -0,0 +1,33 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test1; + test1.operator()(); + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator()(); + test2.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..3986659f064 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/constexpr_functions.cc @@ -0,0 +1,58 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + constexpr auto v3(_Ttesttype::zero()); + + constexpr _Ttesttype obj { }; + constexpr auto v4 = obj.count(); + constexpr auto v5 = -obj; + constexpr auto v6 = +obj; + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc index 98a35f10539..7dab6f12977 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc @@ -3,7 +3,7 @@ // { dg-require-cstdint "" } // 2008-07-31 Chris Fairles -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010 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 @@ -31,5 +31,5 @@ void test01() test_type d; } -// { dg-error "rep cannot be a duration" "" { target *-*-* } 203 } +// { dg-error "rep cannot be a duration" "" { target *-*-* } 210 } // { dg-error "instantiated from here" "" { target *-*-* } 31 } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc index b83bf494db5..640574991bf 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc @@ -32,6 +32,6 @@ void test01() test_type d; } -// { dg-error "must be a specialization of ratio" "" { target *-*-* } 204 } +// { dg-error "must be a specialization of ratio" "" { target *-*-* } 211 } // { dg-error "instantiated from here" "" { target *-*-* } 32 } // { dg-excess-errors "In instantiation of" } diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc index 86f349319f0..d6163867fb5 100644 --- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc @@ -33,5 +33,5 @@ void test01() test_type d; } -// { dg-error "period must be positive" "" { target *-*-* } 206 } +// { dg-error "period must be positive" "" { target *-*-* } 213 } // { dg-error "instantiated from here" "" { target *-*-* } 33 } diff --git a/libstdc++-v3/testsuite/20_util/duration_cast/constexpr.cc b/libstdc++-v3/testsuite/20_util/duration_cast/constexpr.cc new file mode 100644 index 00000000000..a68aed6d45d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration_cast/constexpr.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + using namespace std::chrono; + + // non-constexpr + minutes mn1(6000); + hours hr1 = duration_cast(mn1); + + // constexpr + constexpr minutes mn2(6000); + constexpr hours hr2 = duration_cast(mn2); + + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/enable_shared_from_this/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/cons/constexpr.cc new file mode 100644 index 00000000000..0df6dcf3896 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/enable_shared_from_this/cons/constexpr.cc @@ -0,0 +1,35 @@ +// { dg-do compile { xfail *-*-* } } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +struct derived : public std::enable_shared_from_this +{ + constexpr derived() { } +}; + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()(); // { dg-excess-errors "" } + derived d; + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/pair/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/pair/cons/constexpr.cc new file mode 100644 index 00000000000..7bf6b71162d --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/pair/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc new file mode 100644 index 00000000000..bc90adce0b0 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/ratio/requirements/constexpr_data.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr intmax_t v1(_Ttesttype::num); + constexpr intmax_t v2(_Ttesttype::den); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/constexpr.cc new file mode 100644 index 00000000000..d040ea49666 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/shared_ptr/cons/constexpr.cc @@ -0,0 +1,33 @@ +// { dg-do compile { xfail *-*-* } } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test1; + test1.operator()>(); // { dg-excess-errors "" } + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator(), std::nullptr_t>(); // { dg-excess-errors "" } + + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/time_point/cons/constexpr.cc new file mode 100644 index 00000000000..d12d2f164c9 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/cons/constexpr.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + using namespace std::chrono; + + __gnu_test::constexpr_default_constructible test1; + test1.operator()>(); + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator(), seconds>(); + test2.operator(), + time_point>(); + + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/20_util/time_point/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..feb77fb17fa --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point/requirements/constexpr_functions.cc @@ -0,0 +1,56 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + + constexpr _Ttesttype obj; + constexpr auto v3 = obj.time_since_epoch(); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + using namespace std::chrono; + __gnu_test::constexpr_member_functions test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/time_point_cast/constexpr.cc b/libstdc++-v3/testsuite/20_util/time_point_cast/constexpr.cc new file mode 100644 index 00000000000..436a4fbfc6c --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/time_point_cast/constexpr.cc @@ -0,0 +1,39 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + using namespace std::chrono; + typedef time_point to_type; + typedef time_point from_type; + + // constexpr + constexpr minutes m(6000); + constexpr hours h(19); + constexpr to_type tpm(h); // time_point object with minutes + constexpr from_type tph(m); // time_point object with hours + + constexpr auto res(time_point_cast(tpm)); + + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/unique_ptr/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/unique_ptr/cons/constexpr.cc new file mode 100644 index 00000000000..20db7615ba8 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/unique_ptr/cons/constexpr.cc @@ -0,0 +1,32 @@ +// { dg-do compile { xfail *-*-* } } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test1; + test1.operator()>(); // { dg-excess-errors "" } + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator(), std::nullptr_t>(); // { dg-excess-errors "" } + return 0; +} diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc index fbb24c002f4..b8cf6d8c08c 100644 --- a/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc +++ b/libstdc++-v3/testsuite/20_util/weak_ptr/comparison/cmp_neg.cc @@ -42,10 +42,10 @@ main() } // { dg-warning "note" "" { target *-*-* } 347 } -// { dg-warning "note" "" { target *-*-* } 466 } +// { dg-warning "note" "" { target *-*-* } 465 } // { dg-warning "note" "" { target *-*-* } 883 } // { dg-warning "note" "" { target *-*-* } 580 } // { dg-warning "note" "" { target *-*-* } 1027 } // { dg-warning "note" "" { target *-*-* } 340 } // { dg-warning "note" "" { target *-*-* } 290 } -// { dg-warning "note" "" { target *-*-* } 200 } +// { dg-warning "note" "" { target *-*-* } 201 } diff --git a/libstdc++-v3/testsuite/20_util/weak_ptr/cons/constexpr.cc b/libstdc++-v3/testsuite/20_util/weak_ptr/cons/constexpr.cc new file mode 100644 index 00000000000..3b43769bff3 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/weak_ptr/cons/constexpr.cc @@ -0,0 +1,32 @@ +// { dg-do compile { xfail *-*-* } } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()>(); // { dg-excess-errors "" } + // test.operator()>(); + // test.operator()>(); + // test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..ecb9a3e243a --- /dev/null +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc @@ -0,0 +1,67 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + typedef typename _Ttesttype::char_type char_type; + typedef typename _Ttesttype::int_type int_type; + const char_type c1(0); + const char_type c2 = c1; + const int_type i(0); + constexpr auto v1(_Ttesttype::eq(c1, c2)); + constexpr auto v2(_Ttesttype::lt(c1, c2)); + constexpr auto v3(_Ttesttype::to_char_type(i)); + constexpr auto v4(_Ttesttype::to_int_type(c1)); + constexpr auto v5(_Ttesttype::eq_int_type(i, i)); + constexpr auto v6(_Ttesttype::eof()); + constexpr auto v7(_Ttesttype::not_eof(i)); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()>(); +#ifdef _GLIBCXX_USE_WCHAR_T + test.operator()>(); +#endif + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..494a8dedd6f --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_functions.cc @@ -0,0 +1,54 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr _Ttesttype a = { }; + constexpr auto v1 = a.size(); + constexpr auto v2 = a.max_size(); + constexpr auto v3 = a.empty(); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/bitset/cons/constexpr.cc b/libstdc++-v3/testsuite/23_containers/bitset/cons/constexpr.cc new file mode 100644 index 00000000000..aea50301375 --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/bitset/cons/constexpr.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test1; + test1.operator()>(); + test1.operator()>(); + test1.operator()>(); + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator(), unsigned long long>(); + test2.operator(), unsigned long long>(); + test2.operator(), unsigned long long>(); + + return 0; +} diff --git a/libstdc++-v3/testsuite/23_containers/bitset/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/23_containers/bitset/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..ac9a07f379c --- /dev/null +++ b/libstdc++-v3/testsuite/23_containers/bitset/requirements/constexpr_functions.cc @@ -0,0 +1,55 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr _Ttesttype obj; + constexpr auto v1 = obj.size(); + // constexpr auto v2 = obj[4]; + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()>(); + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/24_iterators/istream_iterator/cons/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/istream_iterator/cons/constexpr.cc new file mode 100644 index 00000000000..20b41997303 --- /dev/null +++ b/libstdc++-v3/testsuite/24_iterators/istream_iterator/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc new file mode 100644 index 00000000000..0a6980ec1f0 --- /dev/null +++ b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()>>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/complex/cons/constexpr.cc b/libstdc++-v3/testsuite/26_numerics/complex/cons/constexpr.cc new file mode 100644 index 00000000000..13d3c81685f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/complex/cons/constexpr.cc @@ -0,0 +1,37 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test1; + test1.operator()>(); + test1.operator()>(); + test1.operator()>(); + + __gnu_test::constexpr_single_value_constructible test2; + test2.operator(), float>(); + test2.operator(), double>(); + test2.operator(), long double>(); + + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/complex/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/complex/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..74f7bf5515f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/complex/requirements/constexpr_functions.cc @@ -0,0 +1,57 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + typedef typename _Ttesttype::_ComplexT _ComplexT; + const _ComplexT cc = { 1.1 }; + constexpr _Ttesttype a(cc); + constexpr auto v1 = a.real(); + constexpr auto v2 = a.imag(); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + test.operator()>(); + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_data.cc new file mode 100644 index 00000000000..7f82bfee55f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_data.cc @@ -0,0 +1,57 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::block_size); + constexpr auto v2(_Ttesttype::used_block); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + typedef std::discard_block_engine + < + std::subtract_with_carry_engine, + 389, 24 + > type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..faec5bfad2f --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/discard_block_engine/requirements/constexpr_functions.cc @@ -0,0 +1,57 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::discard_block_engine + < + std::subtract_with_carry_engine, + 389, 24 + > type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..2b84ec855df --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/independent_bits_engine/requirements/constexpr_functions.cc @@ -0,0 +1,60 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::independent_bits_engine + < + std::subtract_with_carry_engine + < + uint_fast64_t, 48, 5, 12 + >, + 48, uint_fast64_t + > type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_data.cc new file mode 100644 index 00000000000..e7e9fc05311 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_data.cc @@ -0,0 +1,55 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::multiplier); + constexpr auto v2(_Ttesttype::increment); + constexpr auto v3(_Ttesttype::modulus); + constexpr auto v4(_Ttesttype::default_seed); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + typedef std::linear_congruential_engine type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..cff1a67caf1 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/linear_congruential_engine/requirements/constexpr_functions.cc @@ -0,0 +1,53 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::linear_congruential_engine type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_data.cc new file mode 100644 index 00000000000..17c89e13bf9 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_data.cc @@ -0,0 +1,65 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::word_size); + constexpr auto v2(_Ttesttype::state_size); + constexpr auto v3(_Ttesttype::shift_size); + constexpr auto v4(_Ttesttype::mask_bits); + constexpr auto v5(_Ttesttype::xor_mask); + constexpr auto v6(_Ttesttype::tempering_u); + constexpr auto v7(_Ttesttype::tempering_d); + constexpr auto v8(_Ttesttype::tempering_s); + constexpr auto v9(_Ttesttype::tempering_b); + constexpr auto v10(_Ttesttype::tempering_t); + constexpr auto v11(_Ttesttype::tempering_c); + constexpr auto v12(_Ttesttype::tempering_l); + constexpr auto v13(_Ttesttype::initialization_multiplier); + constexpr auto v14(_Ttesttype::default_seed); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + typedef std::mt19937 type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..dd350e7fbd8 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/mersenne_twister_engine/requirements/constexpr_functions.cc @@ -0,0 +1,53 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::mt19937 type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_data.cc new file mode 100644 index 00000000000..8a158fb9a42 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_data.cc @@ -0,0 +1,59 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::table_size); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + typedef std::shuffle_order_engine + < + std::linear_congruential_engine + < + uint_fast32_t,16807UL, 0UL, 2147483647UL + >, + 256 + > type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..65e2e5612d5 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/shuffle_order_engine/requirements/constexpr_functions.cc @@ -0,0 +1,60 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::shuffle_order_engine + < + std::linear_congruential_engine + < + uint_fast32_t,16807UL, 0UL, 2147483647UL + >, + 256 + > type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_data.cc new file mode 100644 index 00000000000..0b51727b1cd --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_data.cc @@ -0,0 +1,55 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::word_size); + constexpr auto v2(_Ttesttype::short_lag); + constexpr auto v3(_Ttesttype::long_lag); + constexpr auto v4(_Ttesttype::default_seed); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + typedef std::ranlux24_base type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_functions.cc new file mode 100644 index 00000000000..b05710a9e67 --- /dev/null +++ b/libstdc++-v3/testsuite/26_numerics/random/subtract_with_carry_engine/requirements/constexpr_functions.cc @@ -0,0 +1,53 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_functions + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::min()); + constexpr auto v2(_Ttesttype::max()); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_functions test; + typedef std::ranlux24_base type; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc index a7adff4d3f4..8e97d329942 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc @@ -34,5 +34,5 @@ void test01() } // { dg-error "synthesized" "" { target *-*-* } 33 } // { dg-error "within this context" "" { target *-*-* } 26 } -// { dg-error "is private" "" { target *-*-* } 788 } +// { dg-error "is private" "" { target *-*-* } 789 } // { dg-error "operator=" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc index 44f7af87da8..6e527cdc262 100644 --- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc @@ -34,5 +34,5 @@ void test02() } // { dg-error "within this context" "" { target *-*-* } 26 } // { dg-error "synthesized" "" { target *-*-* } 33 } -// { dg-error "is private" "" { target *-*-* } 785 } +// { dg-error "is private" "" { target *-*-* } 786 } // { dg-error "copy constructor" "" { target *-*-* } 0 } diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc new file mode 100644 index 00000000000..349f7f9f2d0 --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/fmtflags/constexpr_operators.cc @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_bitwise_operators(); + return 0; +} diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc new file mode 100644 index 00000000000..fd3ce10553b --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/iostate/constexpr_operators.cc @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_bitwise_operators(); + return 0; +} diff --git a/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc new file mode 100644 index 00000000000..66041b87e1f --- /dev/null +++ b/libstdc++-v3/testsuite/27_io/ios_base/types/openmode/constexpr_operators.cc @@ -0,0 +1,28 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_bitwise_operators(); + return 0; +} diff --git a/libstdc++-v3/testsuite/28_regex/05_constants/syntax_option_type.cc b/libstdc++-v3/testsuite/28_regex/05_constants/syntax_option_type.cc index 2aebf46d19e..71a11ef2106 100644 --- a/libstdc++-v3/testsuite/28_regex/05_constants/syntax_option_type.cc +++ b/libstdc++-v3/testsuite/28_regex/05_constants/syntax_option_type.cc @@ -23,29 +23,68 @@ // 28.5.1 #include -#include void test01() { - bool test __attribute__((unused)) = true; + std::regex_constants::syntax_option_type option { }; + option = option | std::regex_constants::icase; + option = option | std::regex_constants::nosubs; + option = option | std::regex_constants::optimize; + option = option | std::regex_constants::collate; + option = option | std::regex_constants::ECMAScript; + option = option | std::regex_constants::basic; + option = option | std::regex_constants::extended; + option = option | std::regex_constants::awk; + option = option | std::regex_constants::grep; + option = option | std::regex_constants::egrep; +} + +void +test02() +{ + std::regex_constants::syntax_option_type option { }; + option = option & std::regex_constants::icase; + option = option & std::regex_constants::nosubs; + option = option & std::regex_constants::optimize; + option = option & std::regex_constants::collate; + option = option & std::regex_constants::ECMAScript; + option = option & std::regex_constants::basic; + option = option & std::regex_constants::extended; + option = option & std::regex_constants::awk; + option = option & std::regex_constants::grep; + option = option & std::regex_constants::egrep; +} - std::regex_constants::syntax_option_type option = 0; +void +test03() +{ + std::regex_constants::syntax_option_type option { }; + option = ~std::regex_constants::icase; + option = ~std::regex_constants::nosubs; + option = ~std::regex_constants::optimize; + option = ~std::regex_constants::collate; + option = ~std::regex_constants::ECMAScript; + option = ~std::regex_constants::basic; + option = ~std::regex_constants::extended; + option = ~std::regex_constants::awk; + option = ~std::regex_constants::grep; + option = ~std::regex_constants::egrep; +} - option |= std::regex_constants::icase; - option |= std::regex_constants::nosubs; - option |= std::regex_constants::optimize; - option |= std::regex_constants::collate; - option |= std::regex_constants::ECMAScript; - option |= std::regex_constants::basic; - option |= std::regex_constants::extended; - option |= std::regex_constants::awk; - option |= std::regex_constants::grep; - option |= std::regex_constants::egrep; +void +test04_constexpr() +{ + using namespace std::regex_constants; + constexpr auto a1 = icase | awk; + constexpr auto a2 = icase & awk; + constexpr auto a3 = ~grep; } int main() { test01(); + test02(); + test03(); return 0; } diff --git a/libstdc++-v3/testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc new file mode 100644 index 00000000000..7db1bbd5a4a --- /dev/null +++ b/libstdc++-v3/testsuite/28_regex/08_basic_regex/requirements/constexpr_data.cc @@ -0,0 +1,61 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v1(_Ttesttype::icase); + constexpr auto v2(_Ttesttype::nosubs); + constexpr auto v3(_Ttesttype::optimize); + constexpr auto v4(_Ttesttype::collate); + constexpr auto v5(_Ttesttype::ECMAScript); + constexpr auto v6(_Ttesttype::basic); + constexpr auto v7(_Ttesttype::extended); + constexpr auto v8(_Ttesttype::awk); + constexpr auto v9(_Ttesttype::grep); + constexpr auto v10(_Ttesttype::egrep); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()(); + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc index 66f5a81a5e5..9272c7eb3da 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "ambiguous" "" { target *-*-* } 522 } +// { dg-error "deleted" "" { target *-*-* } 544 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/constexpr.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/constexpr.cc new file mode 100644 index 00000000000..875c5490053 --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/constexpr.cc @@ -0,0 +1,32 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_single_value_constructible test; + + // test.operator(), int>(); + __gnu_cxx::typelist::apply_generator(test, __gnu_test::atomics_tl(), + __gnu_test::integral_types::type()); + return 0; +} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc index 69b1eff1297..19b3a150c19 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 561 } +// { dg-error "deleted" "" { target *-*-* } 583 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/assign_neg.cc index 9405e459bf8..fad25935446 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/assign_neg.cc @@ -26,6 +26,6 @@ void test01() typedef std::atomic_address test_type; test_type t1; test_type t2; - t1 = t2; // { dg-error "ambiguous" } + t1 = t2; // { dg-error "deleted" } } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/constexpr.cc b/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/constexpr.cc new file mode 100644 index 00000000000..6b4963512a4 --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/atomic_address/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_single_value_constructible test; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c b/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c deleted file mode 100644 index 3fd2f2c799d..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/clear/1.c +++ /dev/null @@ -1,34 +0,0 @@ -// { dg-options "-x c -shared-libgcc -lstdc++" } - -// 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 - -// libstdc++/40826 -// libstdc++/40654 -int main() -{ - atomic_flag f = ATOMIC_FLAG_INIT; - - atomic_flag_clear(&f); // set to false - assert( false == atomic_flag_test_and_set(&f) ); // return previous false, set to true - assert( true == atomic_flag_test_and_set(&f) ); // return true - - return 0; -} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc index b7724403412..b91de112650 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_flag/cons/1.cc @@ -18,7 +18,7 @@ // with this library; see the file COPYING3. If not see // . -#include +#include void test01() { diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.c b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.c deleted file mode 100644 index 025fdcb08e5..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/explicit.c +++ /dev/null @@ -1,30 +0,0 @@ -// { dg-options "-x c -shared-libgcc -lstdc++" } - -// Copyright (C) 2008, 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 - -int main() -{ - atomic_flag af = ATOMIC_FLAG_INIT; - - if (!atomic_flag_test_and_set_explicit(&af, memory_order_acquire)) - atomic_flag_clear_explicit(&af, memory_order_release); - - return 0; -} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.c b/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.c deleted file mode 100644 index 1ab92948416..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/atomic_flag/test_and_set/implicit.c +++ /dev/null @@ -1,30 +0,0 @@ -// { dg-options "-x c -shared-libgcc -lstdc++" } - -// Copyright (C) 2008, 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 - -int main() -{ - atomic_flag af = ATOMIC_FLAG_INIT; - - if (!atomic_flag_test_and_set(&af)) - atomic_flag_clear(&af); - - return 0; -} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc index 751c6cdc696..12da321abd8 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc @@ -29,5 +29,5 @@ int main() return 0; } -// { dg-error "ambiguous" "" { target *-*-* } 522 } +// { dg-error "deleted" "" { target *-*-* } 544 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/constexpr.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/constexpr.cc new file mode 100644 index 00000000000..a91db8d66a0 --- /dev/null +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/constexpr.cc @@ -0,0 +1,31 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_single_value_constructible test; + __gnu_cxx::typelist::apply_generator(test, + __gnu_test::atomic_integrals::type(), + __gnu_test::integral_types::type()); + return 0; +} diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc index 976a6991d43..e334f1b0447 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc @@ -29,5 +29,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 561 } +// { dg-error "deleted" "" { target *-*-* } 583 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc index 2a112c95838..b2f1ea4e3bf 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc @@ -27,7 +27,7 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 405 } -// { dg-error "operator" "" { target *-*-* } 406 } -// { dg-error "operator" "" { target *-*-* } 407 } +// { dg-error "operator" "" { target *-*-* } 427 } +// { dg-error "operator" "" { target *-*-* } 428 } +// { dg-error "operator" "" { target *-*-* } 429 } // { dg-excess-errors "In file included from" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc index 974c947e664..dd84c836d9b 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc @@ -28,6 +28,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 376 } -// { dg-error "operator" "" { target *-*-* } 377 } -// { dg-error "operator" "" { target *-*-* } 378 } +// { dg-error "operator" "" { target *-*-* } 384 } +// { dg-error "operator" "" { target *-*-* } 385 } +// { dg-error "operator" "" { target *-*-* } 386 } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc index 4927fcf1854..90b75556d18 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc @@ -28,6 +28,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 354 } -// { dg-error "operator" "" { target *-*-* } 355 } -// { dg-error "operator" "" { target *-*-* } 356 } +// { dg-error "operator" "" { target *-*-* } 362 } +// { dg-error "operator" "" { target *-*-* } 363 } +// { dg-error "operator" "" { target *-*-* } 364 } diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc index c0419c9b8d8..022cd90b250 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010 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 @@ -22,24 +22,91 @@ namespace gnu { -#ifndef ATOMIC_INTEGRAL_LOCK_FREE -# error "ATOMIC_INTEGRAL_LOCK_FREE must be a macro" +#ifndef ATOMIC_CHAR_LOCK_FREE +# error "ATOMIC_CHAR_LOCK_FREE must be a macro" #else -# if ATOMIC_INTEGRAL_LOCK_FREE != 0 \ - && ATOMIC_INTEGRAL_LOCK_FREE != 1 && ATOMIC_INTEGRAL_LOCK_FREE != 2 -# error "ATOMIC_INTEGRAL_LOCK_FREE must be 0, 1, or 2" +# if ATOMIC_CHAR_LOCK_FREE != 0 \ + && ATOMIC_CHAR_LOCK_FREE != 1 && ATOMIC_CHAR_LOCK_FREE != 2 +# error "ATOMIC_CHAR_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_CHAR16_T_LOCK_FREE +# error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro" +#else +# if ATOMIC_CHAR16_T_LOCK_FREE != 0 \ + && ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2 +# error "ATOMIC_CHAR16_T_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_CHAR32_T_LOCK_FREE +# error "ATOMIC_CHAR32_T_LOCK_FREE must be a macro" +#else +# if ATOMIC_CHAR32_T_LOCK_FREE != 0 \ + && ATOMIC_CHAR32_T_LOCK_FREE != 1 && ATOMIC_CHAR32_T_LOCK_FREE != 2 +# error "ATOMIC_CHAR32_T_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_WCHAR_T_LOCK_FREE +# error "ATOMIC_WCHAR_T_LOCK_FREE must be a macro" +#else +# if ATOMIC_WCHAR_T_LOCK_FREE != 0 \ + && ATOMIC_WCHAR_T_LOCK_FREE != 1 && ATOMIC_WCHAR_T_LOCK_FREE != 2 +# error "ATOMIC_WCHAR_T_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_SHORT_LOCK_FREE +# error "ATOMIC_SHORT_LOCK_FREE must be a macro" +#else +# if ATOMIC_SHORT_LOCK_FREE != 0 \ + && ATOMIC_SHORT_LOCK_FREE != 1 && ATOMIC_SHORT_LOCK_FREE != 2 +# error "ATOMIC_SHORT_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_INT_LOCK_FREE +# error "ATOMIC_INT_LOCK_FREE must be a macro" +#else +# if ATOMIC_INT_LOCK_FREE != 0 \ + && ATOMIC_INT_LOCK_FREE != 1 && ATOMIC_INT_LOCK_FREE != 2 +# error "ATOMIC_INT_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_LONG_LOCK_FREE +# error "ATOMIC_LONG_LOCK_FREE must be a macro" +#else +# if ATOMIC_LONG_LOCK_FREE != 0 \ + && ATOMIC_LONG_LOCK_FREE != 1 && ATOMIC_LONG_LOCK_FREE != 2 +# error "ATOMIC_LONG_LOCK_FREE must be 0, 1, or 2" +# endif +#endif + +#ifndef ATOMIC_LLONG_LOCK_FREE +# error "ATOMIC_LLONG_LOCK_FREE must be a macro" +#else +# if ATOMIC_LLONG_LOCK_FREE != 0 \ + && ATOMIC_LLONG_LOCK_FREE != 1 && ATOMIC_LLONG_LOCK_FREE != 2 +# error "ATOMIC_LLONG_LOCK_FREE must be 0, 1, or 2" # endif #endif #ifndef ATOMIC_ADDRESS_LOCK_FREE # error "ATOMIC_ADDRESS_LOCK_FREE must be a macro" -# if ATOMIC_INTEGRAL_LOCK_FREE != 0 \ - && ATOMIC_INTEGRAL_LOCK_FREE != 1 && ATOMIC_INTEGRAL_LOCK_FREE != 2 -# error "ATOMIC_INTEGRAL_LOCK_FREE must be 0, 1, or 2" +# if ATOMIC_ADDRESS_LOCK_FREE != 0 \ + && ATOMIC_ADDRESS_LOCK_FREE != 1 && ATOMIC_ADDRESS_LOCK_FREE != 2 +# error "ATOMIC_ADDRESS_LOCK_FREE must be 0, 1, or 2" # endif #endif #ifndef ATOMIC_FLAG_INIT #error "ATOMIC_FLAG_INIT_must_be_a_macro" #endif + +#ifndef ATOMIC_VAR_INIT + #error "ATOMIC_VAR_INIT_must_be_a_macro" +#endif } diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc index ce1e04359ad..13e4949e9b1 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2008, 2009, 2010 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 @@ -69,7 +69,6 @@ void test01() using std::atomic_intptr_t; using std::atomic_uintptr_t; using std::atomic_size_t; - using std::atomic_ssize_t; using std::atomic_ptrdiff_t; using std::atomic_intmax_t; using std::atomic_uintmax_t; diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc index cbdb5e6fcb2..57907734304 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc @@ -1,7 +1,7 @@ // { dg-options "-std=gnu++0x" } // { dg-do compile } -// Copyright (C) 2009 Free Software Foundation, Inc. +// Copyright (C) 2009, 2010 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 @@ -49,6 +49,29 @@ void test01() using atomic_char16_t; using atomic_char32_t; + using atomic_int_least8_t; + using atomic_uint_least8_t; + using atomic_int_least16_t; + using atomic_uint_least16_t; + using atomic_int_least32_t; + using atomic_uint_least32_t; + using atomic_int_least64_t; + using atomic_uint_least64_t; + using atomic_int_fast8_t; + using atomic_uint_fast8_t; + using atomic_int_fast16_t; + using atomic_uint_fast16_t; + using atomic_int_fast32_t; + using atomic_uint_fast32_t; + using atomic_int_fast64_t; + using atomic_uint_fast64_t; + using atomic_intptr_t; + using atomic_uintptr_t; + using atomic_size_t; + using atomic_ptrdiff_t; + using atomic_intmax_t; + using atomic_uintmax_t; + using atomic_address; } @@ -76,3 +99,72 @@ void test01() // { dg-error "expected nested-name-specifier" "" { target *-*-* } 49 } // { dg-error "expected nested-name-specifier" "" { target *-*-* } 50 } // { dg-error "expected nested-name-specifier" "" { target *-*-* } 52 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 53 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 54 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 55 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 56 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 57 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 58 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 59 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 60 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 61 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 62 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 63 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 64 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 65 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 66 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 67 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 68 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 69 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 70 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 71 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 72 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 73 } +// { dg-error "expected nested-name-specifier" "" { target *-*-* } 75 } + +// { dg-error "declared" "" { target *-*-* } 26 } +// { dg-error "declared" "" { target *-*-* } 27 } +// { dg-error "declared" "" { target *-*-* } 28 } +// { dg-error "declared" "" { target *-*-* } 29 } +// { dg-error "declared" "" { target *-*-* } 30 } +// { dg-error "declared" "" { target *-*-* } 31 } +// { dg-error "declared" "" { target *-*-* } 32 } +// { dg-error "declared" "" { target *-*-* } 34 } +// { dg-error "declared" "" { target *-*-* } 36 } +// { dg-error "declared" "" { target *-*-* } 37 } +// { dg-error "declared" "" { target *-*-* } 38 } +// { dg-error "declared" "" { target *-*-* } 39 } +// { dg-error "declared" "" { target *-*-* } 40 } +// { dg-error "declared" "" { target *-*-* } 41 } +// { dg-error "declared" "" { target *-*-* } 42 } +// { dg-error "declared" "" { target *-*-* } 43 } +// { dg-error "declared" "" { target *-*-* } 44 } +// { dg-error "declared" "" { target *-*-* } 45 } +// { dg-error "declared" "" { target *-*-* } 46 } +// { dg-error "declared" "" { target *-*-* } 47 } +// { dg-error "declared" "" { target *-*-* } 48 } +// { dg-error "declared" "" { target *-*-* } 49 } +// { dg-error "declared" "" { target *-*-* } 50 } +// { dg-error "declared" "" { target *-*-* } 52 } +// { dg-error "declared" "" { target *-*-* } 53 } +// { dg-error "declared" "" { target *-*-* } 54 } +// { dg-error "declared" "" { target *-*-* } 55 } +// { dg-error "declared" "" { target *-*-* } 56 } +// { dg-error "declared" "" { target *-*-* } 57 } +// { dg-error "declared" "" { target *-*-* } 58 } +// { dg-error "declared" "" { target *-*-* } 59 } +// { dg-error "declared" "" { target *-*-* } 60 } +// { dg-error "declared" "" { target *-*-* } 61 } +// { dg-error "declared" "" { target *-*-* } 62 } +// { dg-error "declared" "" { target *-*-* } 63 } +// { dg-error "declared" "" { target *-*-* } 64 } +// { dg-error "declared" "" { target *-*-* } 65 } +// { dg-error "declared" "" { target *-*-* } 66 } +// { dg-error "declared" "" { target *-*-* } 67 } +// { dg-error "declared" "" { target *-*-* } 68 } +// { dg-error "declared" "" { target *-*-* } 69 } +// { dg-error "declared" "" { target *-*-* } 70 } +// { dg-error "declared" "" { target *-*-* } 71 } +// { dg-error "declared" "" { target *-*-* } 72 } +// { dg-error "declared" "" { target *-*-* } 73 } +// { dg-error "declared" "" { target *-*-* } 75 } diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c deleted file mode 100644 index a8abfbe929f..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/debug_mode.c +++ /dev/null @@ -1,22 +0,0 @@ -// { dg-options "-x c -D_GLIBCXX_DEBUG" } -// { dg-do compile } - -// Copyright (C) 2008, 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 -// . - -// libstdc++/36130 -#include diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/functions.c b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/functions.c deleted file mode 100644 index d56937678e2..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/functions.c +++ /dev/null @@ -1,36 +0,0 @@ -// { dg-options "-x c" } -// { dg-do compile } - -// Copyright (C) 2008, 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 - -int main() -{ - atomic_flag f; - atomic_flag* p = &f; - memory_order m = memory_order_relaxed; - - // For position only. - atomic_flag_test_and_set(p); - atomic_flag_test_and_set_explicit(p, m); - atomic_flag_clear(p); - atomic_flag_clear_explicit(p, m); - - return 0; -} diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/macros.c b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/macros.c deleted file mode 100644 index 7d6992e4a38..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/macros.c +++ /dev/null @@ -1,114 +0,0 @@ -// { dg-options "-x c" } -// { dg-do compile } - -// Copyright (C) 2008, 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 - -int main() -{ -#ifndef ATOMIC_INTEGRAL_LOCK_FREE - #error "ATOMIC_INTEGRAL_LOCK_FREE_must_be_a_macro" -#endif - -#ifndef ATOMIC_ADDRESS_LOCK_FREE - #error "ATOMIC_ADDRESS_LOCK_FREE_must_be_a_macro" -#endif - -#ifndef ATOMIC_FLAG_INIT - #error "ATOMIC_FLAG_INIT_must_be_a_macro" -#endif - -#ifndef atomic_is_lock_free - #error "atomic_is_lock_free_must_be_a_macro" -#endif - -#ifndef atomic_load - #error "atomic_load_must_be_a_macro" -#endif - -#ifndef atomic_load_explicit - #error "atomic_load_explicit_must_be_a_macro" -#endif - -#ifndef atomic_store_explicit - #error "atomic_store_explicit_must_be_a_macro" -#endif - -#ifndef atomic_store - #error "atomic_store_must_be_a_macro" -#endif - -#ifndef atomic_exchange_explicit - #error "atomic_exchange_explicit_must_be_a_macro" -#endif - -#ifndef atomic_exchange - #error "atomic_exchange_must_be_a_macro" -#endif - -#ifndef atomic_compare_exchange - #error "atomic_compare_exchange_must_be_a_macro" -#endif - -#ifndef atomic_compare_exchange_explicit - #error "atomic_compare_exchange_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_add_explicit - #error "atomic_fetch_add_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_add - #error "atomic_fetch_add_must_be_a_macro" -#endif - -#ifndef atomic_fetch_sub_explicit - #error "atomic_fetch_sub_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_sub - #error "atomic_fetch_sub_must_be_a_macro" -#endif - -#ifndef atomic_fetch_and_explicit - #error "atomic_fetch_and_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_and - #error "atomic_fetch_and_must_be_a_macro" -#endif - -#ifndef atomic_fetch_or_explicit - #error "atomic_fetch_or_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_or - #error "atomic_fetch_or_must_be_a_macro" -#endif - -#ifndef atomic_fetch_xor_explicit - #error "atomic_fetch_xor_explicit_must_be_a_macro" -#endif - -#ifndef atomic_fetch_xor - #error "atomic_fetch_xor_must_be_a_macro" -#endif - - return 0; -} diff --git a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/types.c b/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/types.c deleted file mode 100644 index 48d6d926759..00000000000 --- a/libstdc++-v3/testsuite/29_atomics/headers/stdatomic.h/types.c +++ /dev/null @@ -1,77 +0,0 @@ -// { dg-options "-x c" } -// { dg-do compile } - -// Copyright (C) 2008, 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 - -void test01() -{ - typedef memory_order t_01; - memory_order t_02 __attribute__((unused)) = memory_order_relaxed; - memory_order t_03 __attribute__((unused)) = memory_order_acquire; - memory_order t_04 __attribute__((unused)) = memory_order_release; - memory_order t_05 __attribute__((unused)) = memory_order_acq_rel; - memory_order t_06 __attribute__((unused)) = memory_order_seq_cst; - - typedef atomic_flag t_07; - - // atomics for builtins types - typedef atomic_bool t_08; - typedef atomic_char t_09; - typedef atomic_schar t_10; - typedef atomic_uchar t_11; - typedef atomic_short t_12; - typedef atomic_ushort t_13; - typedef atomic_int t_14; - typedef atomic_uint t_15; - typedef atomic_long t_16; - typedef atomic_ulong t_17; - typedef atomic_llong t_18; - typedef atomic_ullong t_19; - typedef atomic_wchar_t t_20; - typedef atomic_char16_t t_21; - typedef atomic_char32_t t_22; - - // atomics for standard typedefs - typedef atomic_int_least8_t t_23; - typedef atomic_uint_least8_t t_24; - typedef atomic_int_least16_t t_25; - typedef atomic_uint_least16_t t_26; - typedef atomic_int_least32_t t_27; - typedef atomic_uint_least32_t t_28; - typedef atomic_int_least64_t t_29; - typedef atomic_uint_least64_t t_30; - typedef atomic_int_fast8_t t_31; - typedef atomic_uint_fast8_t t_32; - typedef atomic_int_fast16_t t_33; - typedef atomic_uint_fast16_t t_34; - typedef atomic_int_fast32_t t_35; - typedef atomic_uint_fast32_t t_36; - typedef atomic_int_fast64_t t_37; - typedef atomic_uint_fast64_t t_38; - typedef atomic_intptr_t t_39; - typedef atomic_uintptr_t t_40; - typedef atomic_size_t t_41; - typedef atomic_ssize_t t_42; - typedef atomic_ptrdiff_t t_43; - typedef atomic_intmax_t t_44; - typedef atomic_uintmax_t t_45; - - typedef atomic_address t_46; -} diff --git a/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc b/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc new file mode 100644 index 00000000000..9518b72ea92 --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/call_once/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc new file mode 100644 index 00000000000..9518b72ea92 --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/mutex/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc b/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc new file mode 100644 index 00000000000..52f3b5d3d4d --- /dev/null +++ b/libstdc++-v3/testsuite/30_threads/once_flag/cons/constexpr.cc @@ -0,0 +1,29 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +int main() +{ + __gnu_test::constexpr_default_constructible test; + test.operator()(); + return 0; +} diff --git a/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc b/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc index 471c4482b2d..7f8072427ca 100644 --- a/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc +++ b/libstdc++-v3/testsuite/ext/profile/mutex_extensions.cc @@ -22,4 +22,4 @@ #include -// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 196 } +// { dg-error "Cannot use -D_GLIBCXX_PROFILE with " "" { target *-*-* } 223 } diff --git a/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc new file mode 100644 index 00000000000..a44cace607c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/4_metaprogramming/integral_constant/requirements/constexpr_data.cc @@ -0,0 +1,52 @@ +// { dg-do compile } +// { dg-options "-std=gnu++0x" } + +// Copyright (C) 2010 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 + +namespace __gnu_test +{ + struct constexpr_member_data + { + template + void + operator()() + { + struct _Concept + { + void __constraint() + { + constexpr auto v(_Ttesttype::value); + } + }; + + _Concept c; + c.__constraint(); + } + }; +} + +int main() +{ + __gnu_test::constexpr_member_data test; + test.operator()>(); + test.operator()>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/util/testsuite_abi.cc b/libstdc++-v3/testsuite/util/testsuite_abi.cc index 4921716b75c..91f4aefde61 100644 --- a/libstdc++-v3/testsuite/util/testsuite_abi.cc +++ b/libstdc++-v3/testsuite/util/testsuite_abi.cc @@ -193,6 +193,7 @@ check_version(symbol& test, bool added) known_versions.push_back("GLIBCXX_3.4.13"); known_versions.push_back("GLIBCXX_3.4.14"); known_versions.push_back("GLIBCXX_3.4.15"); + known_versions.push_back("GLIBCXX_3.4.16"); known_versions.push_back("GLIBCXX_LDBL_3.4"); known_versions.push_back("GLIBCXX_LDBL_3.4.7"); known_versions.push_back("GLIBCXX_LDBL_3.4.10"); diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index 1db0ca08c79..4da2634367c 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -339,6 +339,14 @@ namespace __gnu_test typedef transform::type atomics_tl; #endif + template + struct numeric_limits + { + typedef Tp value_type; + typedef std::numeric_limits type; + }; + + typedef transform::type limits_tl; struct has_increment_operators { @@ -384,6 +392,20 @@ namespace __gnu_test } }; +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + template + void + constexpr_bitwise_operators() + { + constexpr _Tp a = _Tp(); + constexpr _Tp b = _Tp(); + constexpr _Tp c1 = a | b; + constexpr _Tp c2 = a & b; + constexpr _Tp c3 = a ^ b; + constexpr _Tp c4 = ~b; + } +#endif + template void bitwise_operators() @@ -588,6 +610,53 @@ namespace __gnu_test } }; + // Generator to test constexpr constructor +#ifdef __GXX_EXPERIMENTAL_CXX0X__ + // Generator to test default constructor. + struct constexpr_default_constructible + { + template + void + operator()() + { + struct _Concept + { + // Have to have user-defined default ctor for this to work. + void __constraint() + { constexpr _Tp __v; } + }; + + void (_Concept::*__x)() __attribute__((unused)) + = &_Concept::__constraint; + } + }; + + struct constexpr_single_value_constructible + { + template + void + operator()() + { + struct _Concept + { + // Additional constraint on _Tbasetype needed. + // Either assume user-defined default ctor as per + // constexpr_default_constructible and provide no + // initializer, provide an initializer, or assume empty-list + // init-able. Choose the latter. + void __constraint() + { + constexpr _Tbasetype __v { }; + constexpr _Ttesttype __t(__v); + } + }; + + _Concept c; + c.__constraint(); + } + }; +#endif + // Generator to test direct list initialization #ifdef __GXX_EXPERIMENTAL_CXX0X__ struct direct_list_initializable -- cgit v1.2.3