===================================================================
@@ -1071,13 +1071,8 @@ next_free (void)
}
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 == '!')
@@ -1333,8 +1328,7 @@ next_fixed (void)
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 ();
===================================================================
@@ -1,7 +1,4 @@
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" }
+
===================================================================
@@ -1,7 +1,3 @@
! { 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" }
===================================================================
@@ -1,8 +1,6 @@
! { 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" }
===================================================================
@@ -1,5 +1,5 @@
! { 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" }
+1 ! { dg-error "Statement label without statement" }
end
===================================================================
@@ -20,8 +20,6 @@
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" }