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 26
26
#include " clang/Sema/SemaOpenMP.h"
27
27
#include " llvm/ADT/SmallBitVector.h"
28
28
#include " llvm/ADT/StringSwitch.h"
29
+ #include " llvm/Frontend/OpenMP/OMP.h.inc"
29
30
#include " llvm/Frontend/OpenMP/OMPAssume.h"
30
31
#include " llvm/Frontend/OpenMP/OMPContext.h"
31
32
#include < optional>
@@ -3474,6 +3475,16 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
3474
3475
Clause = ParseOpenMPOMPXAttributesClause (WrongDirective);
3475
3476
break ;
3476
3477
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
+ }
3477
3488
if (WrongDirective)
3478
3489
Diag (Tok, diag::note_ompx_bare_clause)
3479
3490
<< getOpenMPClauseName (CKind) << " target teams" ;
You can’t perform that action at this time.
0 commit comments