1! { dg-do compile }
2! { dg-options "-O -Wuninitialized" }
3
4module foo
5implicit none
6
7  type bar
8    integer :: yr
9  end type
10
11contains
12
13  function baz(arg) result(res) ! { dg-bogus "res.yr' may be" }
14    type(bar), intent(in) :: arg
15    type(bar) :: res
16    logical, external:: some_func
17    if (.not. some_func(arg)) then
18      call fatal('arg not valid')
19    else
20      res = arg
21    end if
22  end function baz ! { dg-warning "res.yr' may be" }
23
24end module foo
25