https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104621
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> --- This got fixed for OpenMP 6 via OpenMP spec pull request #3383, adding: * A declarative directive must be specified in the specification part after all 'USE', 'IMPORT' and 'IMPLICIT' statements. * If a declarative directive applies to a function declaration or definition and it is specified with one or more C++ attribute specifiers, the specified attributes must be applied to the function as permitted by the base language. Plus revising the wording for 'declare variant' for Fortran (semantic + restrictions). See TR12/OpenMP 6.