===================================================================
@@ -33079,6 +33079,9 @@ cp_parser_pragma (cp_parser *parser, enum pragma_c
cp_parser_error (parser, "for, while or do statement expected");
return false;
}
+ if (context == pragma_external)
+ /* cp_parser_declaration will emit a diagnostic. */
+ return false;
cp_parser_iteration_statement (parser, true);
return true;
}
===================================================================
@@ -0,0 +1,9 @@
+// PR c++/60211
+
+void foo()
+{}
+ int i;
+#pragma GCC ivdep
+ for (i = 0; i < 2; ++i) // { dg-error "expected|type" }
+ ;
+} // { dg-error "expected" }
===================================================================
@@ -0,0 +1,8 @@
+// PR c++/60211
+
+void foo()
+{}
+#pragma GCC ivdep
+ for (int i = 0; i < 2; ++i) // { dg-error "expected|type" }
+ ;
+} // { dg-error "expected" }