c++: Implement __is_nothrow_constructible and __is_nothrow_assignable
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 26 Oct 2020 13:36:24 +0000 (15:36 +0200)
committerVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 26 Oct 2020 13:36:24 +0000 (15:36 +0200)
commit9e2256dcd481ffe3a8c79b65eba19fbb14b7ff8d
tree3529c16b86b6fca18f65c782508ea6af9d01ec38
parent783dc02d89712f5219093d33ad7f08e1509a2134
c++: Implement __is_nothrow_constructible and __is_nothrow_assignable

gcc/c-family/ChangeLog:

* c-common.c (__is_nothrow_assignable): New.
(__is_nothrow_constructible): Likewise.
* c-common.h (RID_IS_NOTHROW_ASSIGNABLE): New.
(RID_IS_NOTHROW_CONSTRUCTIBLE): Likewise.

gcc/cp/ChangeLog:

* cp-tree.h (CPTK_IS_NOTHROW_ASSIGNABLE): New.
(CPTK_IS_NOTHROW_CONSTRUCTIBLE): Likewise.
(is_nothrow_xible): Likewise.
* method.c (is_nothrow_xible): New.
(is_trivially_xible): Tweak.
* parser.c (cp_parser_primary_expression): Handle the new RID_*.
(cp_parser_trait_expr): Likewise.
* semantics.c (trait_expr_value): Handle the new RID_*.
(finish_trait_expr): Likewise.

libstdc++-v3/ChangeLog:

* include/std/type_traits (__is_nt_constructible_impl): Remove.
(__is_nothrow_constructible_impl): Adjust.
(is_nothrow_default_constructible): Likewise.
(__is_nt_assignable_impl): Remove.
(__is_nothrow_assignable_impl): Adjust.
13 files changed:
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/cp/cp-tree.h
gcc/cp/method.c
gcc/cp/parser.c
gcc/cp/semantics.c
gcc/testsuite/g++.dg/ext/is_nothrow_constructible1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_nothrow_constructible2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_nothrow_constructible3.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_nothrow_constructible4.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_nothrow_constructible5.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/is_nothrow_constructible6.C [new file with mode: 0644]
libstdc++-v3/include/std/type_traits