diff options
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 6c9d057..f18eb41 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1858,9 +1858,18 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init, && current_ts.u.derived == gfc_current_block () && current_attr.pointer == 0) { + if (current_attr.allocatable + && !gfc_notify_std(GFC_STD_F2008, "Component at %C " + "must have the POINTER attribute")) + { + return false; + } + else if (current_attr.allocatable == 0) + { gfc_error ("Component at %C must have the POINTER attribute"); return false; } + } if (gfc_current_block ()->attr.pointer && (*as)->rank != 0) { @@ -4844,6 +4853,10 @@ gfc_match_data_decl (void) if (current_attr.pointer && gfc_comp_struct (gfc_current_state ())) goto ok; + if (current_attr.allocatable && gfc_current_state () == COMP_DERIVED + && current_ts.u.derived == gfc_current_block ()) + goto ok; + gfc_find_symbol (current_ts.u.derived->name, current_ts.u.derived->ns, 1, &sym); |