gfortran: OOP features [Fortran 2003]

The upcoming 4.5 release of gfortran will contain some experimental support for polymorphic CLASS entities and object oriented features. The purpose of this page is to document which features have been implemented so far, what is still missing and which problems can be expected.

Implemented features

The following features are available on gfortran 4.5 trunk:

Unimplemented features

"fortran-dev" branch

The fortran-dev branch tracks the trunk and contains additional fixes.

Fixed for fortran-dev but not in the trunk/in 4.5

Open Problems

There are still several problematic areas. While e.g. scalar CLASS variables work mostly fine, there are a couple of issues with CLASS arrays:

Furthermore, the implementation of type-bound procedures is not perfect yet. Although they often work, there are many cases where polymorphic TBP calls fail at runtime:

Apart from these main problems, there are several minor bugs:

Internal Representation

The current implementation is such that each class(t) variable consists of a class container (named '.class.t') with the following fields:

For each derived type t we then construct a vtab entity (called vtab$t), which is of a type vtype$t and currently contains three fields:

For a correct handling of polymorphic type-bound procedures, the vtypes will have to be extended to contain procedure pointer components for the methods.

Fixed Bugs (29)

None: OOP (last edited 2009-12-17 09:53:55 by JanusWeil)