From: Steven G. Kargl Date: Mon, 22 Aug 2016 18:18:14 +0000 (+0000) Subject: re PR fortran/61318 (Improve error diagnostic by pointing to the expression and not... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=30364ce673723a466def350c7378ddd3cc0c6c87;p=gcc.git re PR fortran/61318 (Improve error diagnostic by pointing to the expression and not to declared-at of a USE-associated variable) 2016-08-22 Steven G. Kargl PR fortran/61318 * interface.c (compare_parameter): Use better locus for error message. 2016-08-22 Steven G. Kargl PR fortran/61318 * gfortran.dg/pr61318.f90: New test. From-SVN: r239667 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 900d91560f2..a7be7c6ffd6 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,10 +1,14 @@ +2016-08-22 Steven G. Kargl + + PR fortran/61318 + * interface.c (compare_parameter): Use better locus for error message. + 2016-08-22 Steven G. Kargl PR fortran/77260 * gcc/fortran/trans-decl.c (generate_local_decl): Suppress warning for unused variable if symbol is entry point. - 2016-08-19 Joseph Myers PR c/32187 diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c index 5bd1279291e..b894b2ff5b1 100644 --- a/gcc/fortran/interface.c +++ b/gcc/fortran/interface.c @@ -2146,7 +2146,7 @@ compare_parameter (gfc_symbol *formal, gfc_expr *actual, { if (where) gfc_error ("Type mismatch in argument %qs at %L; passed %s to %s", - formal->name, &actual->where, gfc_typename (&actual->ts), + formal->name, where, gfc_typename (&actual->ts), gfc_typename (&formal->ts)); return 0; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 82b4db4d960..9cc5fb51739 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-08-22 Steven G. Kargl + + PR fortran/61318 + * gfortran.dg/pr61318.f90: New test. + 2016-08-22 Steven G. Kargl PR fortran/77260 diff --git a/gcc/testsuite/gfortran.dg/pr61318.f90 b/gcc/testsuite/gfortran.dg/pr61318.f90 new file mode 100644 index 00000000000..4e7e862c443 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr61318.f90 @@ -0,0 +1,23 @@ +! { dg-do compile } +! +module gbl_message + type :: mytype + integer(kind=4) :: e + end type mytype + type(mytype), parameter :: seve = mytype(1) +end module gbl_message + +module gbl_interfaces + interface + subroutine gagout(message) + character(len=*), intent(in) :: message + end subroutine gagout + end interface +end module gbl_interfaces + +program test + use gbl_message + use gbl_interfaces + call gagout(seve%e,'Some string') ! { dg-error "Type mismatch in argument" } +end program test +! { dg-final { cleanup-modules "gbl_interfaces gbl_message" } }