[Patch fortran] PR84432 & PR114815 - test for non-conforming default PDT initializers
Paul Richard Thomas
paul.richard.thomas@gmail.com
Fri Sep 5 06:29:54 GMT 2025
Nit eradicated and pushed as r16-3590.
Thanks
Paul
On Thu, 4 Sept 2025 at 21:53, Harald Anlauf <anlauf@gmx.de> wrote:
> Hi Paul!
>
> Am 04.09.25 um 20:46 schrieb Paul Richard Thomas:
> > Hi All,
> >
> > PDT components with default initializers must have type parameter and
> > length expressions that reduce to compile time integer constants. The
> chunk
> > in expr.cc verifies that this is the case for array bounds and character
> > lengths.
> >
> > This error checking results in pdt_26.f03 segfaulting because, without a
> > default initializer, the parameterized components are not allocated and
> it
> > segfaults in runtime. The first chunk in trans-expr.cc fixes this. It has
> > been checked for runtime memory leaks with valgrind. The whole point of
> > pdt_27.f03 was to fix a problem with initialized, parameterized
> > components(!), so it has been taken over to exercise the error checking.
> >
> > Regtests on FC42/x86_64 - OK for mainline?
>
> A minor nit: there is a double-space after %qs in
>
> + gfc_error ("The component %qs at %L of derived type %qs has "
>
> Otherwise this looks good.
>
> Thanks for the patch!
>
> Harald
>
> > Regards
> >
> > Paul
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://gcc.gnu.org/pipermail/fortran/attachments/20250905/d41b29a9/attachment-0001.htm>
More information about the Fortran
mailing list