diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2006-01-18 18:55:01 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2006-01-18 18:55:01 +0000 |
commit | 1902704eb765abf8ec8acfbf8c2a459f1e7eb65b (patch) | |
tree | 604f003d8d69e4a1d7d99ba57be29731e7ace010 /gcc/fortran/symbol.c | |
parent | 94a89f3bbcd95924c498c309defd168666cc308e (diff) | |
download | gcc-1902704eb765abf8ec8acfbf8c2a459f1e7eb65b.zip gcc-1902704eb765abf8ec8acfbf8c2a459f1e7eb65b.tar.gz gcc-1902704eb765abf8ec8acfbf8c2a459f1e7eb65b.tar.bz2 |
re PR fortran/20869 (EXTERNAL and INTRINSIC cannot be used together)
2006-01-18 Paul Thomas <pault@gcc.gnu.org>
PR fortran/20869
PR fortran/20875
PR fortran/25024
* symbol.c (check_conflict): Add pointer valued elemental
functions and internal procedures with the external attribute
to the list of conflicts.
(gfc_add_attribute): New catch-all function to perform the
checking of symbol attributes for attribute declaration
statements.
* decl.c (attr_decl1): Call gfc_add_attribute for each of -
(gfc_match_external, gfc_match_intent, gfc_match_intrinsic,
gfc_match_pointer, gfc_match_dimension, gfc_match_target):
Remove spurious calls to checks in symbol.c. Set the
attribute directly and use the call to attr_decl() for
checking.
* gfortran.h: Add prototype for gfc_add_attribute.
PR fortran/25785
* resolve.c (resolve_function): Exclude PRESENT from assumed size
argument checking. Replace strcmp's with comparisons with generic
codes.
2006-01-18 Paul Thomas <pault@gcc.gnu.org>
Steven G. Kargl <kargls@comcast.net>
PR fortran/20869
* gfortran.dg/intrinsic_external_1.f90: New test.
PR fortran/20875.
* gfortran.dg/elemental_pointer_1.f90: New test.
PR fortran/25024
* gfortran.dg/external_procedures_1.f90: New test.
PR fortran/25785
gfortran.dg/assumed_present.f90: New test.
Co-Authored-By: Steven G. Kargl <kargls@comcast.net>
From-SVN: r109899
Diffstat (limited to 'gcc/fortran/symbol.c')
-rw-r--r-- | gcc/fortran/symbol.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 6eec853..c3e15f2 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) { |