Index: gcc/testsuite/gfortran.dg/empty_function_1.f90 =================================================================== --- gcc/testsuite/gfortran.dg/empty_function_1.f90 (révision 0) +++ gcc/testsuite/gfortran.dg/empty_function_1.f90 (révision 0) @@ -0,0 +1,10 @@ +! { dg-do compile } +! +! PR fortran/38252 +! FUNCTION rejected if both specification and execution part are empty +! +! Contributed by Daniel Kraft + +INTEGER FUNCTION test () +CONTAINS +END FUNCTION test Index: gcc/fortran/parse.c =================================================================== --- gcc/fortran/parse.c (révision 142256) +++ gcc/fortran/parse.c (copie de travail) @@ -2338,7 +2338,7 @@ loop: { bool verify_now = false; - if (st == ST_END_FUNCTION) + if (st == ST_END_FUNCTION || st == ST_CONTAINS) verify_now = true; else {