| ! Tests pointer function selectors in ASSOCIATE. |
| ! Contributed by Harald Anlauf <anlauf@gmx.de> in |
| ! https://gcc.gnu.org/pipermail/fortran/2024-March/060294.html |
| print *, lbound (q), ubound (q) ! Should print -3 3 (OK) |
| associate (q => set_ptr()) |
| print *, lbound (q), ubound (q) ! Should print -3 3 (OK) |
| print *, q(:)% i ! <<< ... has no IMPLICIT type |
| print *, lbound (q), ubound (q) ! Should print 1 7 (OK) |
| associate (q => (set_ptr())) |
| print *, lbound (q), ubound (q) ! Should print 1 7 (OK) |
| print *, q(:)% i ! <<< ... has no IMPLICIT type |
| function set_ptr () result (res) |
| type(t), pointer :: res(:) |