This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/61318] New: Improve error diagnostic by pointing to the expression and not to declared-at of a USE-associated variable


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61318

            Bug ID: 61318
           Summary: Improve error diagnostic by pointing to the expression
                    and not to declared-at of a USE-associated variable
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

Found at https://groups.google.com/forum/#!topic/comp.lang.fortran/H-xEKHAWEZ4
- without properly checking whether it has been reported before or not.


The error message

  use gbl_message
      1
Error: Type mismatch in argument 'message' at (1); passed INTEGER(4) to
CHARACTER(1) 

is misleading and seems to point to the "sym->declared_at" of the symbol
instead of to the "expr->where" in the call statement. Especially for
USE-associated variables, the sym->decared_at is not a very helpful daignostic
location.


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')
end program test


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]