Bug 37222 - [OOP] Checks when overriding type-bound procedures are incomplete
Summary: [OOP] Checks when overriding type-bound procedures are incomplete
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2008-08-24 17:00 UTC by Daniel Kraft
Modified: 2013-12-10 21:56 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-03-29 08:52:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kraft 2008-08-24 17:00:59 UTC
In 4.5.6.2 of the draft F2003 standard ("Type-bound procedure overriding") a list of conditions is given that an overriding type-bound procedure must satisfy; the checks that function result characteristics and characteristics of corresponding dummy arguments are the same are incomplete in the current implementation.  This corresponds to two FIXME's in resolve.c / check_typebound_overrid.

At the moment, only gfc_compare_types is called; among the items that fail to be checked are rank, array shape (if known), ALLOCATABLE/POINTER attributes and INTENT declarations.
Comment 1 janus 2011-09-10 15:02:33 UTC
(In reply to comment #0)
> At the moment, only gfc_compare_types is called; among the items that fail to
> be checked are rank, array shape (if known), ALLOCATABLE/POINTER attributes and
> INTENT declarations.

There are a few related PRs:
 * for the INTENT check there is PR47978
 * PR35831 concerns the shape check (originally for dummy procedure arguments, but it applies to TBP overriding in the same way)

This PR can be used to track some of the missing checks:
 * ALLOCATABLE/POINTER
 * string length
 * ...
Comment 2 janus 2011-09-11 20:43:13 UTC
(In reply to comment #1)
> This PR can be used to track some of the missing checks:
>  * ALLOCATABLE/POINTER
>  * string length
>  * ...

http://gcc.gnu.org/viewcvs?view=revision&revision=178767 fixes already most of this, but there are at least three FIXMEs left in 'check_dummy_characteristics'.
Comment 3 janus 2013-12-10 21:56:48 UTC
Basically all the checks in this area have been fixed by now.

One of the last todo items is a carry-over from PR 35831:
* improve gfc_dep_compare_expr to catch more cases (and/or enable the warnings in check_result_characteristics and check_dummy_characteristics, marked by FIXMEs)