https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102331
--- Comment #4 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Wed, Sep 15, 2021 at 08:57:45PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102331 > > --- Comment #3 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #2) > > The following patch fixes the problem. It has not been regression tested. > > This restores the error, but for CLASS I now get: > > pr102331.f90:2:3: > > 2 | allocatable :: f > | 1 > Error: Unclassifiable statement at (1) > pr102331.f90:1:0: > > 1 | class(t) function f() > | > Error: The type for function 'f' at (1) is not accessible > > while the error message for line 2 does not show up for TYPE. > Maybe there are a few more places that need fixing. > (Not only the obvious one after the second hunk for parse.c). > Yes, likely, 'ts.type == BT_CLASS' needs to be sprinkled in other places. Unfortunately, the 'Unclassifiable statement' error is a last resort catch-all error. I know little about the CLASS implementation. I suspect BT_CLASS takes a much different path through the compiler.