diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-06-19 18:04:46 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-06-19 18:04:46 +0000 |
commit | c9935123aef8eac547cdd0e8b06811fc776a6b32 (patch) | |
tree | b9bc470b02b25d6245435882c21c59a4da8ea708 /gcc/fortran/decl.c | |
parent | ee3aab6826f7dbfe0f1a509cb429f4a4d755f38b (diff) | |
download | gcc-c9935123aef8eac547cdd0e8b06811fc776a6b32.tar.gz |
re PR fortran/69398 ([OOP] ICE on class with duplicate dimension attribute specified)
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69398
* decl.c (attr_decl): Check for duplicate DIMENSION attribute for a
CLASS entity.
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69398
* gfortran.dg/pr69398.f90: New test.
From-SVN: r272481
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 5fc06e48f2d..7fcb60ab7ab 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -8372,6 +8372,15 @@ attr_decl1 (void) to the first component, or '_data' field. */ if (sym->ts.type == BT_CLASS && sym->ts.u.derived->attr.is_class) { + /* gfc_set_array_spec sets sym->attr not CLASS_DATA(sym)->attr. Check + for duplicate attribute here. */ + if (CLASS_DATA(sym)->attr.dimension == 1 && as) + { + gfc_error ("Duplicate DIMENSION attribute at %C"); + m = MATCH_ERROR; + goto cleanup; + } + if (!gfc_copy_attr (&CLASS_DATA(sym)->attr, ¤t_attr, &var_locus)) { m = MATCH_ERROR; |