summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-23 20:56:58 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-02-23 20:56:58 +0000
commit2be7c5d9c9efdeda3f49999d50342f625edf9d53 (patch)
tree1d2841bcbe6e62af3ddb540efc81f110a19226d5 /gcc/fortran
parenta05623171bccd9cc2510eb9f4b906ba86d1f5f46 (diff)
downloadgcc-2be7c5d9c9efdeda3f49999d50342f625edf9d53.tar.gz
fortran/
* gfortran.h (symbol_attribute): New 'untyped' field, fix comment formatting. * symbol.c (gfc_set_default_type): Issue error only once, by setting and checking 'untyped' attribute. testsuite/ * gfortran.dg/deftype_1.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95469 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/gfortran.h3
-rw-r--r--gcc/fortran/symbol.c9
3 files changed, 13 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index d099843cd12..b28e7070f63 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -11,6 +11,11 @@
(gfc_symbol_init_2): Pass second argument to gfc_get_namespace.
* trans-common.c (build_common_decl): Likewise.
+ * gfortran.h (symbol_attribute): New 'untyped' field, fix comment
+ formatting.
+ * symbol.c (gfc_set_default_type): Issue error only once, by setting
+ and checking 'untyped' attribute.
+
2005-02-23 Kazu Hirata <kazu@cs.umass.edu>
* intrinsic.h, st.c: Update copyright.
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 0778d65c705..f96cff10dde 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -408,7 +408,8 @@ typedef struct
unsigned in_namelist:1, in_common:1;
unsigned function:1, subroutine:1, generic:1;
- unsigned implicit_type:1; /* Type defined via implicit rules */
+ unsigned implicit_type:1; /* Type defined via implicit rules. */
+ unsigned untyped:1; /* No implicit type could be found. */
/* Function/subroutine attributes */
unsigned sequence:1, elemental:1, pure:1, recursive:1;
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index efe121111e0..77d3f1a3a2d 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -213,9 +213,12 @@ gfc_set_default_type (gfc_symbol * sym, int error_flag, gfc_namespace * ns)
if (ts->type == BT_UNKNOWN)
{
- if (error_flag)
- gfc_error ("Symbol '%s' at %L has no IMPLICIT type", sym->name,
- &sym->declared_at);
+ if (error_flag && !sym->attr.untyped)
+ {
+ gfc_error ("Symbol '%s' at %L has no IMPLICIT type",
+ sym->name, &sym->declared_at);
+ sym->attr.untyped = 1; /* Ensure we only give an error once. */
+ }
return FAILURE;
}