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.
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);
}
--- /dev/null
+! { dg-do compile }
+! PR fortran/108025
+
+subroutine foo (x)
+ real, contiguous :: x(:)
+ contiguous :: x ! { dg-error "Duplicate CONTIGUOUS attribute" }
+end