aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorTobias Schlüter <tobias.schlueter@physik.uni-muenchen.de>2006-01-07 17:30:53 +0100
committerTobias Schlüter <tobi@gcc.gnu.org>2006-01-07 17:30:53 +0100
commit2b9a33aeea3d49f4e7038ecdc9d96b6220593d15 (patch)
tree0bfc332161d9cd9f0ae0b9ff15ede507bbf790d7 /gcc/fortran/decl.c
parent5487b6e59724be488a6ec2bc510f43f88602dc7e (diff)
downloadgcc-2b9a33aeea3d49f4e7038ecdc9d96b6220593d15.zip
gcc-2b9a33aeea3d49f4e7038ecdc9d96b6220593d15.tar.gz
gcc-2b9a33aeea3d49f4e7038ecdc9d96b6220593d15.tar.bz2
decl.c (gfc_match_function_decl): Correctly error out in case of omitted function argument list.
fortran/ * decl.c (gfc_match_function_decl): Correctly error out in case of omitted function argument list. testsuite/ * gfortran.dg/func_decl_1.f90: New. * gfortran.dg/array_alloc_1.f90: Fix wrong function declaration. * gfortran.dg/array_alloc_2.f90: Likewise. * gfortran.dg/char_result_8.f90: Likewise. * gfortran.dg/dup_save_1.f90: Likewise. * gfortran.dg/dup_save_2.f90: Likewise. * gfortran.dg/f2c_6.f90: Likewise. * gfortran.dg/f2c_7.f90: Likewise. * gfortran.dg/func_result_2.f90: Likewise. * gfortran.fortran-torture/execute/pr23373-2.f90: Likewise. From-SVN: r109451
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index 1358cdcf..1d20a0d 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -2548,7 +2548,12 @@ gfc_match_function_decl (void)
m = gfc_match_formal_arglist (sym, 0, 0);
if (m == MATCH_NO)
- gfc_error ("Expected formal argument list in function definition at %C");
+ {
+ gfc_error ("Expected formal argument list in function "
+ "definition at %C");
+ m = MATCH_ERROR;
+ goto cleanup;
+ }
else if (m == MATCH_ERROR)
goto cleanup;