[Fortran,Patch] PR 45170 - Implement parsing/resolution of character deferred type parameter
Tobias Burnus
burnus@net-b.de
Sat Oct 23 20:27:00 GMT 2010
As Paul plans to implement "character(len=:)" support, I thought I
should update Steve's patch and submit it for review. Steve's posted his
patch at http://gcc.gnu.org/ml/fortran/2010-08/msg00181.html
The patch does the parsing and resolving of character deferred (length)
type parameter; after/during resolution, the compiler aborts with a
not-yet-implemented error.
I have changed some parts around in the patch - and have discovered PR
fortran/46152 on the way. Note: The bogus error message changes a bit
with and without this patch applied. That should be the part in
match_type_spec.
Build and regtested on x86-64-linux.
OK for the trunk?
Tobias
PS: Note for the actual implementation: For pointers, the length
parameter is the one of the target; thus, the length can not be saved in
the pointer. For example:
character(len=:), allocatable, target :: str
character(len=:), pointer :: pstr
pstr => str
str = "abc"
if(len(pstr) /= len(str) .or. len(str)/= 3) call abort()
str = "abcd"
if(len(pstr) /= len(str) .or. len(str)/= 4) call abort()
end
-------------- next part --------------
A non-text attachment was scrubbed...
Name: char-deferred-type-param.diff
Type: text/x-patch
Size: 15806 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20101023/e8f38a7f/attachment.bin>
More information about the Fortran
mailing list