https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110725

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org,
                   |                            |jakub at gcc dot gnu.org

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is certainly accepts-invalid if it is accepted.
E.g. OpenMP 5.0 says on this in 2.20, 5.1 in
https://www.openmp.org/spec-html/5.1/openmpse30.html#x155-1880002.22
"If a teams construct is nested within a target construct, that target
construct must contain no statements, declarations or directives outside of the
teams construct."
Though, diagnosing this is hard, because e.g. parsing of teams construct's
clauses can result in some code in between the target and teams nested in it,
and that is valid.
I mean say
int foo (void) { return 42; }
#pragma omp declare target (foo)

int
main ()
{
#pragma omp target
#pragma omp teams num_teams (foo ())
;
}

Reply via email to