gfortran: OOP features [Fortran 2003/2008]

OOP here refers to "Object-Oriented Programming", which was introduced to Fortran in the 2003 standard. The purpose of this page is to document which features have been implemented in gfortran so far, what is still missing and which problems can be expected.


Implemented features

The following features are available in gfortran 4.5:

These additional features are available in 4.6:

These additional features are available in 4.7:

These additional features are available in 4.8:

These additional features are available in 4.9:

Unimplemented features

Internal Representation

The current implementation is such that each class(t) variable consists of a class container (named __class_X) with two fields (PR53971):

For each derived type t we then construct a vtab entity (called __vtab_X), which is of a type __vtype_X and contains the following fields:

In the naming of class containers, vtabs and vtypes, the X is usually being replaced by a combination of module name and type name. However, if the resulting string is too long, we insert a hashed string instead, which is a hex representation of the type's _hash value.

Object-oriented Fortran codes


Open Problems

[Here is a list of all OOP-related bugs.]

PRs related to CLASS arrays (14):

Also the implementation of SELECT TYPE still has a few bugs (9):

Bugs concerning type-bound generics & operators (7):

Miscellaneous (compile-time) bugs (17):

Accepts-invalid, ICE-on-invalid and diagnostic bugs (9):

Runtime problems (wrong code, missed optimization) (11):

Extended features of Fortran 2008 (9):

Non-standard extensions (1):

Fixed Bugs

Fixed in 4.5 (34)

Fixed in 4.6 (84)

Fixed in 4.7 (57)

Backported (1):

Fixed in 4.8 (35)

Backported (1):

Fixed in 4.9 (31)

None: OOP (last edited 2014-05-12 20:15:11 by TobiasBurnus)