From 9b46f94ffa7a8c7e3ddc95980359c75858d09f9c Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 28 Oct 2005 20:05:56 +0000 Subject: [PATCH] re PR fortran/24545 (gfortran bug regarding interface block with named END INTERFACE statements) PR fortran/24545 * interface.c (gfc_match_end_interface): Fix typo in INTERFACE_USER_OP case. From-SVN: r105953 --- gcc/fortran/ChangeLog | 6 +++++ gcc/fortran/interface.c | 2 +- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/gfortran.dg/interface_2.f90 | 29 +++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.dg/interface_2.f90 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3632e9eb8b0..f31943c71f2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-10-28 Steven Bosscher + + PR fortran/24545 + * interface.c (gfc_match_end_interface): Fix typo in + INTERFACE_USER_OP case. + 2005-10-26 Francois-Xavier Coudert PR fortran/15586 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 5314d87f9b0..d8da617a9f7 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -295,7 +295,7 @@ gfc_match_end_interface (void) /* Comparing the symbol node names is OK because only use-associated symbols can be renamed. */ if (type != current_interface.type - || strcmp (current_interface.sym->name, name) != 0) + || strcmp (current_interface.uop->name, name) != 0) { gfc_error ("Expecting 'END INTERFACE OPERATOR (.%s.)' at %C", current_interface.sym->name); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 85a10d83819..35e969423c4 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-10-28 Steven G. Kargl + + PR fortran/24545 + * gfortran.dg/interface_2.f90: new test. + 2005-10-28 Josh Conner PR c++/22153 diff --git a/gcc/testsuite/gfortran.dg/interface_2.f90 b/gcc/testsuite/gfortran.dg/interface_2.f90 new file mode 100644 index 00000000000..6b0bf2b239b --- /dev/null +++ b/gcc/testsuite/gfortran.dg/interface_2.f90 @@ -0,0 +1,29 @@ +! { dg-do compile } +! PR fortran/24545 +MODULE Compare_Float_Numbers + + IMPLICIT NONE + + INTERFACE Compare_Float + MODULE PROCEDURE Compare_Float_Single + END INTERFACE Compare_Float + + INTERFACE OPERATOR (.EqualTo.) + MODULE PROCEDURE Is_Equal_To_Single + END INTERFACE OPERATOR (.EqualTo.) + +CONTAINS + + FUNCTION Is_Equal_To_Single(x, y) RESULT(Equal_To) + REAL(4), INTENT(IN) :: x, y + LOGICAL :: Equal_To + Equal_To = .true. + END FUNCTION Is_Equal_To_Single + + FUNCTION Compare_Float_Single(x, y) RESULT(Compare) + REAL(4), INTENT(IN) :: x, y + LOGICAL :: Compare + Compare = .true. + END FUNCTION Compare_Float_Single + +END MODULE Compare_Float_Numbers