diff options
| author | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-23 20:56:58 +0000 |
|---|---|---|
| committer | tobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-02-23 20:56:58 +0000 |
| commit | 2be7c5d9c9efdeda3f49999d50342f625edf9d53 (patch) | |
| tree | 1d2841bcbe6e62af3ddb540efc81f110a19226d5 /gcc | |
| parent | a05623171bccd9cc2510eb9f4b906ba86d1f5f46 (diff) | |
| download | ppe42-gcc-2be7c5d9c9efdeda3f49999d50342f625edf9d53.tar.gz ppe42-gcc-2be7c5d9c9efdeda3f49999d50342f625edf9d53.zip | |
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')
| -rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/fortran/gfortran.h | 3 | ||||
| -rw-r--r-- | gcc/fortran/symbol.c | 9 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 2 | ||||
| -rw-r--r-- | gcc/testsuite/gfortran.dg/deftype_1.f90 | 6 |
5 files changed, 21 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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e06a9790093..199acc114b7 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -2,6 +2,8 @@ * gfortran.dg/implicit_3.f90: New test. + * gfortran.dg/deftype_1.f90: New test. + 2005-02-23 Alexandre Oliva <aoliva@redhat.com> * g++.dg/lookup/anon2.C: Don't let access checks make it look like diff --git a/gcc/testsuite/gfortran.dg/deftype_1.f90 b/gcc/testsuite/gfortran.dg/deftype_1.f90 new file mode 100644 index 00000000000..e0476d02e58 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/deftype_1.f90 @@ -0,0 +1,6 @@ +! { dg-do compile } +! Checks for excess errors. +implicit none +dimension i(10) ! { dg-error "has no IMPLICIT type" } +i = 2 +end |

