The following is non-standard and the compiler should probably generate a warning/error with '-pedantic -std=f95' doi: DO 111 i=1,3 111 continue ! requires END DO doi END
Confirmed and marked as minor.
*** Bug 24806 has been marked as a duplicate of this bug. ***
Created attachment 10230 [details] patch I can't think of better wording for the diagnostic. Some help there would be appreciated.
I did build and completed the regression test. The patch in comment #3 fixes this problem (when compiled with -pedantic option) but gfortran still fails to report this as an error with -std=f95 without -pedantic. I've created a new patch where I took the Steven's patch and added GFC_STD_F95 along with pedantic check. About the error message, how about, "Construct name on END DO at %L does not match the Named DO construct", sounds? Below, I'm listing the patch for completeness. Can somebody look at it pease? Thansks, Uttam --- gcc_org/gcc/gcc/fortran/parse.c 2005-11-30 09:56:16.000000000 -0800 +++ gcc/gcc/fortran/parse.c 2005-12-09 13:33:32.000000000 -0800 @@ -23,6 +23,7 @@ Software Foundation, 51 Franklin Street, #include "config.h" #include "system.h" +#include "flags.h" #include <setjmp.h> #include "gfortran.h" #include "match.h" @@ -2057,6 +2058,10 @@ loop: break; case ST_IMPLIED_ENDDO: + if ((pedantic || GFC_STD_F95) && gfc_current_block () != NULL) + gfc_error_now + ("Construct name on END DO at %L does not match the Named DO construct", + &gfc_current_block()->declared_at); break; default:
Fixed on trunk and 4.1 Paul