https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104625
--- Comment #5 from anlauf at gcc dot gnu.org --- (In reply to Paul Thomas from comment #4) > Created attachment 56192 [details] > Fix for this PR I was thinking of something along these lines, but was wondering: a) there could be multiple nested parentheses, not just one. (-> while loop?) b) I think the associate name cannot be used in a variable definition context if the selector is a temporary (i.e. parenthesized) > This will require careful perusal of the standard to make sure that there > are not other exclusions. Besides (b)? > I'm onto it. This is great. FYI: a further reduced testcase: program p implicit none type t integer :: a end type contains subroutine s(x) ! class(t) :: x ! OK class(t) :: x(:) ! ICE in combination with below select type (y => x) ! OK type is (t) end select select type (z => (x)) ! ICE type is (t) end select select type (u => ((x))) ! ICE type is (t) end select end end