diff options
author | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-29 10:45:21 +0000 |
---|---|---|
committer | janus <janus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-12-29 10:45:21 +0000 |
commit | cc7db007abde2792b4585175041131e4ca8a5cff (patch) | |
tree | 09c521ceb79d4e0937eba0cc70142b17b77d1255 /gcc/fortran/primary.c | |
parent | d906bde3d663e443642883dc6e6e34dc406fb7ca (diff) | |
download | gcc-cc7db007abde2792b4585175041131e4ca8a5cff.tar.gz |
2014-12-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/60357
* array.c (check_constructor): Ignore empty expressions.
* expr.c (check_alloc_comp_init): Check if constructor expression
exists.
* primary.c (build_actual_constructor): Warn for absent alloc-comp
initializers in pre-2008 standards.
2014-12-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/60357
* gfortran.dg/alloc_comp_constructor_7.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/primary.c')
-rw-r--r-- | gcc/fortran/primary.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 77522e54bf0..78c24d48015 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2367,6 +2367,13 @@ build_actual_constructor (gfc_structure_ctor_component **comp_head, return false; value = gfc_copy_expr (comp->initializer); } + else if (comp->attr.allocatable) + { + if (!gfc_notify_std (GFC_STD_F2008, "No initializer for " + "allocatable component '%s' given in the structure " + "constructor at %C", comp->name)) + return false; + } else if (!comp->attr.deferred_parameter) { gfc_error ("No initializer for component %qs given in the" |