Implicitly typed functions

Paul Brook paul@codesourcery.com
Sat Jan 22 15:24:00 GMT 2005


When applying an implicit type to a function result we should take that 
implicit type from the function namespace, not it's parent namespace.
Attached patch fixes this.
It also ensures we apply implicit derived types to all symbols during parsing, 
not just unknown ones.

Tested on i686-linux.
Applied to mainline.

Paul

2005-01-22  Paul Brook  <paul@codesourcery.com>

 * primary.c (gfc_match_rvalue): Only apply implicit type if variable
 does not have an explicit type.
 (gfc_match_variable): Resolve implicit derived types in all cases.
 Resolve contained function types from their own namespace, not the
 parent.
 * resolve.c (resolve_contained_fntype): Remove duplicate sym->result
 checking.  Resolve from the contained namespace, not the parent.
testsuite/
 * gfortran.dg/implicit_2.f90: New test.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.implicit_derived
Type: text/x-diff
Size: 3371 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050122/21fed363/attachment.bin>


More information about the Fortran mailing list