Bug 41615 - Bogus error message: "internal function" should be "module procedure"
Summary: Bogus error message: "internal function" should be "module procedure"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: ---
Assignee: Daniel Kraft
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2009-10-07 08:11 UTC by Tobias Burnus
Modified: 2009-10-07 18:15 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-10-07 10:32:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2009-10-07 08:11:57 UTC
The following is properly rejected but the error message is bogus:

Error: Character-valued internal function 'assumed_len' at (1) must not be assumed length

I tried to find an internal function, but all I see is a module procedure. (For internal functions, assumed-length result values are also invalid.)

module funcs
   implicit none
contains
      function assumed_len(x)
         character(*) assumed_len
         integer, intent(in) :: x
      end function assumed_len
end module
Comment 1 Daniel Kraft 2009-10-07 10:32:55 UTC
Confirmed, I'll investigate what we can do here (and look at similar cases).
Comment 2 Daniel Kraft 2009-10-07 18:13:43 UTC
Subject: Bug 41615

Author: domob
Date: Wed Oct  7 18:13:28 2009
New Revision: 152534

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152534
Log:
2009-10-07  Daniel Kraft  <d@domob.eu>

	PR fortran/41615
	* resolve.c (resolve_contained_fntype): Clarify error message for
	invalid assumed-length character result on module procedures.

2009-10-07  Daniel Kraft  <d@domob.eu>

	PR fortran/41615
	* gfortran.dg/assumed_charlen_function_6.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/assumed_charlen_function_6.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog

Comment 3 Daniel Kraft 2009-10-07 18:15:38 UTC
Fixed on trunk, now the message really prints "module procedure" for module procedures.