aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2022-12-08 22:50:45 +0100
committerHarald Anlauf <anlauf@gmx.de>2022-12-08 22:50:45 +0100
commit3a9f6d5a8ee490adf9a18f93feaf86542642be7d (patch)
treefc2989bdd56999446e2555acace56733be9f3330 /gcc/fortran
parent7410032a772a9e77b620b091c2b551b68113a179 (diff)
downloadgcc-3a9f6d5a8ee490adf9a18f93feaf86542642be7d.zip
gcc-3a9f6d5a8ee490adf9a18f93feaf86542642be7d.tar.gz
gcc-3a9f6d5a8ee490adf9a18f93feaf86542642be7d.tar.bz2
Fortran: diagnose and reject duplicate CONTIGUOUS attribute [PR108025]
gcc/fortran/ChangeLog: PR fortran/108025 * symbol.cc (gfc_add_contiguous): Diagnose and reject duplicate CONTIGUOUS attribute. gcc/testsuite/ChangeLog: PR fortran/108025 * gfortran.dg/contiguous_12.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/symbol.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.cc b/gcc/fortran/symbol.cc
index 49fb378..e704e7a 100644
--- a/gcc/fortran/symbol.cc
+++ b/gcc/fortran/symbol.cc
@@ -1108,6 +1108,12 @@ gfc_add_contiguous (symbol_attribute *attr, const char *name, locus *where)
if (check_used (attr, name, where))
return false;
+ if (attr->contiguous)
+ {
+ duplicate_attr ("CONTIGUOUS", where);
+ return false;
+ }
+
attr->contiguous = 1;
return gfc_check_conflict (attr, name, where);
}