This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: Cryptic error message for procedure bound to a type
- From: Tobias Burnus <burnus at net-b dot de>
- To: Armelius Cameron <armeliusc at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Wed, 08 Sep 2010 16:50:35 +0200
- Subject: Re: Cryptic error message for procedure bound to a type
- References: <201009081026.18980.armeliusc@gmail.com>
Hi Armelius,
On 09/08/2010 04:26 PM, Armelius Cameron wrote:
I got the following error message that I don't understand:
-----------
procedure, private, pass ::&
1
Error: Non-polymorphic passed-object dummy argument of 'initialize_mv'
at (1)
The compiler is trying to tell you that your program violates the
following constraint:
C456 The passed-object dummy argument shall be a scalar, nonpointer,
nonallocatable dummy data object with the same declared type as the type
being dened; all of its length type parameters shall be assumed; it
shall be polymorphic (4.3.1.3) if and only if the type being dened is
extensible (4.5.7). It shall not have the VALUE attribute.
I would argue that your type "UnitValueForm" is extensible and that thus
the compiler is correct to reject:
subroutine Initialize_MV ( MV, Unit, Number )
type ( UnitValueForm ), intent ( inout ) ::&
MV
as "MX" is the passed-object dummy and it is not polymorphic, i.e. it is
not CLASS(UnitValueForm) but TYPE which is non-polymorphic.
Below is the complete output and module file. This module can be
compiled fine with the Cray's compiler. Thank you for any help.
That's a bug in the Cray compiler - the compiler is required* by the
standard to diagnose constraints.
Tobias
(* It might not diagnose by default as it might support this as vendor
extension, but there should be a flag such as "-std=f2008" to enable
standard-conforming checking.)