c++: Implement __is_nothrow_invocable built-in trait
commit3dab8f8a542aeabfab1a244a7a601b220680c80b
authorKen Matsui <kmatsui@gcc.gnu.org>
Wed, 21 Feb 2024 08:46:56 +0000 (21 00:46 -0800)
committerKen Matsui <kmatsui@gcc.gnu.org>
Sat, 11 May 2024 01:18:01 +0000 (10 18:18 -0700)
tree8d707b0d749897f666a3f501c4a76d240a70c541
parent7bd33955970202095738e85c4ddf161432ece099
c++: Implement __is_nothrow_invocable built-in trait

This patch implements built-in trait for std::is_nothrow_invocable.

gcc/cp/ChangeLog:

* cp-trait.def: Define __is_nothrow_invocable.
* constraint.cc (diagnose_trait_expr): Handle
CPTK_IS_NOTHROW_INVOCABLE.
* semantics.cc (trait_expr_value): Likewise.
(finish_trait_expr): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/ext/has-builtin-1.C: Test existence of
__is_nothrow_invocable.
* g++.dg/ext/is_nothrow_invocable.C: New test.

Signed-off-by: Ken Matsui <kmatsui@gcc.gnu.org>
Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/constraint.cc
gcc/cp/cp-trait.def
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/ext/has-builtin-1.C
gcc/testsuite/g++.dg/ext/is_nothrow_invocable.C [new file with mode: 0644]