Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 415

Internal compiler error with overloaded structure constructor and MERGE

$
0
0

The following use of MERGE inside an overloaded structure constructor results in an internal compiler error.

MODULE Direct2D
  IMPLICIT NONE
  PRIVATE

  TYPE, BIND(C), PUBLIC :: D2D1_POINT_2F
    REAL :: x = 0.0
    REAL :: y = 0.0
  END TYPE D2D1_POINT_2F

  TYPE, BIND(C), PUBLIC :: D2D1_RECT_F
    REAL :: left = 0.0
    REAL :: top = 0.0
    REAL :: right = 0.0
    REAL :: bottom = 0.0
  END TYPE D2D1_RECT_F
  INTERFACE D2D1_RECT_F
    MODULE PROCEDURE D2D1_RECT_F_constructor_point_point
  END INTERFACE D2D1_RECT_F

  PUBLIC :: FillRectangle
CONTAINS
  FUNCTION D2D1_RECT_F_constructor_point_point(top_left, bottom_right)  &
       RESULT(rect)
    TYPE(D2D1_POINT_2F), INTENT(IN) :: top_left
    TYPE(D2D1_POINT_2F), INTENT(IN) :: bottom_right
    TYPE(D2D1_RECT_F) :: rect
    rect%left = 0.0
  END FUNCTION D2D1_RECT_F_constructor_point_point

  SUBROUTINE FillRectangle(rect)
    TYPE(D2D1_RECT_F), INTENT(IN) :: rect
  END SUBROUTINE FillRectangle
END MODULE Direct2D

SUBROUTINE draw_swatch
  USE Direct2D
  IMPLICIT NONE
  CALL FillRectangle(  &
      D2D1_RECT_F( &
        1.0,  &
        1.0 - 5.0,  &
        1.0 + MERGE(38.0, -5.0, .TRUE.),  &
        1.0 + 5.0 ) )
END SUBROUTINE draw_swatch

 

>ifort /c "2016-05-04 ice.f90"
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.2.180 Build 20160204
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

2016-05-04 ice.f90(38): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
  CALL FillRectangle(  &
^
[ Aborting due to internal error. ]
compilation aborted for 2016-05-04 ice.f90 (code 1)

 


Viewing all articles
Browse latest Browse all 415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>