middle of an expression. */
++function_depth;
+ auto odsd = make_temp_override (parser->omp_declare_simd, NULL);
+ auto ord = make_temp_override (parser->oacc_routine, NULL);
+ auto oafp = make_temp_override (parser->omp_attrs_forbidden_p, false);
vec<tree> omp_privatization_save;
save_omp_privatization_clauses (omp_privatization_save);
/* Clear this in case we're in the middle of a default argument. */
so let's un-parse them. */
saved_tokens.rollback();
+ parser->omp_attrs_forbidden_p = omp_attrs_forbidden_p;
cp_parser_parse_tentatively (parser);
/* Try to parse the declaration-statement. */
cp_parser_declaration_statement (parser);
+ parser->omp_attrs_forbidden_p = false;
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
return;
parser->greater_than_is_operator_p = !template_parm_p;
auto odsd = make_temp_override (parser->omp_declare_simd, NULL);
auto ord = make_temp_override (parser->oacc_routine, NULL);
+ auto oafp = make_temp_override (parser->omp_attrs_forbidden_p, false);
+
/* Local variable names (and the `this' keyword) may not
appear in a default argument. */
saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
continue;
}
+ if (parser->omp_attrs_forbidden_p)
+ {
+ error_at (first->location,
+ "mixing OpenMP directives with attribute and "
+ "pragma syntax on the same statement");
+ parser->omp_attrs_forbidden_p = false;
+ }
+
if (!flag_openmp && strcmp (directive[1], "simd") != 0)
continue;
if (lexer == NULL)
int f29 [[omp::directive (foobar), omp::directive (declare simd)]] (int); // { dg-error "unknown OpenMP directive name" }
int f30 [[omp::directive (threadprivate (t7)), omp::directive (declare simd)]] (int); // { dg-error "OpenMP directive other than 'declare simd' or 'declare variant' appertains to a declaration" }
int f31 [[omp::directive (declare simd), omp::directive (threadprivate (t8))]] (int); // { dg-error "OpenMP directive other than 'declare simd' or 'declare variant' appertains to a declaration" }
+
+void
+baz ()
+{
+ #pragma omp parallel
+ [[omp::directive (declare simd)]] extern int f32 (int); // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" }
+ #pragma omp parallel
+ extern int f33 [[omp::directive (declare simd)]] (int); // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" }
+ [[omp::directive (parallel)]]
+ #pragma omp declare simd // { dg-error "mixing OpenMP directives with attribute and pragma syntax on the same statement" }
+ extern int f34 (int);
+}