Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29419 Discussions

Diagnostic for incompatible arguments to MOVE_ALLOC

IanH
Honored Contributor III
1,002 Views

MOVE_ALLOC requires that `to` be type compatible with `from`.  Could the compiler please diagnose when this requirement is not met.

MODULE m
  IMPLICIT NONE
  TYPE :: NotMyParent
  END TYPE NotMyParent
  TYPE :: NotAnExtension
  END TYPE NotAnExtension
CONTAINS
  SUBROUTINE proc
    CLASS(NotMyParent), ALLOCATABLE :: to
    TYPE(NotAnExtension), ALLOCATABLE :: from
    !****
    CALL MOVE_ALLOC(from, to)
  END SUBROUTINE proc
END MODULE m

 

>ifort /c /check:all /warn:all /standard-semantics move-alloc-not-an-extension.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 201407
26
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

(... hours of fun and games begin here...)

 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
1,002 Views

Thanks - escalated as DPD200361056.

0 Kudos
Steven_L_Intel1
Employee
1,002 Views

Fixed in a release later this year.

0 Kudos
Reply