diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-11-02 01:04:28 +0100 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-11-02 01:04:28 +0100 |
commit | c96cfa49c2b20f0b1d23b32473c33934af97a5d0 (patch) | |
tree | 478e60f8925a2e0f9094a145cfafe1b4f60f8bf4 /gcc | |
parent | 0be8cb80ee8062154c853a2ea87fe01c287f91f6 (diff) | |
download | gcc-c96cfa49c2b20f0b1d23b32473c33934af97a5d0.zip gcc-c96cfa49c2b20f0b1d23b32473c33934af97a5d0.tar.gz gcc-c96cfa49c2b20f0b1d23b32473c33934af97a5d0.tar.bz2 |
decl.c (gfc_match_entry): Function entries don't need an argument list if there's no RESULT clause.
fortran/
* decl.c (gfc_match_entry): Function entries don't need an argument
list if there's no RESULT clause.
testsuite/
* gfortran.fortran-torture/execute/entry_9.f90: Revert previous
change (r106358).
From-SVN: r106361
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/decl.c | 23 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 | 4 |
4 files changed, 33 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 4309d21..de6fed3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2005-11-02 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> + + * decl.c (gfc_match_entry): Function entries don't need an argument + list if there's no RESULT clause. + 2005-11-01 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/24008 diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 74aa684..f7734e1 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -2603,6 +2603,7 @@ gfc_match_entry (void) gfc_compile_state state; match m; gfc_entry_list *el; + locus old_loc; m = gfc_match_name (name); if (m != MATCH_YES) @@ -2690,8 +2691,26 @@ gfc_match_entry (void) } else { - /* An entry in a function. */ - m = gfc_match_formal_arglist (entry, 0, 0); + /* An entry in a function. + We need to take special care because writing + ENTRY f() + as + ENTRY f + is allowed, whereas + ENTRY f() RESULT (r) + can't be written as + ENTRY f RESULT (r). */ + old_loc = gfc_current_locus; + if (gfc_match_eos () == MATCH_YES) + { + gfc_current_locus = old_loc; + /* Match the empty argument list, and add the interface to + the symbol. */ + m = gfc_match_formal_arglist (entry, 0, 1); + } + else + m = gfc_match_formal_arglist (entry, 0, 0); + if (m != MATCH_YES) return MATCH_ERROR; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 370954d..faa7ff5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-11-02 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> + + * gfortran.fortran-torture/execute/entry_9.f90: Revert previous + change (r106358). + 2005-11-01 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/24008 diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 index a269fdf..d29f4b8 100644 --- a/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 +++ b/gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90 @@ -5,12 +5,12 @@ integer a, f1, e1 f1 = 15 + a return - entry e1() + entry e1 e1 = 42 end function function f2 () real f2, e2 - entry e2() + entry e2 e2 = 45 end function |