https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110725
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Tobias Burnus <bur...@gcc.gnu.org>: https://gcc.gnu.org/g:081e25d3cfd86c4094999ded0bbe99b91762013c commit r14-2826-g081e25d3cfd86c4094999ded0bbe99b91762013c Author: Tobias Burnus <tob...@codesourcery.com> Date: Thu Jul 27 18:14:11 2023 +0200 OpenMP/Fortran: Extend reject code between target + teams [PR71065, PR110725] The previous version failed to diagnose when the 'teams' was nested more deeply inside the target region, e.g. inside a DO or some block or structured block. PR fortran/110725 PR middle-end/71065 gcc/fortran/ChangeLog: * openmp.cc (resolve_omp_target): Minor cleanup. * parse.cc (decode_omp_directive): Find TARGET statement also higher in the stack. gcc/testsuite/ChangeLog: * gfortran.dg/gomp/teams-6.f90: Extend.