http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55501
janus at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed| |2012-11-28 CC| |janus at gcc dot gnu.org Summary|ICE using MERGE in constant |[F03] ICE using MERGE in |expr |constant expr Ever Confirmed|0 |1 --- Comment #2 from janus at gcc dot gnu.org 2012-11-28 09:16:13 UTC --- I can confirm this error. It occurs with all gfortran versions I tried (starting from 4.3 up to the current trunk). Slightly compactified test case: module test type MPI_Datatype integer :: mpi_val end type type(MPI_Datatype) :: MPI_INTEGER = merge(MPI_Datatype(4), MPI_Datatype(8), .false.) end module Apparently the declaration needs to be in a module for the error to occur, and also derived types need to be involved. Using -std=f95, the test case is correctly rejected (without ICE): type(MPI_Datatype) :: MPI_INTEGER = merge(MPI_Datatype(4), MPI_Datatype(8), . 1 Error: Fortran 2003: Elemental function as initialization expression with non-integer/non-character arguments at (1)