gcc/libstdc++-v3/testsuite/20_util
Ville Voutilainen b42cc3ca24 Implement new C++ intrinsics __is_assignable and __is_constructible.
c-family/

Implement new C++ intrinsics __is_assignable and __is_constructible.
* c-common.c (__is_assignable, __is_constructible): New.
* c-common.h (RID_IS_ASSIGNABLE, RID_IS_CONSTRUCTIBLE): Likewise.

cp/

PR c++/80654
PR c++/80682
Implement new C++ intrinsics __is_assignable and __is_constructible.
* cp-tree.h (CPTK_IS_ASSIGNABLE, CPTK_IS_CONSTRUCTIBLE): New.
(is_xible): New.
* cxx-pretty-print.c (pp_cxx_trait_expression): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.
* method.c (constructible_expr): Set cp_unevaluated.
(is_xible_helper): New.
(is_trivially_xible): Adjust.
(is_xible): New.
* parser.c (cp_parser_primary_expression): Handle
RID_IS_ASSIGNABLE and RID_IS_CONSTRUCTIBLE.
(cp_parser_trait_expr): Likewise.
* semantics.c (trait_expr_value): Handle
CPTK_IS_ASSIGNABLE and CPTK_IS_CONSTRUCTIBLE.

testsuite/

* g++.dg/ext/80654.C: New.

libstdc++-v3/

Implement new C++ intrinsics __is_assignable and __is_constructible.
* include/std/type_traits (__do_is_static_castable_impl): Remove.
(__is_static_castable_impl, __is_static_castable_safe): Likewise.
(__is_static_castable, __do_is_direct_constructible_impl): Likewise.
(__is_direct_constructible_impl): Likewise.
(__is_direct_constructible_new_safe): Likewise.
(__is_base_to_derived_ref, __is_lvalue_to_rvalue_ref): Likewise.
(__is_direct_constructible_ref_cast): Likewise.
(__is_direct_constructible_new, __is_direct_constructible): Likewise.
(__do_is_nary_constructible_impl): Likewise.
(__is_nary_constructible_impl, __is_nary_constructible): Likewise.
(__is_constructible_impl): Likewise.
(is_constructible): Call the intrinsic.
(__is_assignable_helper): Remove.
(is_assignable): Call the intrinsic.
(is_trivially_constructible): Likewise.
(__is_trivially_copy_constructible_impl): New.
(is_trivially_copy_constructible): Use it.
(__is_trivially_move_constructible_impl): New.
(is_trivially_move_constructible): Use it.
(is_trivially_assignable): Call the intrinsic.
(__is_trivially_copy_assignable_impl): New.
(is_trivially_copy_assignable): Use it.
(__is_trivially_move_assignable_impl): New.
(is_trivially_move_assignable): Use it.
(testsuite/20_util/declval/requirements/1_neg.cc): Adjust.
(testsuite/20_util/is_trivially_copy_assignable/value.cc):
Add test for void.
(testsuite/20_util/is_trivially_copy_constructible/value.cc): Likewise.
(testsuite/20_util/is_trivially_move_assignable/value.cc): Likewise.
(testsuite/20_util/is_trivially_move_constructible/value.cc): Likewise.
(testsuite/20_util/make_signed/requirements/typedefs_neg.cc): Adjust.
(testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc):
Likewise.

From-SVN: r248153
2017-05-17 16:54:23 +03:00
..
add_const Update copyright years. 2017-01-01 13:07:43 +01:00
add_cv Update copyright years. 2017-01-01 13:07:43 +01:00
add_lvalue_reference Update copyright years. 2017-01-01 13:07:43 +01:00
add_pointer PR78361 recognise noexcept functions as referenceable 2017-01-13 12:18:42 +00:00
add_rvalue_reference Update copyright years. 2017-01-01 13:07:43 +01:00
add_volatile Update copyright years. 2017-01-01 13:07:43 +01:00
addressof Update copyright years. 2017-01-01 13:07:43 +01:00
align Update copyright years. 2017-01-01 13:07:43 +01:00
aligned_storage Update copyright years. 2017-01-01 13:07:43 +01:00
aligned_union Update copyright years. 2017-01-01 13:07:43 +01:00
alignment_of Update copyright years. 2017-01-01 13:07:43 +01:00
allocator Update copyright years. 2017-01-01 13:07:43 +01:00
allocator_traits PR72792 detect allocator pointer types without invalid rebinding 2017-01-20 12:03:36 +00:00
any Implement LWG 2857, {variant,optional,any}::emplace should return the constructed value. 2017-03-16 01:13:20 +02:00
as_const Update copyright years. 2017-01-01 13:07:43 +01:00
auto_ptr Update copyright years. 2017-01-01 13:07:43 +01:00
bad_function_call Update copyright years. 2017-01-01 13:07:43 +01:00
bind PR 79798 Fix incorrect use of std::result_of in std::bind 2017-03-02 03:43:36 +00:00
bool_constant Update copyright years. 2017-01-01 13:07:43 +01:00
common_type/requirements Update copyright years. 2017-01-01 13:07:43 +01:00
conditional/requirements Update copyright years. 2017-01-01 13:07:43 +01:00
decay/requirements Update copyright years. 2017-01-01 13:07:43 +01:00
declval/requirements Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
default_delete Avoid deprecated warnings about std::auto_ptr in library headers 2017-04-21 14:08:51 +01:00
duration C++17 GB50 resolution (P0505R0) 2017-02-19 16:04:35 +00:00
duration_cast Update copyright years. 2017-01-01 13:07:43 +01:00
enable_if/requirements Update copyright years. 2017-01-01 13:07:43 +01:00
enable_shared_from_this PR libstdc++/80229 restore support for shared_ptr<function type> 2017-03-28 08:35:04 +01:00
exchange Update copyright years. 2017-01-01 13:07:43 +01:00
extent Update copyright years. 2017-01-01 13:07:43 +01:00
forward Update copyright years. 2017-01-01 13:07:43 +01:00
function Add deduction guides for C++17 (P0433R2, partial) 2017-03-22 15:58:35 +00:00
function_objects Fix incorrect results from std::boyer_moore_searcher 2017-04-18 12:08:00 +01:00
has_unique_object_representations Update copyright years. 2017-01-01 13:07:43 +01:00
has_virtual_destructor Update copyright years. 2017-01-01 13:07:43 +01:00
hash Implement LWG 2686, std::hash<error_condition>, for C++17 2017-03-23 19:40:16 +00:00
headers Update copyright years. 2017-01-01 13:07:43 +01:00
in_place Update copyright years. 2017-01-01 13:07:43 +01:00
integer_sequence Update copyright years. 2017-01-01 13:07:43 +01:00
integral_constant Update copyright years. 2017-01-01 13:07:43 +01:00
is_abstract Update copyright years. 2017-01-01 13:07:43 +01:00
is_aggregate Implement std::is_aggregate. 2017-04-03 18:57:06 +03:00
is_arithmetic Update copyright years. 2017-01-01 13:07:43 +01:00
is_array Update copyright years. 2017-01-01 13:07:43 +01:00
is_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_base_of Update copyright years. 2017-01-01 13:07:43 +01:00
is_class Update copyright years. 2017-01-01 13:07:43 +01:00
is_compound Update copyright years. 2017-01-01 13:07:43 +01:00
is_const Update copyright years. 2017-01-01 13:07:43 +01:00
is_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_convertible Update copyright years. 2017-01-01 13:07:43 +01:00
is_copy_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_copy_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_default_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_destructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_empty Update copyright years. 2017-01-01 13:07:43 +01:00
is_enum Update copyright years. 2017-01-01 13:07:43 +01:00
is_final Update copyright years. 2017-01-01 13:07:43 +01:00
is_floating_point Update copyright years. 2017-01-01 13:07:43 +01:00
is_function Update copyright years. 2017-01-01 13:07:43 +01:00
is_fundamental Update copyright years. 2017-01-01 13:07:43 +01:00
is_implicitly_default_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_integral Update copyright years. 2017-01-01 13:07:43 +01:00
is_invocable P0604R0 add invoke_result, is_invocable etc. for C++17 2017-03-10 15:29:38 +00:00
is_literal_type Update copyright years. 2017-01-01 13:07:43 +01:00
is_lvalue_reference Update copyright years. 2017-01-01 13:07:43 +01:00
is_member_function_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
is_member_object_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
is_member_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
is_move_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_move_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_copy_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_copy_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_default_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_destructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_invocable P0604R0 add invoke_result, is_invocable etc. for C++17 2017-03-10 15:29:38 +00:00
is_nothrow_move_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_move_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_swappable Update copyright years. 2017-01-01 13:07:43 +01:00
is_nothrow_swappable_with Update copyright years. 2017-01-01 13:07:43 +01:00
is_null_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
is_object Update copyright years. 2017-01-01 13:07:43 +01:00
is_pod Update copyright years. 2017-01-01 13:07:43 +01:00
is_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
is_polymorphic Update copyright years. 2017-01-01 13:07:43 +01:00
is_reference Update copyright years. 2017-01-01 13:07:43 +01:00
is_rvalue_reference Update copyright years. 2017-01-01 13:07:43 +01:00
is_same Update copyright years. 2017-01-01 13:07:43 +01:00
is_scalar Update copyright years. 2017-01-01 13:07:43 +01:00
is_signed Update copyright years. 2017-01-01 13:07:43 +01:00
is_standard_layout Update copyright years. 2017-01-01 13:07:43 +01:00
is_swappable Update copyright years. 2017-01-01 13:07:43 +01:00
is_swappable_with Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivial Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_assignable Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_copy_assignable Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
is_trivially_copy_constructible Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
is_trivially_copyable Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_default_constructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_destructible Update copyright years. 2017-01-01 13:07:43 +01:00
is_trivially_move_assignable Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
is_trivially_move_constructible Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
is_union Update copyright years. 2017-01-01 13:07:43 +01:00
is_unsigned Update copyright years. 2017-01-01 13:07:43 +01:00
is_void Update copyright years. 2017-01-01 13:07:43 +01:00
is_volatile Update copyright years. 2017-01-01 13:07:43 +01:00
logical_traits Update copyright years. 2017-01-01 13:07:43 +01:00
make_signed/requirements Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
make_unsigned/requirements Implement new C++ intrinsics __is_assignable and __is_constructible. 2017-05-17 16:54:23 +03:00
move Update copyright years. 2017-01-01 13:07:43 +01:00
move_if_noexcept Update copyright years. 2017-01-01 13:07:43 +01:00
optional optional (_Optional_base::_M_get): Check precondition. 2017-05-16 12:54:16 +00:00
owner_less Update copyright years. 2017-01-01 13:07:43 +01:00
pair re PR libstdc++/79141 (std::pair<int,int> p = {}; fails to compile due to ambiguous overload) 2017-04-03 19:30:58 +03:00
pointer_safety Update copyright years. 2017-01-01 13:07:43 +01:00
pointer_traits PR72792 PR72793 relax requirements on rebind members 2017-01-20 02:36:16 +00:00
rank Update copyright years. 2017-01-01 13:07:43 +01:00
ratio Implement P0607R0 "Inline Variables for Standard Library" for C++17 2017-03-23 19:40:07 +00:00
raw_storage_iterator Update copyright years. 2017-01-01 13:07:43 +01:00
reference_wrapper PR libstdc++/80504 qualify calls to avoid ADL 2017-04-24 12:40:07 +01:00
remove_all_extents Update copyright years. 2017-01-01 13:07:43 +01:00
remove_const Update copyright years. 2017-01-01 13:07:43 +01:00
remove_cv Update copyright years. 2017-01-01 13:07:43 +01:00
remove_extent Update copyright years. 2017-01-01 13:07:43 +01:00
remove_pointer Update copyright years. 2017-01-01 13:07:43 +01:00
remove_reference Update copyright years. 2017-01-01 13:07:43 +01:00
remove_volatile Update copyright years. 2017-01-01 13:07:43 +01:00
result_of Update copyright years. 2017-01-01 13:07:43 +01:00
scoped_allocator Implement P0607R0 "Inline Variables for Standard Library" for C++17 2017-03-23 19:40:07 +00:00
shared_ptr PR libstdc++/80285 optimize std::make_shared for -fno-rtti 2017-05-11 14:21:07 +01:00
specialized_algorithms PR libstdc++/80553 don't allow destroying non-destructible types 2017-04-28 13:56:53 +01:00
steady_clock Update copyright years. 2017-01-01 13:07:43 +01:00
system_clock Update copyright years. 2017-01-01 13:07:43 +01:00
time_point C++17 GB50 resolution (P0505R0) 2017-02-19 16:04:35 +00:00
time_point_cast Update copyright years. 2017-01-01 13:07:43 +01:00
tuple PR libstdc++/78939 make tuple_size<cv T> depend on tuple_size<T> 2017-05-12 15:43:11 +01:00
typeindex Update copyright years. 2017-01-01 13:07:43 +01:00
underlying_type/requirements Update copyright years. 2017-01-01 13:07:43 +01:00
unique_ptr Avoid deprecated warnings about std::auto_ptr in library headers 2017-04-21 14:08:51 +01:00
uses_allocator Implement P0607R0 "Inline Variables for Standard Library" for C++17 2017-03-23 19:40:07 +00:00
variant Implement LWG 2857, {variant,optional,any}::emplace should return the constructed value. 2017-03-16 01:13:20 +02:00
void_t Update copyright years. 2017-01-01 13:07:43 +01:00
weak_ptr Add deduction guides for C++17 (P0433R2, partial) 2017-03-22 15:58:35 +00:00
rel_ops.cc Update copyright years. 2017-01-01 13:07:43 +01:00
temporary_buffer.cc Update copyright years. 2017-01-01 13:07:43 +01:00
variable_templates_for_traits.cc Update copyright years. 2017-01-01 13:07:43 +01:00