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)
{
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;
/*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);
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);
+ 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%>");
- return error_mark_node;
- }
+ {
+ error_at (loc, "wrong number of arguments to "
+ "%<__builtin_shuffle%>");
+ postfix_expression = error_mark_node;
+ }
break;
}
--- /dev/null
+/* PR c++/78089 */
+/* { dg-do run } */
+
+typedef int V __attribute__((vector_size (16)));
+V a, b, c;
+
+int
+foo ()
+{
+ return __builtin_shuffle (a, b, c)[3];
+}
+
+int
+main ()
+{
+ a = (V) { 1, 2, 3, 4 };
+ b = (V) { 5, 6, 7, 8 };
+ c = (V) { 7, 2, 5, 6 };
+ if (foo () != 7)
+ __builtin_abort ();
+ return 0;
+}