If one compiles with -std=f95 the following program: ----------------------- ! { dg-do compile } ! { dg-options "-std=f2003" } ! Check whether empty contains are allowd module x contains end module x ! { dg-error "CONTAINS statement must be followed by a FUNCTION or SUBROUTINE statement" }
program y contains end program y ! { dg-error "CONTAINS statement must be followed by a FUNCTION or SUBROUTINE statement" } ------------------ The location shown is not really helpful: -------------------------- contains.f90:6: nt" } 1 Error: Fortran 2008: CONTAINS statement must be followed by a FUNCTION or SUBROUTINE statement at (1). contains.f90:10: nt" } 1 -------------------------- Expected: - String is not trimmed that early (only 5 characters shown) - 1 is not under a comment Example for a better output: end module x ! { dg-error "CONTAINS statement must 1 or as ifort (the "^" is below the "e" of "end module"): end module x ! { dg-error "CONTAINS statement must be followed by a FUNCTION or SUBROUTINE statement" } ^ -- Summary: Error/warning message should ignore comments for "1" in %C output Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: diagnostic Severity: enhancement Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29819