+2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
+ Bud Davis <jmdavis@link.com>
+
+ PR fortran/60774
+ * parse.c (next_free,next_fixed): Issue error for statement label
+ without a statement.
+
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/61318
}
if (gfc_match_eos () == MATCH_YES)
- {
- gfc_warning_now (0, "Ignoring statement label in empty statement "
- "at %L", &label_locus);
- gfc_free_st_label (gfc_statement_label);
- gfc_statement_label = NULL;
- return ST_NONE;
- }
+ gfc_error_now ("Statement label without statement at %L",
+ &label_locus);
}
}
else if (c == '!')
blank_line:
if (digit_flag)
- gfc_warning_now (0, "Ignoring statement label in empty statement at %L",
- &label_locus);
+ gfc_error_now ("Statement label without statement at %L", &label_locus);
gfc_current_locus.lb->truncated = 0;
gfc_advance_line ();
+2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/60774
+ * gfortran.dg/empty_label.f: Adjust test for new error message.
+ * gfortran.dg/empty_label.f90: Ditto.
+ * gfortran.dg/empty_label_typedecl.f90: Ditto.
+ * gfortran.dg/label_3.f90: Deleted (redundant with empty_label.f90).
+ * gfortran.dg/warnings_are_errors_1.f90: Remove invalid statement label.
+
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/61318
C { dg-do compile }
-C { dg-options "-Werror -fmax-errors=1" }
-100 ! { dg-error "empty statement" }
+100 ! { dg-error "Statement label without statement" }
end
-subroutine foo ! Not checked ...
-end function ! ... but an error
-C { dg-excess-errors "warnings being treated as errors" }
+
! { dg-do compile }
-! { dg-options "-Werror -fmax-errors=1" }
-100 ! { dg-error "empty statement" }
+100 ! { dg-error "Statement label without statement" }
end
-subroutine foo ! Not checked ...
-end function ! ... but an error
-! { dg-excess-errors "warnings being treated as errors" }
! { dg-do compile }
-! { dg-options "-Werror" }
subroutine s
type t
- 1 ! { dg-error "empty statement" }
+ 1 ! { dg-error "Statement label without statement" }
end type
end subroutine
-! { dg-excess-errors "warnings being treated as errors" }
+++ /dev/null
-! { dg-do compile }
-! PR fortran/25756.
-! This used to ICE due to the space after the label.
-1 ! { dg-warning "Ignoring statement label in empty statement" }
-end
1234 complex :: cplx ! { dg-error "defined but cannot be used" }
cplx = 20.
-! gfc_warning_now:
- 1 ! { dg-error "Ignoring statement label in empty statement" }
end
! { dg-final { output-exists-not } }
! { dg-excess-errors "warnings being treated as errors" }