PR c++/41967
* parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
nested loop and parsing statements, don't cp_parser_require }, instead
exit the loop if next token is CPP_EOF.
* g++.dg/gomp/pr41967.C: New test.
From-SVN: r153972
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41967
+ * parser.c (cp_parser_omp_for_loop): After diagnosing not perfectly
+ nested loop and parsing statements, don't cp_parser_require }, instead
+ exit the loop if next token is CPP_EOF.
+
2009-11-05 Jason Merrill <jason@redhat.com>
PR c++/34180
}
collapse_err = true;
cp_parser_statement_seq_opt (parser, NULL);
- cp_parser_require (parser, CPP_CLOSE_BRACE, "%<}%>");
+ if (cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
}
}
+2009-11-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/41967
+ * g++.dg/gomp/pr41967.C: New test.
+
2009-11-06 Michael Matz <matz@suse.de>
PR middle-end/41963
--- /dev/null
+// PR c++/41967
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+int
+foo ()
+{
+ int sum = 0;
+#pragma omp for collapse(2)
+ for (int i = 0; i < 5; ++i)
+ {
+ for (int j = 0; j < 5; ++j)
+ ++sum;
+ ++sum; // { dg-error "collapsed loops not perfectly nested" }
+ }
+ return sum;
+}