summaryrefslogtreecommitdiff
path: root/gcc/fortran/symbol.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r--gcc/fortran/symbol.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 6eec85308ec..c3e15f2d1dd 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -311,11 +311,20 @@ check_conflict (symbol_attribute * attr, const char * name, locus * where)
conf (pointer, target);
conf (pointer, external);
conf (pointer, intrinsic);
+ conf (pointer, elemental);
+
conf (target, external);
conf (target, intrinsic);
conf (external, dimension); /* See Fortran 95's R504. */
conf (external, intrinsic);
+
+ if (attr->if_source || attr->contained)
+ {
+ conf (external, subroutine);
+ conf (external, function);
+ }
+
conf (allocatable, pointer);
conf (allocatable, dummy); /* TODO: Allowed in Fortran 200x. */
conf (allocatable, function); /* TODO: Allowed in Fortran 200x. */
@@ -585,6 +594,16 @@ duplicate_attr (const char *attr, locus * where)
try
+gfc_add_attribute (symbol_attribute * attr, locus * where)
+{
+
+ if (check_used (attr, NULL, where) || check_done (attr, where))
+ return FAILURE;
+
+ return check_conflict (attr, NULL, where);
+}
+
+try
gfc_add_allocatable (symbol_attribute * attr, locus * where)
{