module m implicit none contains subroutine double(i) integer :: i i = 2*i end subroutine double function bar() result(res) procedure(double), pointer :: res res => double end function bar subroutine foo(i) integer :: i ! This works: procedure(), pointer :: proc call double(i) proc => bar() call proc(i) ! This fails: associate (var => bar()) call var(i) ! { dg-bogus "VARIABLE attribute of 'var' conflicts with PROCEDURE attribute" } end associate end subroutine foo end module m program test use m implicit none (type, external) integer :: i i = 50 call foo(i) if (i /= 50*2*2) stop 1 end program test