aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2016-10-25 10:47:15 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-10-25 10:47:15 +0200
commite16f1cc79dc131b0762cec4c18cfcd795fb6fe75 (patch)
tree2d1523ca1b3160a1e7eafa9814f6a920b91ac43e /gcc/cp/parser.c
parent080c5459776a70bf6dc9c3410361011591667951 (diff)
downloadgcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.zip
gcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.tar.gz
gcc-e16f1cc79dc131b0762cec4c18cfcd795fb6fe75.tar.bz2
internal-fn.def (LAUNDER): New internal function.
* internal-fn.def (LAUNDER): New internal function. * internal-fn.c (expand_LAUNDER): New function. c-family/ * c-common.h (enum rid): Add RID_BUILTIN_LAUNDER. * c-common.c (c_common_reswords): Add __builtin_launder. cp/ * cp-tree.h (finish_builtin_launder): Declare. * parser.c (cp_parser_postfix_expression): Handle RID_BUILTIN_LAUNDER. * semantics.c (finish_builtin_launder): New function. * pt.c (tsubst_copy_and_build): Handle instantiation of IFN_LAUNDER. * constexpr.c (cxx_eval_internal_function): Handle IFN_LAUNDER. (potential_constant_expression_1): Likewise. testsuite/ * g++.dg/cpp1z/launder1.C: New test. * g++.dg/cpp1z/launder2.C: New test. From-SVN: r241506
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 643c1e7..f962dfb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6604,6 +6604,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
case RID_ADDRESSOF:
case RID_BUILTIN_SHUFFLE:
+ case RID_BUILTIN_LAUNDER:
{
vec<tree, va_gc> *vec;
unsigned int i;
@@ -6628,6 +6629,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
"%<__builtin_addressof%>");
return error_mark_node;
+ case RID_BUILTIN_LAUNDER:
+ if (vec->length () == 1)
+ postfix_expression = finish_builtin_launder (loc, (*vec)[0],
+ tf_warning_or_error);
+ else
+ {
+ error_at (loc, "wrong number of arguments to "
+ "%<__builtin_launder%>");
+ postfix_expression = error_mark_node;
+ }
+ break;
+
case RID_BUILTIN_SHUFFLE:
if (vec->length () == 2)
return build_x_vec_perm_expr (loc, (*vec)[0], NULL_TREE,