re PR fortran/24008 (gfortran too permissive about ENTRY syntax)
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>
Tue, 1 Nov 2005 21:55:02 +0000 (22:55 +0100)
committerTobias Schlüter <tobi@gcc.gnu.org>
Tue, 1 Nov 2005 21:55:02 +0000 (22:55 +0100)
fortran/
PR fortran/24008
* decl.c (gfc_match_entry): Function entries need an argument list.
testsuite/
PR fortran/24008
* gfortran.dg/entry_5.f90: New.
* gfortran.fortran-torture/execute/entry_9.f90: Fix syntax error.

From-SVN: r106358

gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/entry_5.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.fortran-torture/execute/entry_9.f90

index 7fad64cddf79a791e960d823230069ab290e2937..4309d215574b9ff8b68b60f0c5fc9e9ea1707e1e 100644 (file)
@@ -1,3 +1,8 @@
+2005-11-01  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/24008
+       * decl.c (gfc_match_entry): Function entries need an argument list.
+
 2005-11-01  Erik Edelmann  <eedelman@gcc.gnu.org>
 
        PR 24245
index 7516057bfeecef96b99e3b6425557e2703c6cb70..74aa6841d7a3f159a2472111e1c572569fbb478b 100644 (file)
@@ -2691,7 +2691,7 @@ gfc_match_entry (void)
   else
     {
       /* An entry in a function.  */
-      m = gfc_match_formal_arglist (entry, 0, 1);
+      m = gfc_match_formal_arglist (entry, 0, 0);
       if (m != MATCH_YES)
        return MATCH_ERROR;
 
index 09504fca73b897b277bd1ea7a62a3c57af4da5bb..370954da240949241f5a0cc7a7d6f301d07e219d 100644 (file)
@@ -1,3 +1,9 @@
+2005-11-01  Tobias Schl"uter  <tobias.schlueter@physik.uni-muenchen.de>
+
+       PR fortran/24008
+       * gfortran.dg/entry_5.f90: New.
+       * gfortran.fortran-torture/execute/entry_9.f90: Fix syntax error.
+
 2005-11-01  Bob Wilson  <bob.wilson@acm.org>
 
        * gcc.dg/intmax_t-1.c: Disable for xtensa-*-elf*.
diff --git a/gcc/testsuite/gfortran.dg/entry_5.f90 b/gcc/testsuite/gfortran.dg/entry_5.f90
new file mode 100644 (file)
index 0000000..ad0554c
--- /dev/null
@@ -0,0 +1,11 @@
+! { dg-do compile }
+! PR 24008
+! an argument list to the entry is required
+REAL FUNCTION funct()
+  funct = 0.0
+  RETURN
+!
+  ENTRY enter RESULT (answer)  ! { dg-error "Unclassifiable statement" }
+  answer = 1.0
+  RETURN
+END FUNCTION funct
index d29f4b8344c041ffd82bf44b35252d1b59df7b0b..a269fdf60ab888344a773d05cf3bfecf019d147f 100644 (file)
@@ -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