https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102333
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |accepts-invalid, | |ice-on-valid-code Last reconfirmed| |2021-09-14 CC| |anlauf at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from anlauf at gcc dot gnu.org --- The result clause is not needed. We even ICE on: function f(x) class(*), pointer :: f contains function g() procedure(f), pointer :: g end end or function f(x) class(*), allocatable :: f contains function g() procedure(f), pointer :: g end end Note however that the code in comment#1 is invalid and should be rejected.