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  <kargl@gcc.gnu.org>

	PR fortran/61318
	* interface.c (compare_parameter): Use better locus for error message.

2016-08-22  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/61318
	* gfortran.dg/pr61318.f90: New test.

From-SVN: r239667
This commit is contained in:
Steven G. Kargl 2016-08-22 18:18:14 +00:00
parent ad7a5a8fc5
commit 30364ce673
4 changed files with 34 additions and 2 deletions

View file

@ -1,10 +1,14 @@
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/61318
* interface.c (compare_parameter): Use better locus for error message.
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
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 <joseph@codesourcery.com>
PR c/32187

View file

@ -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;
}

View file

@ -1,3 +1,8 @@
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/61318
* gfortran.dg/pr61318.f90: New test.
2016-08-22 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/77260

View file

@ -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" } }