[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2021-09-10 Thread anlauf at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

anlauf at gcc dot gnu.org changed:

   What|Removed |Added

 Resolution|--- |FIXED
 CC||anlauf at gcc dot gnu.org
 Status|ASSIGNED|RESOLVED

--- Comment #8 from anlauf at gcc dot gnu.org ---
Backported to remaining open branches after verifying that it works.  Closing.

Thanks to all!

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2021-09-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

--- Comment #7 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:19f2f22d59f4a3a7e246d09be11a727cffb8badc

commit r9-9722-g19f2f22d59f4a3a7e246d09be11a727cffb8badc
Author: Paul Thomas 
Date:   Tue Dec 29 17:44:48 2020 +

Fortran: Correct missing structure constructor comps. [PR97612].

2020-12-29  Paul Thomas  

gcc/fortran
PR fortran/97612
* primary.c (build_actual_constructor): Missing allocatable
components are set unallocated using EXPR_NULL. Then missing
components are tested for a default initializer.

gcc/testsuite/
PR fortran/97612
* gfortran.dg/structure_constructor_17.f90: New test.

(cherry picked from commit eeb145317b42d5203056851435457d9189a7303d)

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2021-09-10 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

--- Comment #6 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Harald Anlauf
:

https://gcc.gnu.org/g:80b1492b2de153f4850a32cafcd8f4d37c2c84fc

commit r10-10111-g80b1492b2de153f4850a32cafcd8f4d37c2c84fc
Author: Paul Thomas 
Date:   Tue Dec 29 17:44:48 2020 +

Fortran: Correct missing structure constructor comps. [PR97612].

2020-12-29  Paul Thomas  

gcc/fortran
PR fortran/97612
* primary.c (build_actual_constructor): Missing allocatable
components are set unallocated using EXPR_NULL. Then missing
components are tested for a default initializer.

gcc/testsuite/
PR fortran/97612
* gfortran.dg/structure_constructor_17.f90: New test.

(cherry picked from commit eeb145317b42d5203056851435457d9189a7303d)

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2021-05-04 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

Richard Biener  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2020-12-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

--- Comment #5 from CVS Commits  ---
The master branch has been updated by Paul Thomas :

https://gcc.gnu.org/g:eeb145317b42d5203056851435457d9189a7303d

commit r11-6365-geeb145317b42d5203056851435457d9189a7303d
Author: Paul Thomas 
Date:   Tue Dec 29 17:44:48 2020 +

Fortran: Correct missing structure constructor comps. [PR97612].

2020-12-29  Paul Thomas  

gcc/fortran
PR fortran/97612
* primary.c (build_actual_constructor): Missing allocatable
components are set unallocated using EXPR_NULL. Then missing
components are tested for a default initializer.

gcc/testsuite/
PR fortran/97612
* gfortran.dg/structure_constructor_17.f90: New test.

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2020-12-18 Thread pault at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

Paul Thomas  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |pault at gcc dot gnu.org
 CC||pault at gcc dot gnu.org

--- Comment #4 from Paul Thomas  ---
Created attachment 49794
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49794&action=edit
Fix for the PR

This fixes the PR by effectively changing a=t() to a=t(NULL()). It even
regtests!

I need to check that this is correct when a default initializer is present for
scalar, allocatable components.

Watch this space!

Paul

[Bug fortran/97612] [F08] Structure constructor of type with nested allocatable array components fails to compile

2020-12-07 Thread dominiq at lps dot ens.fr via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97612

Dominique d'Humieres  changed:

   What|Removed |Added

   Priority|P3  |P4
 Status|WAITING |NEW
Summary|Structure constructor of|[F08] Structure constructor
   |type with nested|of type with nested
   |allocatable array   |allocatable array
   |components fails to compile |components fails to compile

--- Comment #3 from Dominique d'Humieres  ---
> So it looks like the provided code example is not valid F03 but valid F08.

So my question was not totally stupid!