Commit Graph

3456 Commits

Author SHA1 Message Date
Jonathan Wakely
3e9f67e6a2 Add std::apply for C++17
* doc/xml/manual/status_cxx2017.xml: Add missing LFTSv2 features.
	* doc/html/manual/status.html: Regenerate.
	* include/Makefile.am: Add new header.
	* include/Makefile.in: Regenerate.
	* include/bits/invoke.h: New header.
	(__invoke): Make constexpr. Add && to types in exception specification.
	* include/experimental/tuple (apply, __apply_impl): Fix non-reserved
	names. Include <bits/invoke.h> and use std::__invoke.
	* include/std/functional (__invfwd, __invoke_impl, __invoke): Move to
	new header.
	(invoke): Add && to types in exception specification.
	* include/std/tuple (apply, __apply_impl): Define for C++17.
	* testsuite/20_util/tuple/apply/1.cc: New test.
	* testsuite/20_util/tuple/element_access/get_neg.cc: Adjust dg-error
	lineno.

From-SVN: r239183
2016-08-06 01:06:02 +01:00
Jonathan Wakely
5f6acdfb0b Implement C++17 rounding functions for std::chrono (P0092R1)
* include/std/chrono (floor, ceil, round, abs): New for C++17.
	* testsuite/20_util/duration_cast/rounding.cc: New test.
	* testsuite/20_util/time_point_cast/rounding.cc: New test.
	* doc/xml/manual/status_cxx2017.xml: Update status table.
	* doc/html/manual/status.html: Regenerate.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Adjust
	dg-error lineno.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/duration/literals/range.cc: Likewise.

From-SVN: r239170
2016-08-05 14:52:59 +01:00
Jonathan Wakely
98e6e66233 Use __invoke in std::function internals
* include/std/functional (__callable_functor): Remove.
	(_Function_handler::_M_invoke): Use __invoke instead of
	__callable_functor or mem_fn.
	(function::_Callable): Use lvalue in result_of expression.
	(function): Remove TODO comments about allocators.
	* testsuite/20_util/function/cons/refqual.cc: New test.

From-SVN: r239166
2016-08-05 10:00:34 +01:00
Jonathan Wakely
42183d034d Define std::is_callable and std::is_nothrow_callable
* doc/xml/manual/status_cxx2017.xml: Update status table.
	* include/std/functional (__inv_unwrap): Move to <type_traits>.
	(__invoke_impl): Remove exception specifications.
	(__invoke, invoke): Add exception specifications using
	__is_nothrow_callable.
	* include/std/type_traits (__inv_unwrap): Move from <functional>.
	(__is_callable_impl, __call_is_nt, __call_is_nothrow): New helpers.
	(__is_callable, __is_nothrow_callable): New traits.
	(is_callable, is_callable_v): New C++17 traits.
	(is_nothrow_callable, is_nothrow_callable_v): Likewise.
	* testsuite/20_util/is_callable/requirements/
	explicit_instantiation.cc: New test.
	* testsuite/20_util/is_callable/requirements/
	explicit_instantiation_ext.cc: New test.
	* testsuite/20_util/is_callable/requirements/typedefs.cc: New test.
	* testsuite/20_util/is_callable/requirements/typedefs_ext.cc: New
	test.
	* testsuite/20_util/is_callable/value.cc: New test.
	* testsuite/20_util/is_callable/value_ext.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/
	explicit_instantiation.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/
	explicit_instantiation_ext.cc: New test.
	* testsuite/20_util/is_nothrow_callable/requirements/typedefs.cc:
	New test.
	* testsuite/20_util/is_nothrow_callable/requirements/typedefs_ext.cc:
	New test.
	* testsuite/20_util/is_nothrow_callable/value.cc: New test.
	* testsuite/20_util/is_nothrow_callable/value_ext.cc: New test.

From-SVN: r239145
2016-08-04 19:02:56 +01:00
Jonathan Wakely
9a8e528cf1 Define std::enable_shared_from_this::weak_from_this
* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Use
	effective target not dg-options. Move check for feature-test macro to:
	* testsuite/20_util/enable_shared_from_this/members/weak_from_this.cc:
	New test.

From-SVN: r239121
2016-08-04 13:33:10 +01:00
Jonathan Wakely
7d2035fafe Simplify std::__invoke_impl definitions
* include/std/functional (_Unwrap): Rename to __inv_unwrap.
	(__invfwd): Adjust.
	(__invoke_impl): Remove unused template parameters.
	* testsuite/20_util/function_objects/invoke/59768.cc: Remove unused
	parameter.
	* testsuite/20_util/function_objects/invoke/ref_ext.cc: Copy 59768.cc
	and test __invoke extension for C++11.

From-SVN: r239120
2016-08-04 12:09:29 +01:00
Jonathan Wakely
c7fdbdcdbd Define feature-test macro for std::enable_shared_from_this
* include/bits/shared_ptr_base.h (__cpp_lib_enable_shared_from_this):
	Define feature-test macro.
	* testsuite/20_util/enable_shared_from_this/members/reinit.cc: Test
	for the macro.

From-SVN: r239094
2016-08-03 20:10:06 +01:00
Jonathan Wakely
f21f4463ad Define std::shared_ptr::weak_type
* include/bits/shared_ptr.h (shared_ptr::weak_type): Define.
	* include/bits/shared_ptr_base.h (__shared_ptr::weak_type): Define.
	* testsuite/20_util/shared_ptr/cons/43820_neg.cc: Adjust dg-error.
	* testsuite/20_util/shared_ptr/requirements/weak_type.cc: New test.
	* testsuite/20_util/shared_ptr/cons/void_neg.cc: Likewise.

From-SVN: r239093
2016-08-03 20:09:57 +01:00
Jonathan Wakely
32eaac9c91 Define std::as_const
* include/std/utility (as_const): Define.
	* testsuite/20_util/as_const/1.cc: New test.
	* testsuite/20_util/as_const/rvalue_neg.cc: New test.

From-SVN: r239090
2016-08-03 19:11:23 +01:00
Jonathan Wakely
b7dabce5f3 Define std::owner_less<void> specialization (P0074R0)
* include/bits/shared_ptr.h (owner_less): Add default template
	argument.
	* include/bits/shared_ptr_base.h (_Sp_owner_less<void, void>): Define
	specialization.
	(owner_less<void>): Define specialization.
	* include/bits/stl_function.h (__cpp_lib_transparent_operators):
	Update value.
	* testsuite/20_util/owner_less/void.cc: New test.
	* testsuite/experimental/feat-cxx14.cc: Update macro value tested.

From-SVN: r239089
2016-08-03 19:11:18 +01:00
Jonathan Wakely
0bd9bdb4db Define __cpp_lib_generic_associative_lookup feature-test macro
* include/bits/stl_function.h: Remove commented-out macro.
	* include/bits/stl_tree.h (__cpp_lib_generic_associative_lookup):
	Define feature-test macro.
	* testsuite/experimental/feat-cxx14.cc: Add tests for more macros.

From-SVN: r239084
2016-08-03 17:42:31 +01:00
Jonathan Wakely
f8571e5150 Enable Mathematical Special Functions for C++17
* include/bits/c++config (_GLIBCXX_USE_STD_SPEC_FUNCS): Define for
	C++17, or for C++11/C++14 when __STDCPP_WANT_MATH_SPEC_FUNCS__ is
	true.
	* include/bits/specfun.h [!__STDCPP_WANT_MATH_SPEC_FUNCS__]: Don't
	do #error for C++17.
	* include/c_global/cmath: Check _GLIBCXX_USE_STD_SPEC_FUNCS instead
	of __STDCPP_WANT_MATH_SPEC_FUNCS__.
	* include/tr1/bessel_function.tcc: Likewise.
	* include/tr1/beta_function.tcc: Likewise.
	* include/tr1/cmath: Likewise.
	* include/tr1/ell_integral.tcc: Likewise.
	* include/tr1/exp_integral.tcc: Likewise.
	* include/tr1/gamma.tcc: Likewise.
	* include/tr1/hypergeometric.tcc: Likewise.
	* include/tr1/legendre_function.tcc: Likewise.
	* include/tr1/modified_bessel_func.tcc: Likewise.
	* include/tr1/poly_hermite.tcc: Likewise.
	* include/tr1/poly_laguerre.tcc: Likewise.
	* include/tr1/riemann_zeta.tcc: Likewise.
	* include/tr1/special_function_util.h: Likewise.
	* testsuite/26_numerics/headers/cmath/functions_std_c++17.cc: New.

From-SVN: r239081
2016-08-03 16:54:13 +01:00
Jonathan Wakely
27631a2542 Remove deprecated has_trivial_xxx traits
* include/std/type_traits (has_trivial_default_constructor): Remove.
	(has_trivial_copy_constructor, has_trivial_copy_assign): Likewise.
	* testsuite/20_util/has_trivial_copy_assign/requirements/
	explicit_instantiation.cc: Remove test.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust dg-error
	line number.
	* testsuite/20_util/has_trivial_copy_assign/requirements/typedefs.cc:
	Likewise.
	* testsuite/20_util/has_trivial_copy_assign/value.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_copy_constructor/value.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	explicit_instantiation.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/requirements/
	typedefs.cc: Likewise.
	* testsuite/20_util/has_trivial_default_constructor/value.cc:
	Likewise.
	* testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
	Check has_trivial_default_constructor, has_trivial_copy_constructor,
	and has_trivial_copy_assign are not defined.
	* testsuite/20_util/pair/requirements/dr801.cc: Remove commented out
	tests.
	* testsuite/20_util/tuple/requirements/dr801.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Adjust
	dg-error line number.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.

From-SVN: r239079
2016-08-03 16:18:30 +01:00
Jonathan Wakely
589a30d1a4 Fix std::wstring allocator tests
* testsuite/21_strings/basic_string/allocator/wchar_t/copy.cc:
	Remove reundant check for _GLIBCXX_USE_WCHAR_T and fix char type.
	* testsuite/21_strings/basic_string/allocator/wchar_t/copy_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/minimal.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/move_assign.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/noexcept.cc:
	Likewise.
	* testsuite/21_strings/basic_string/allocator/wchar_t/swap.cc:
	Likewise.

From-SVN: r238996
2016-08-02 20:34:36 +01:00
Jonathan Wakely
8bcd00bb13 Improve comments on check_v3_target_filesystem_ts
* testsuite/lib/libstdc++.exp (check_v3_target_filesystem_ts): Improve
	comments.

From-SVN: r238995
2016-08-02 20:34:30 +01:00
Jonathan Wakely
a4e1011c49 Move dg-error directives to relevant lines
* testsuite/19_diagnostics/error_code/operators/bool_neg.cc: Move
	dg-error to relevant line.
	* testsuite/19_diagnostics/error_condition/operators/bool_neg.cc:
	Likewise.
	* testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.

From-SVN: r238994
2016-08-02 20:34:25 +01:00
Jonathan Wakely
807bd0963e Skip C tests if test flags include C++ options
* testsuite/18_support/bad_exception/23591_thread-1.c: Skip test if
	options are present that aren't valid for C.
	* testsuite/abi/header_cxxabi.c: Likewise.

From-SVN: r238988
2016-08-02 14:32:26 +01:00
Jonathan Wakely
8c65cd3054 Test TR1 special functions without adding them to std
* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/
	check_value.cc: Do not add special functions to namespace std in TR1
	test.

From-SVN: r238987
2016-08-02 14:32:21 +01:00
Jonathan Wakely
196c9e7a7d Only run math special function tests for C++11 and later
* testsuite/ext/special_functions/conf_hyperg/check_nan.cc: Only
	run for C++11 and later.
	* testsuite/ext/special_functions/conf_hyperg/check_value.cc:
	Likewise.
	* testsuite/ext/special_functions/conf_hyperg/compile.cc: Likewise.
	* testsuite/ext/special_functions/hyperg/check_nan.cc: Likewise.
	* testsuite/ext/special_functions/hyperg/check_value.cc: Likewise.
	* testsuite/ext/special_functions/hyperg/compile.cc: Likewise.
	* testsuite/special_functions/01_assoc_laguerre/check_nan.cc:
	Likewise.
	* testsuite/special_functions/01_assoc_laguerre/check_value.cc:
	Likewise.
	* testsuite/special_functions/01_assoc_laguerre/compile.cc: Likewise.
	* testsuite/special_functions/01_assoc_laguerre/compile_2.cc:
	Likewise.
	* testsuite/special_functions/02_assoc_legendre/check_nan.cc:
	Likewise.
	* testsuite/special_functions/02_assoc_legendre/check_value.cc:
	Likewise.
	* testsuite/special_functions/02_assoc_legendre/compile.cc: Likewise.
	* testsuite/special_functions/02_assoc_legendre/compile_2.cc:
	* testsuite/special_functions/03_beta/check_nan.cc: Likewise.
	* testsuite/special_functions/03_beta/check_value.cc: Likewise.
	* testsuite/special_functions/03_beta/compile.cc: Likewise.
	* testsuite/special_functions/03_beta/compile_2.cc: Likewise.
	* testsuite/special_functions/04_comp_ellint_1/check_nan.cc: Likewise.
	* testsuite/special_functions/04_comp_ellint_1/check_value.cc:
	Likewise.
	* testsuite/special_functions/04_comp_ellint_1/compile.cc: Likewise.
	* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: Likewise.
	* testsuite/special_functions/05_comp_ellint_2/check_nan.cc: Likewise.
	* testsuite/special_functions/05_comp_ellint_2/check_value.cc:
	Likewise.
	* testsuite/special_functions/05_comp_ellint_2/compile.cc: Likewise.
	* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: Likewise.
	* testsuite/special_functions/06_comp_ellint_3/check_nan.cc: Likewise.
	* testsuite/special_functions/06_comp_ellint_3/check_value.cc:
	Likewise.
	* testsuite/special_functions/06_comp_ellint_3/compile.cc: Likewise.
	* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: Likewise.
	* testsuite/special_functions/07_cyl_bessel_i/check_nan.cc: Likewise.
	* testsuite/special_functions/07_cyl_bessel_i/check_value.cc:
	Likewise.
	* testsuite/special_functions/07_cyl_bessel_i/compile.cc: Likewise.
	* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: Likewise.
	* testsuite/special_functions/07_cyl_bessel_i/pr56216.cc: Likewise.
	* testsuite/special_functions/08_cyl_bessel_j/check_nan.cc: Likewise.
	* testsuite/special_functions/08_cyl_bessel_j/check_value.cc:
	Likewise.
	* testsuite/special_functions/08_cyl_bessel_j/compile.cc: Likewise.
	* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: Likewise.
	* testsuite/special_functions/09_cyl_bessel_k/check_nan.cc: Likewise.
	* testsuite/special_functions/09_cyl_bessel_k/check_value.cc:
	Likewise.
	* testsuite/special_functions/09_cyl_bessel_k/compile.cc: Likewise.
	* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: Likewise.
	* testsuite/special_functions/10_cyl_neumann/check_nan.cc: Likewise.
	* testsuite/special_functions/10_cyl_neumann/check_value.cc: Likewise.
	* testsuite/special_functions/10_cyl_neumann/compile.cc: Likewise.
	* testsuite/special_functions/10_cyl_neumann/compile_2.cc: Likewise.
	* testsuite/special_functions/11_ellint_1/check_nan.cc: Likewise.
	* testsuite/special_functions/11_ellint_1/check_value.cc: Likewise.
	* testsuite/special_functions/11_ellint_1/compile.cc: Likewise.
	* testsuite/special_functions/11_ellint_1/compile_2.cc: Likewise.
	* testsuite/special_functions/12_ellint_2/check_nan.cc: Likewise.
	* testsuite/special_functions/12_ellint_2/check_value.cc: Likewise.
	* testsuite/special_functions/12_ellint_2/compile.cc: Likewise.
	* testsuite/special_functions/12_ellint_2/compile_2.cc: Likewise.
	* testsuite/special_functions/13_ellint_3/check_nan.cc: Likewise.
	* testsuite/special_functions/13_ellint_3/check_value.cc: Likewise.
	* testsuite/special_functions/13_ellint_3/compile.cc: Likewise.
	* testsuite/special_functions/13_ellint_3/compile_2.cc: Likewise.
	* testsuite/special_functions/14_expint/check_nan.cc: Likewise.
	* testsuite/special_functions/14_expint/check_value.cc: Likewise.
	* testsuite/special_functions/14_expint/compile.cc: Likewise.
	* testsuite/special_functions/14_expint/compile_2.cc: Likewise.
	* testsuite/special_functions/15_hermite/check_nan.cc: Likewise.
	* testsuite/special_functions/15_hermite/check_value.cc: Likewise.
	* testsuite/special_functions/15_hermite/compile.cc: Likewise.
	* testsuite/special_functions/15_hermite/compile_2.cc: Likewise.
	* testsuite/special_functions/16_laguerre/check_nan.cc: Likewise.
	* testsuite/special_functions/16_laguerre/check_value.cc: Likewise.
	* testsuite/special_functions/16_laguerre/compile.cc: Likewise.
	* testsuite/special_functions/16_laguerre/compile_2.cc: Likewise.
	* testsuite/special_functions/17_legendre/check_nan.cc: Likewise.
	* testsuite/special_functions/17_legendre/check_value.cc: Likewise.
	* testsuite/special_functions/17_legendre/compile.cc: Likewise.
	* testsuite/special_functions/17_legendre/compile_2.cc: Likewise.
	* testsuite/special_functions/18_riemann_zeta/check_nan.cc: Likewise.
	* testsuite/special_functions/18_riemann_zeta/check_value.cc:
	Likewise.
	* testsuite/special_functions/18_riemann_zeta/compile.cc: Likewise.
	* testsuite/special_functions/18_riemann_zeta/compile_2.cc: Likewise.
	* testsuite/special_functions/19_sph_bessel/check_nan.cc: Likewise.
	* testsuite/special_functions/19_sph_bessel/check_value.cc: Likewise.
	* testsuite/special_functions/19_sph_bessel/compile.cc: Likewise.
	* testsuite/special_functions/19_sph_bessel/compile_2.cc: Likewise.
	* testsuite/special_functions/20_sph_legendre/check_nan.cc: Likewise.
	* testsuite/special_functions/20_sph_legendre/check_value.cc:
	Likewise.
	* testsuite/special_functions/20_sph_legendre/compile.cc: Likewise.
	* testsuite/special_functions/20_sph_legendre/compile_2.cc: Likewise.
	* testsuite/special_functions/21_sph_neumann/check_nan.cc: Likewise.
	* testsuite/special_functions/21_sph_neumann/check_value.cc: Likewise.
	* testsuite/special_functions/21_sph_neumann/compile.cc: Likewise.
	* testsuite/special_functions/21_sph_neumann/compile_2.cc: Likewise.

From-SVN: r238986
2016-08-02 14:32:16 +01:00
Jonathan Wakely
69332dba20 Make TR1 special function tests support C++98
* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/check_value.cc: Use __attribute__((unused)) instead
	of [[gnu::unused]].
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/check_value.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/check_value.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/check_value.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/check_value.cc: Likewise.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/check_value.cc: Likewise.

From-SVN: r238985
2016-08-02 14:32:02 +01:00
Jonathan Wakely
e877144da9 Skip scan-assembler test when -flto is used
* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc: Skip
	test if -flto used.

From-SVN: r238981
2016-08-02 11:02:25 +01:00
Jonathan Wakely
c1b6948e1b Support using -flto with libstdc++ testsuite
* testsuite/lib/libstdc++.exp (v3-build_support): Add -fno-lto to
	additional flags for compiling libtestc++.a objects.

From-SVN: r238978
2016-08-02 10:40:50 +01:00
Jonathan Wakely
92d58deefa Add non-const std::basic_string::data() for C++17
* include/bits/basic_string.h (data() const): Update comment.
	(data()): Add non-const overload for C++17.
	* testsuite/21_strings/basic_string/operations/data/char/2.cc: New.
	* testsuite/21_strings/basic_string/operations/data/wchar_t/2.cc: New.

From-SVN: r238963
2016-08-01 21:12:58 +01:00
Jonathan Wakely
9839ff60d0 Remove ignored "xfail" from dg-do compile directives
* testsuite/23_containers/unordered_map/requirements/53339.cc: Remove
	ignored "xfail" from { dg-do compile { xfail selector } } directive.
	* testsuite/23_containers/unordered_multimap/requirements/53339.cc:
	Likewise.
	* testsuite/26_numerics/headers/cmath/
	c99_classification_macros_c++11.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/
	c99_classification_macros_c++98.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/
	c99_classification_macros_c.cc: Likewise.

From-SVN: r238954
2016-08-01 15:13:06 +01:00
Jonathan Wakely
cbcc9fe8b8 Fix __gnu_cxx::hash_set test to pass in C++98 mode
* testsuite/backward/hash_set/check_construct_destroy.cc: Account
	for different construct/destroy counts in C++98 mode.

From-SVN: r238952
2016-08-01 13:45:47 +01:00
Jonathan Wakely
7481147265 Remove "-x c" from dg-options in libstdc++ C++ test
* testsuite/17_intro/freestanding.cc: Remove "-x c" from dg-options.

From-SVN: r238946
2016-08-01 13:18:23 +01:00
Jonathan Wakely
a02a61eeaa Limit std::tuple tests to run for C++11 and later
* testsuite/20_util/tuple/cons/66338.cc: Limit test to C++11 and
	later.
	* testsuite/20_util/tuple/cons/element_accepts_anything_byval.cc:
	Likewise.

From-SVN: r238945
2016-08-01 13:18:18 +01:00
Jonathan Wakely
98b5fb3cbc Make libstdc++ debug mode test valid for C++98
* testsuite/25_algorithms/lower_bound/debug/irreflexive.cc: Use
	C++98-compatible initialization for array.

From-SVN: r238944
2016-08-01 13:18:13 +01:00
Jonathan Wakely
6f3b889189 Remove unused headers and variables from libstdc++ tests
* testsuite/20_util/shared_ptr/assign/auto_ptr_rvalue.cc: Remove
	unused header and variable from compile-only test.
	* testsuite/20_util/shared_ptr/assign/unique_ptr_rvalue.cc: Likewise.
	* testsuite/28_regex/basic_regex/assign/char/cstring.cc: Likewise.
	* testsuite/28_regex/basic_regex/ctors/string_wchar_t.cc: Likewise.
	* testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc:
	Likewise.

From-SVN: r238943
2016-08-01 13:18:08 +01:00
Jonathan Wakely
2ab794ebf5 Remove duplicate dg-options directive in string_view test
* testsuite/experimental/string_view/operations/rfind/char/2.cc:
	Remove duplicate dg-options directive.

From-SVN: r238942
2016-08-01 13:17:59 +01:00
Jonathan Wakely
4d16871b22 Use -std=gnu++98 instead of -std=gnu++03 in test
* testsuite/20_util/specialized_algorithms/uninitialized_copy/
	808590.cc: Use -std=gnu++98 instead of -std=gnu++03.

From-SVN: r238941
2016-08-01 13:17:54 +01:00
Jonathan Wakely
e350983522 Remove linker options from compile-only tests
* testsuite/20_util/make_signed/requirements/typedefs-2.cc: Remove
	linker options from compile-only tests.
	* testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
	Likewise.

From-SVN: r238940
2016-08-01 13:17:49 +01:00
Jonathan Wakely
9b46e4d6dd Run std::ios_base enum tests for C++11 and up
* testsuite/27_io/ios_base/types/fmtflags/case_label.cc: Make test
	supported for C++11 and later.
	* testsuite/27_io/ios_base/types/iostate/case_label.cc: Likewise.
	* testsuite/27_io/ios_base/types/openmode/case_label.cc: Likewise.

From-SVN: r238939
2016-08-01 13:17:43 +01:00
Jonathan Wakely
c4da1da21e Change std::conditional test to compile-only
* testsuite/20_util/conditional/requirements/typedefs.cc: Change to
	compile-only test.

From-SVN: r238930
2016-07-31 20:37:14 +01:00
Jonathan Wakely
9d5b70b036 Ensure std::atomic test is compiled with optimization
* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
	Ensure test is compiled with optimization.

From-SVN: r238929
2016-07-31 20:30:16 +01:00
Jonathan Wakely
ee62805728 Fix DR 438 std::list test to pass in C++98 mode
* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Adjust dg-prune-output pattern for error in C++98 mode.

From-SVN: r238928
2016-07-31 20:21:59 +01:00
Jonathan Wakely
d23d1bee8c Enable std::regex test for C++11 or later
* testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: Only
	run for C++11 or later.

From-SVN: r238927
2016-07-31 19:54:31 +01:00
Jonathan Wakely
f2738d6cf2 Fix non-portable std::regex test and test more cases
* testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: Fix
	test to not rely on GNU extension (escaped normal characters in POSIX
	BRE). Enable tests for other strings which are now supported.

From-SVN: r238926
2016-07-31 19:46:30 +01:00
Jonathan Wakely
77f3d97909 Allow std::pair test to run in C++11 mode too
* testsuite/20_util/pair/astuple/get_neg.cc: Use effective-target
	c++11 instead of setting -std=gnu++14.

From-SVN: r238925
2016-07-31 19:12:28 +01:00
Jonathan Wakely
3c040fa4a2 libstdc++/72745 add static assertion for invalid tuple access
PR libstdc++/72745
	* include/std/array (get): Use positive message for static assertions.
	* include/std/functional (_Safe_tuple_element_t): Fix indentation.
	* include/std/tuple (tuple_element<I, tuple<>>): Add partial
	specialization for invalid indices, with static assertion.
	* testsuite/20_util/tuple/element_access/get_neg.cc: New test.

From-SVN: r238924
2016-07-31 18:08:52 +01:00
Jonathan Wakely
f245e3a0ee Move dg-error directives to relevant lines
* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Move
	dg-error to relevant line.
	* testsuite/20_util/headers/type_traits/types_std_c++0x_neg.cc:
	Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	assign_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/forward_list/requirements/dr438/
	insert_neg.cc: Likewise.
	* testsuite/26_numerics/headers/cmath/types_std_c++0x_neg.cc:
	Likewise.
	* testsuite/26_numerics/random/linear_congruential_engine/
	requirements/non_uint_neg.cc: Likewise.
	* testsuite/29_atomics/headers/atomic/types_std_c++0x_neg.cc:
	Likewise. Also test for std::atomic_address.

From-SVN: r238923
2016-07-31 17:51:08 +01:00
Ville Voutilainen
8c9142276b Add missing variable traits, fix testsuite failures.
* include/bits/uses_allocator.h (uses_allocator_v): New.
	* include/std/functional (is_bind_expression_v, is_placeholder_v):
	Likewise.
	* testsuite/20_util/bind/is_placeholder_v.cc: Likewise.
	* testsuite/20_util/declval/requirements/1_neg.cc: Adjust.
	* testsuite/20_util/duration/literals/range.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
	* testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc:
	Likewise.
	* testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
	* testsuite/20_util/uses_allocator/requirements/uses_allocator_v.cc:
	New.

From-SVN: r238921
2016-07-31 17:52:53 +03:00
Jonathan Wakely
2f2971492b Check __STRICT_ANSI__ for 128-bit arithmetic types
* testsuite/18_support/numeric_limits/40856.cc [__STRICT_ANSI__]: Do
	not test 128-bit types.
	* testsuite/20_util/is_floating_point/value.cc: Likewise.
	* testsuite/20_util/is_integral/value.cc: Likewise.
	* testsuite/20_util/is_signed/value.cc: Likewise.
	* testsuite/20_util/is_unsigned/value.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs-1.cc: Likewise.
	* testsuite/20_util/make_signed/requirements/typedefs-2.cc: Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs-1.cc:
	Likewise.
	* testsuite/20_util/make_unsigned/requirements/typedefs-2.cc:
	Likewise.

From-SVN: r238918
2016-07-31 14:06:38 +01:00
Jonathan Wakely
7523c5eb1a Fix file extension of libstdc++ test
* testsuite/26_numerics/headers/cstdlib/54686.c: Rename to 54686.cc.

From-SVN: r238917
2016-07-31 14:03:46 +01:00
Ville Voutilainen
137422c80c Implement C++17 variable templates for type traits.
* include/std/chrono (treat_as_floating_point_v): New.
	* include/std/ratio (ratio_equal_v, ratio_not_equal_v)
	(ratio_less_v, ratio_less_equal_v, ratio_greater_v)
	(ratio_greater_equal_v): Likewise.
	* include/std/system_error (is_error_code_enum_v)
	(is_error_condition_enum_v): Likewise.
	* include/std/tuple (tuple_size_v): Likewise.
	* type_traits (conjunction_v, disjunction_v, negation_v)
	(is_void_v, is_null_pointer_v, is_integral_v, is_floating_point_v)
	(is_array_v, is_pointer_v, is_lvalue_reference_v)
	(is_rvalue_reference_v, is_member_object_pointer_v)
	(is_member_function_pointer_v, is_enum_v, is_union_v)
	(is_class_v, is_function_v, is_reference_v, is_arithmetic_v)
	(is_fundamental_v, is_object_v, is_scalar_v, is_compound_v)
	(is_member_pointer_v, is_const_v, is_volatile_v, is_trivial_v)
	(is_trivially_copyable_v, is_standard_layout_v)
	(is_pod_v, is_literal_type_v, is_empty_v, is_polymorphic_v)
	(is_abstract_v, is_final_v, is_signed_v, is_unsigned_v)
	(is_constructible_v, is_default_constructible_v)
	(is_copy_constructible_v, is_move_constructible_v)
	(is_assignable_v, is_copy_assignable_v, is_move_assignable_v)
	(is_destructible_v, is_trivially_constructible_v)
	(is_trivially_default_constructible_v)
 	(is_trivially_copy_constructible_v, is_trivially_move_constructible_v)
	(is_trivially_assignable_v, is_trivially_copy_assignable_v)
	(is_trivially_move_assignable_v, is_trivially_destructible_v)
	(is_nothrow_constructible_v, is_nothrow_default_constructible_v)
	(is_nothrow_copy_constructible_v, is_nothrow_move_constructible_v)
	(is_nothrow_assignable_v, is_nothrow_copy_assignable_v)
	(is_nothrow_move_assignable_v, is_nothrow_destructible_v)
	(has_virtual_destructor_v, alignment_of_v, rank_v, extent_v)
	(is_same_v, is_base_of_v, is_convertible_v): Likewise.
	* testsuite/19_diagnostics/error_code/is_error_code_v.cc: Likewise.
	* testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc:
	Likewise.
	* testsuite/20_util/ratio/requirements/ratio_equal_v.cc: Likewise.
	* testsuite/20_util/tuple/tuple_size_v.cc: Likewise.
	* testsuite/20_util/variable_templates_for_traits.cc: Likewise.

From-SVN: r238892
2016-07-29 22:01:39 +03:00
Jonathan Wakely
62589e99d1 New libstdc++ symbol version for new basic_string symbols
* acinclude.m4 (libtool_VERSION): Bump to 6:23:0.
	* config/abi/pre/gnu.ver: Add 3.4.23 version for new basic_string
	symbols.
	* configure: Regenerate.
	* testsuite/util/testsuite_abi.cc: Add new symbol version.

From-SVN: r238853
2016-07-29 11:42:17 +01:00
Jonathan Wakely
1a2196e484 Fix DR 438 container tests to pass in C++98 mode
* testsuite/23_containers/deque/requirements/dr438/assign_neg.cc:
	Adjust dg-prune-output pattern for error in C++98 mode.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/deque/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/list/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/list/requirements/dr438/insert_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/assign_neg.cc:
	Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_1_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/
	constructor_2_neg.cc: Likewise.
	* testsuite/23_containers/vector/requirements/dr438/insert_neg.cc:
	Likewise.

From-SVN: r238837
2016-07-28 22:00:45 +01:00
Jonathan Wakely
e539b4ff2f Fix std::vector test to pass in C++98 mode
* testsuite/23_containers/vector/check_construct_destroy.cc: Account
	for different construct/destroy counts in C++98 mode.

From-SVN: r238836
2016-07-28 22:00:39 +01:00
Jonathan Wakely
c3c2f97308 Use dg-additional-options in libstdc++ tests
* testsuite/17_intro/headers/c++2011/stdc++.cc: Change target-specific
	dg-options to dg-additional-options so that default options are used.
	* testsuite/17_intro/headers/c++2011/stdc++_multiple_inclusion.cc:
	Likewise.
	* testsuite/17_intro/headers/c++2014/stdc++.cc: Likewise.
	* testsuite/17_intro/headers/c++2014/stdc++_multiple_inclusion.cc:
	Likewise.
	* testsuite/29_atomics/atomic_flag/test_and_set/explicit-hle.cc:
	Use dg-additional-options instead of repeating the common options.

From-SVN: r238835
2016-07-28 22:00:34 +01:00
Jonathan Wakely
2de6b25424 Fix invalid dg-do directives in libstdc++ tests
* testsuite/22_locale/conversions/string/1.cc: Remove unintended
	dg-do compile directive.
	* testsuite/26_numerics/headers/cmath/fabs_inline.cc: Fix syntax of
	dg-do directive.
	* testsuite/26_numerics/valarray/const_bracket.cc: Likewise.

From-SVN: r238834
2016-07-28 22:00:19 +01:00