summaryrefslogtreecommitdiffstats
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authortobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-02 00:04:28 +0000
committertobi <tobi@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-02 00:04:28 +0000
commit7b5e1accbba42f38680a9c4ac572addb35ebd95f (patch)
tree478e60f8925a2e0f9094a145cfafe1b4f60f8bf4 /gcc/fortran/decl.c
parent2695eb29f11383a09bc502425212f77c32006958 (diff)
downloadppe42-gcc-7b5e1accbba42f38680a9c4ac572addb35ebd95f.tar.gz
ppe42-gcc-7b5e1accbba42f38680a9c4ac572addb35ebd95f.zip
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). git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106361 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 74aa6841d7a..f7734e1b6c7 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;
OpenPOWER on IntegriCloud