summaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 53eafa7beeb..e4436485053 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -6441,7 +6441,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
can be used in constant-expressions. */
if (!cast_valid_in_integral_constant_expression_p (type)
&& cp_parser_non_integral_constant_expression (parser, NIC_CAST))
- return error_mark_node;
+ {
+ postfix_expression = error_mark_node;
+ break;
+ }
switch (keyword)
{
@@ -6521,7 +6524,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
parser->type_definition_forbidden_message = saved_message;
/* `typeid' may not appear in an integral constant expression. */
if (cp_parser_non_integral_constant_expression (parser, NIC_TYPEID))
- return error_mark_node;
+ postfix_expression = error_mark_node;
}
break;
@@ -6615,7 +6618,10 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
/*cast_p=*/false, /*allow_expansion_p=*/true,
/*non_constant_p=*/NULL);
if (vec == NULL)
- return error_mark_node;
+ {
+ postfix_expression = error_mark_node;
+ break;
+ }
FOR_EACH_VEC_ELT (*vec, i, p)
mark_exp_read (p);
@@ -6624,10 +6630,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
{
case RID_ADDRESSOF:
if (vec->length () == 1)
- return cp_build_addressof (loc, (*vec)[0], tf_warning_or_error);
- error_at (loc, "wrong number of arguments to "
- "%<__builtin_addressof%>");
- return error_mark_node;
+ postfix_expression
+ = cp_build_addressof (loc, (*vec)[0], tf_warning_or_error);
+ else
+ {
+ error_at (loc, "wrong number of arguments to "
+ "%<__builtin_addressof%>");
+ postfix_expression = error_mark_node;
+ }
+ break;
case RID_BUILTIN_LAUNDER:
if (vec->length () == 1)
@@ -6643,14 +6654,20 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p,
case RID_BUILTIN_SHUFFLE:
if (vec->length () == 2)
- return build_x_vec_perm_expr (loc, (*vec)[0], NULL_TREE,
- (*vec)[1], tf_warning_or_error);
+ postfix_expression
+ = build_x_vec_perm_expr (loc, (*vec)[0], NULL_TREE,
+ (*vec)[1], tf_warning_or_error);
else if (vec->length () == 3)
- return build_x_vec_perm_expr (loc, (*vec)[0], (*vec)[1],
- (*vec)[2], tf_warning_or_error);
- error_at (loc, "wrong number of arguments to "
- "%<__builtin_shuffle%>");
- return error_mark_node;
+ postfix_expression
+ = build_x_vec_perm_expr (loc, (*vec)[0], (*vec)[1],
+ (*vec)[2], tf_warning_or_error);
+ else
+ {
+ error_at (loc, "wrong number of arguments to "
+ "%<__builtin_shuffle%>");
+ postfix_expression = error_mark_node;
+ }
+ break;
default:
gcc_unreachable ();