This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/72832] [6/7 Regression] [OOP] ALLOCATE with SOURCE fails to allocate requested dimensions
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 10 Aug 2016 13:22:31 +0000
- Subject: [Bug fortran/72832] [6/7 Regression] [OOP] ALLOCATE with SOURCE fails to allocate requested dimensions
- Auto-submitted: auto-generated
- References: <bug-72832-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72832
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P4
Known to work| |5.4.0
Summary|[OOP] ALLOCATE with SOURCE |[6/7 Regression] [OOP]
|fails to allocate requested |ALLOCATE with SOURCE fails
|dimensions |to allocate requested
| |dimensions
Known to fail| |6.1.0, 7.0
--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
BTW this is a regression. Compiling the code with 5.4.0 gives at runtime the
output
2
4
if compiled without -fcheck=bounds and
2
At line 11 of file pr72832.f90
Fortran runtime error: Array bound mismatch for dimension 1 of array 'b' (4/2)
with it.
> Just out of interest: what is the recommended way to allocate a class(t)
> variable of the same type as a but different size?
Not 100% sure, but may be you can use a scalar (it does seem to work for me).