Aleksandar Donev writes:
> Hello,
>
> I have asked this before but don't recall the exact answer:
> Is it illegal to have an empty derived type in Fortran 95?
Yes, it is illegal. Just look at the bnf - it isn't subtle at all.
The bnf for <derived-type-def> is R442 on pg 38. You see there
that it includes a <component-def-stmt> that is distinctly
not optional. There is a separate line in the bnf for subsequent
<component-def-stmt>s that are optional.
> I know it is not in Fortran 2003...
>
> If yes, whoever made that rule!?!
I assume you mean why instead of who. I have no more basis for
speculation than anyone else. Note that without type extension,
the utility of such a things is somewhat limited, though I can
think of 2 possibly useful applications of them.
--
Richard Maine | Good judgment comes from experience;
[log in to unmask] | experience comes from bad judgment.
| -- Mark Twain
|