aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@gmail.com>2020-10-26 15:36:24 +0200
committerVille Voutilainen <ville.voutilainen@gmail.com>2020-10-26 15:36:24 +0200
commit9e2256dcd481ffe3a8c79b65eba19fbb14b7ff8d (patch)
tree3529c16b86b6fca18f65c782508ea6af9d01ec38 /gcc/cp/parser.c
parent783dc02d89712f5219093d33ad7f08e1509a2134 (diff)
downloadgcc-9e2256dcd481ffe3a8c79b65eba19fbb14b7ff8d.zip
gcc-9e2256dcd481ffe3a8c79b65eba19fbb14b7ff8d.tar.gz
gcc-9e2256dcd481ffe3a8c79b65eba19fbb14b7ff8d.tar.bz2
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.
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 7ec7d42..cce3d0a 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -5637,6 +5637,8 @@ cp_parser_primary_expression (cp_parser *parser,
case RID_IS_UNION:
case RID_IS_ASSIGNABLE:
case RID_IS_CONSTRUCTIBLE:
+ case RID_IS_NOTHROW_ASSIGNABLE:
+ case RID_IS_NOTHROW_CONSTRUCTIBLE:
return cp_parser_trait_expr (parser, token->keyword);
// C++ concepts
@@ -10501,6 +10503,14 @@ cp_parser_trait_expr (cp_parser* parser, enum rid keyword)
kind = CPTK_IS_CONSTRUCTIBLE;
variadic = true;
break;
+ case RID_IS_NOTHROW_ASSIGNABLE:
+ kind = CPTK_IS_NOTHROW_ASSIGNABLE;
+ binary = true;
+ break;
+ case RID_IS_NOTHROW_CONSTRUCTIBLE:
+ kind = CPTK_IS_NOTHROW_CONSTRUCTIBLE;
+ variadic = true;
+ break;
default:
gcc_unreachable ();
}