https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89033
Bug ID: 89033 Summary: gfortran accepts invalid code in select type construct with pointer assignment Product: gcc Version: 9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: mscfd at gmx dot net Target Milestone: --- The code below should be invalid, as the selector x has attribute "target" but not "pointer" inside the select type block (2008 draft, 8.1.3.3). The code compiles, but it gives a suprising output, namely x is still associated, despite the accepted "x => null()" line. program select_type_ptr implicit none type t integer :: i = 1 end type t class(*), pointer :: x type(t), pointer :: y allocate(x, source = t(3)) select type (x) type is (t) y => x x => null() end select print *, associated(x), associated(y) print *, y%i end program select_type_ptr