File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2626#include " clang/Sema/SemaOpenMP.h"
2727#include " llvm/ADT/SmallBitVector.h"
2828#include " llvm/ADT/StringSwitch.h"
29+ #include " llvm/Frontend/OpenMP/OMP.h.inc"
2930#include " llvm/Frontend/OpenMP/OMPAssume.h"
3031#include " llvm/Frontend/OpenMP/OMPContext.h"
3132#include < optional>
@@ -3474,6 +3475,16 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
34743475 Clause = ParseOpenMPOMPXAttributesClause (WrongDirective);
34753476 break ;
34763477 case OMPC_ompx_bare:
3478+ if (DKind == llvm::omp::Directive::OMPD_target) {
3479+ // Flang splits the combined directives which requires OMPD_target to be
3480+ // marked as accepting the `ompx_bare` clause in `OMP.td`. Thus, we need
3481+ // to explicitly check whether this clause is applied to an `omp target`
3482+ // without `teams` and emit an error.
3483+ Diag (Tok, diag::err_omp_unexpected_clause)
3484+ << getOpenMPClauseName (CKind) << getOpenMPDirectiveName (DKind);
3485+ ErrorFound = true ;
3486+ WrongDirective = true ;
3487+ }
34773488 if (WrongDirective)
34783489 Diag (Tok, diag::note_ompx_bare_clause)
34793490 << getOpenMPClauseName (CKind) << " target teams" ;
You can’t perform that action at this time.
0 commit comments