This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/39997] Procedure(), pointer & implicit typing: rejects-valid / accepts-invalid?
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Jun 2009 12:59:28 -0000
- Subject: [Bug fortran/39997] Procedure(), pointer & implicit typing: rejects-valid / accepts-invalid?
- References: <bug-39997-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from burnus at gcc dot gnu dot org 2009-06-24 12:59 -------
(In reply to comment #3)
Regarding the implicit typing: I think it would be easiest to apply the
implicit typing for
module m
external foo
end module m
at resolution time, such that "foo" is marked as ts.type = "real", ts.kind = 4,
but such that one still knows that "foo" can still be a subroutine. One
probably needs another flag, but maybe the one can re-use a current flag
without ambiguity arising. The challenge is to find all places where BT_UNKNOWN
is checked to for functions/subroutines/procedure (pointers) - be it in
interface/symbol/resolve or in trans*.c. We don't need another flag if
(!attr.functions && attr.implicit_type) can never occur with the current code.
Or when we can use attr.untyped somehow.
In any case writing a single flag (per symbol) to the .mod file is easier that
dumping the complete implicit typing stuff there and applying the right type to
the host-associated variable.
Another test case, currently works, but still needs to work after fixing the
implicit stuff:
module m
implicit logical(1)(a-z)
external proc
end module m
use m
call proc()
end
* * *
Proc-pointer assignment of "ptr => Function" w/ "ptr" with "ptr" being
implicitly typed (including null mapping -> SUBROUTINE), where the
function-return-type does not match the implicit type for ptr: This still does
not produce an error. Maybe it can be fixed as part of PR 40541
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39997