! { dg-do run } ! Test fix for PR114141 ! Contributed by Steve Kargl program foo implicit none real :: y complex :: z = cmplx(-1,0) associate (x => log(cmplx(-1,0))) y = x%im ! Gave 'Symbol ‘x’ at (1) has no IMPLICIT type' if (int(100*y)-314 /= 0) stop 1 end associate ! Check wrinkle in comment 1 (parentheses around selector) of the PR is fixed. associate (x => ((log(cmplx(-1,0))))) y = x%im ! Gave 'The RE or IM part_ref at (1) must be applied to a ! COMPLEX expression' if (int(100*y)-314 /= 0) stop 2 end associate ! Make sure that IMAG intrinsic is OK. associate (x => ((log(cmplx(-1,0))))) y = imag (x) if (int(100*y)-314 /= 0) stop 3 end associate end program