https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78033
--- Comment #5 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Oct 19, 2016 at 04:17:34AM +0000, kargl at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78033 > > --- Comment #2 from kargl at gcc dot gnu.org --- > (In reply to kargl from comment #1) > > Reduced testcase. > > > > function f(n, x) > > integer, intent(in) :: n > > complex, intent(in) :: x(1:n) > > real :: f > > f = g([real(x(1:n)), aimag(x(1:n))]) > > end function f > > > > If the array sections are removed in favor of the whole array, > > the code compiles. > > Even further reduction. > > subroutine f(n, x) > integer, intent(in) :: n > complex, intent(in) :: x(1:n) > real :: y(2*n) > y = [real(x(1:n), aimag(x(1:n))] > end subroutine f > > The constructor with array sections is going south. > A even further reduced testcase. subroutine f(n, x) integer, intent(in) :: n complex, intent(in) :: x(1:n) real :: y(2*n) ! y = [ real(x)] ! This works. y = [ real(x(1:n))] ! This fails. end subroutine f The REAL in the array constructor is confusing the mechanism for looking for a typespeci, e.g., [ REAL :: x(1:n)]