+2014-12-31 Tobias Burnus <burnus@net-b.de>
+
+ * match.c (gfc_match_stopcode): Permit error stop in pure
+ procedures with F2015.
+
2014-12-31 Uros Bizjak <ubizjak@gmail.com>
* trans-array.c (trans_array_bound_check): Use xasprintf instead
}
-/* Match a number or character constant after an (ALL) STOP or PAUSE statement. */
+/* Match a number or character constant after an (ERROR) STOP or PAUSE
+ statement. */
static match
gfc_match_stopcode (gfc_statement st)
if (gfc_pure (NULL))
{
- gfc_error ("%s statement not allowed in PURE procedure at %C",
- gfc_ascii_statement (st));
- goto cleanup;
+ if (st == ST_ERROR_STOP)
+ {
+ if (!gfc_notify_std (GFC_STD_F2015, "%s statement at %C in PURE "
+ "procedure", gfc_ascii_statement (st)))
+ goto cleanup;
+ }
+ else
+ {
+ gfc_error ("%s statement not allowed in PURE procedure at %C",
+ gfc_ascii_statement (st));
+ goto cleanup;
+ }
}
gfc_unset_implicit_pure (NULL);
+2014-12-31 Tobias Burnus <burnus@net-b.de>
+
+ * gfortran.dg/error_stop_3.f90: New.
+ * gfortran.dg/error_stop_4.f90: New.
+ * gfortran.dg/coarray_3.f90: Remove a dg-error.
+
2014-12-31 Iain Sandoe <iain@codesourcery.com>
* obj-c++.dg/lambda-0.mm New.
critical ! { dg-error "Image control statement CRITICAL" }
end critical ! { dg-error "Expecting END SUBROUTINE statement" }
sync all ! { dg-error "Image control statement SYNC" }
- error stop ! { dg-error "not allowed in PURE procedure" }
+ error stop
end subroutine pureSub
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=gnu" }
+!
+! F2015 permits ERROR STOP in PURE procedures
+! FIXME: Change to -std=f2015, when available
+!
+pure subroutine foo()
+ error stop "failed"
+end
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=f2008ts" }
+!
+! F2015 permits ERROR STOP in PURE procedures
+! FIXME: Change to error_stop_3.f90 to -std=f2015.
+!
+pure subroutine foo()
+ error stop "failed" ! { dg-error "GNU Extension: ERROR STOP statement at .1. in PURE procedure" }
+end