From 77be94177af869102947cd86163eb894aa1b92a3 Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Sat, 25 Feb 2017 00:40:42 +0100 Subject: [PATCH] re PR fortran/79597 (Incomplete error message "Expecting % PR fortran/79597 * interface.c (gfc_match_end_interface): Remove spurious comma and space, replace 'got %s' with 'got %qs'. 2017-02-25 Dominique d'Humieres PR fortran/79597 * gfortran.dg/dtio_6.f90: Update test. 2017-02-25 Dominique d'Humieres PR fortran/79601 * interface.c (check_dtio_arg_TKR_intent): Change 'intent' to 'INTENT'. 2017-02-25 Dominique d'Humieres PR fortran/79601 * gfortran.dg/interface_operator_2.f90: New test. From-SVN: r245729 --- gcc/fortran/ChangeLog | 12 ++++++++++++ gcc/fortran/interface.c | 6 +++--- gcc/testsuite/ChangeLog | 10 ++++++++++ gcc/testsuite/gfortran.dg/dtio_6.f90 | 2 +- gcc/testsuite/gfortran.dg/interface_operator_2.f90 | 10 ++++++++++ 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gfortran.dg/interface_operator_2.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bd4d971b212..6ee14745adf 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2017-02-25 Dominique d'Humieres + + PR fortran/79601 + * interface.c (check_dtio_arg_TKR_intent): Change 'intent' + to 'INTENT'. + +2017-02-25 Dominique d'Humieres + + PR fortran/79597 + * interface.c (gfc_match_end_interface): Remove spurious comma + and space, replace 'got %s' with 'got %qs'. + 2017-02-20 Paul Thomas PR fortran/79599 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 53701f2e6ef..80dae027da0 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -398,10 +398,10 @@ gfc_match_end_interface (void) m = MATCH_ERROR; if (strcmp(s2, "none") == 0) gfc_error ("Expecting % " - "at %C, ", s1); + "at %C", s1); else gfc_error ("Expecting % at %C, " - "but got %s", s1, s2); + "but got %qs", s1, s2); } } @@ -4623,7 +4623,7 @@ check_dtio_arg_TKR_intent (gfc_symbol *fsym, bool typebound, bt type, "ASSUMED SHAPE ARRAY", &fsym->declared_at); if (fsym->attr.intent != intent) - gfc_error ("DTIO dummy argument at %L must have intent %s", + gfc_error ("DTIO dummy argument at %L must have INTENT %s", &fsym->declared_at, gfc_code2string (intents, (int)intent)); return; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 651eb79a237..6e37ca9b5fe 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,13 @@ +2017-02-25 Dominique d'Humieres + + PR fortran/79597 + * gfortran.dg/dtio_6.f90: Update test. + +2017-02-25 Dominique d'Humieres + + PR fortran/79601 + * gfortran.dg/interface_operator_2.f90: New test. + 2017-02-24 Jakub Jelinek PR c/79677 diff --git a/gcc/testsuite/gfortran.dg/dtio_6.f90 b/gcc/testsuite/gfortran.dg/dtio_6.f90 index 089db6facf0..db7e4a83ba2 100644 --- a/gcc/testsuite/gfortran.dg/dtio_6.f90 +++ b/gcc/testsuite/gfortran.dg/dtio_6.f90 @@ -59,7 +59,7 @@ CONTAINS READ (UNIT = UNIT, FMT = *) dtv%name, dtv%age END SUBROUTINE prf - SUBROUTINE pwuf (dtv,unit,iostat,iomsg) ! { dg-error "must have intent IN" } + SUBROUTINE pwuf (dtv,unit,iostat,iomsg) ! { dg-error "must have INTENT IN" } CLASS(person), INTENT(INOUT) :: dtv INTEGER, INTENT(IN) :: unit INTEGER, INTENT(OUT) :: iostat diff --git a/gcc/testsuite/gfortran.dg/interface_operator_2.f90 b/gcc/testsuite/gfortran.dg/interface_operator_2.f90 new file mode 100644 index 00000000000..a73959650e2 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_operator_2.f90 @@ -0,0 +1,10 @@ +! { dg-do compile } +! PR fortran/66106 +! +! Original code from Gerhard Steinmetz +! +program p + interface operator ( .gt. ) + end interface operator (.lt.) ! { dg-error "END INTERFACE OPERATOR" } +end program p ! { dg-error "END INTERFACE" } +! { dg-excess-errors "Unexpected end of file" } -- 2.30.2