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/decl.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/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 1d20a0d..91e5820 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -3154,6 +3154,12 @@ attr_decl1 (void) goto cleanup; } + if (gfc_add_attribute (&sym->attr, &var_locus) == FAILURE) + { + m = MATCH_ERROR; + goto cleanup; + } + if ((current_attr.external || current_attr.intrinsic) && sym->attr.flavor != FL_PROCEDURE && gfc_add_flavor (&sym->attr, FL_PROCEDURE, sym->name, NULL) == FAILURE) @@ -3361,7 +3367,7 @@ gfc_match_external (void) { gfc_clear_attr (¤t_attr); - gfc_add_external (¤t_attr, NULL); + current_attr.external = 1; return attr_decl (); } @@ -3378,7 +3384,7 @@ gfc_match_intent (void) return MATCH_ERROR; gfc_clear_attr (¤t_attr); - gfc_add_intent (¤t_attr, intent, NULL); /* Can't fail */ + current_attr.intent = intent; return attr_decl (); } @@ -3389,7 +3395,7 @@ gfc_match_intrinsic (void) { gfc_clear_attr (¤t_attr); - gfc_add_intrinsic (¤t_attr, NULL); + current_attr.intrinsic = 1; return attr_decl (); } @@ -3400,7 +3406,7 @@ gfc_match_optional (void) { gfc_clear_attr (¤t_attr); - gfc_add_optional (¤t_attr, NULL); + current_attr.optional = 1; return attr_decl (); } @@ -3423,7 +3429,7 @@ gfc_match_pointer (void) else { gfc_clear_attr (¤t_attr); - gfc_add_pointer (¤t_attr, NULL); + current_attr.pointer = 1; return attr_decl (); } @@ -3435,7 +3441,7 @@ gfc_match_allocatable (void) { gfc_clear_attr (¤t_attr); - gfc_add_allocatable (¤t_attr, NULL); + current_attr.allocatable = 1; return attr_decl (); } @@ -3446,7 +3452,7 @@ gfc_match_dimension (void) { gfc_clear_attr (¤t_attr); - gfc_add_dimension (¤t_attr, NULL, NULL); + current_attr.dimension = 1; return attr_decl (); } @@ -3457,7 +3463,7 @@ gfc_match_target (void) { gfc_clear_attr (¤t_attr); - gfc_add_target (¤t_attr, NULL); + current_attr.target = 1; return attr_decl (); } |