https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78026
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Thu Oct 27 19:55:12 2016 New Revision: 241630 URL: https://gcc.gnu.org/viewcvs?rev=241630&root=gcc&view=rev Log: PR fortran/78026 * parse.c (decode_statement): Don't create namespace for possible select type here and destroy it afterwards. (parse_select_type_block): Set gfc_current_ns to new_st.ext.block.ns. (parse_executable, gfc_parse_file): Formatting fixes. * match.c (gfc_match_select_type): Create namespace for select type here, only after matching select type. Formatting fixes. Free that namespace if not returning MATCH_YES, after gfc_undo_symbols, otherwise remember it in new_st.ext.block.ns and switch to parent namespace anyway. * gfortran.dg/gomp/pr78026.f03: New test. * gfortran.dg/select_type_38.f03: New test. Added: trunk/gcc/testsuite/gfortran.dg/gomp/pr78026.f03 trunk/gcc/testsuite/gfortran.dg/select_type_38.f03 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/match.c trunk/gcc/fortran/parse.c trunk/gcc/testsuite/ChangeLog