diff options
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r-- | clang/lib/Parse/ParseOpenMP.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp index 42e6aac..3b86847 100644 --- a/clang/lib/Parse/ParseOpenMP.cpp +++ b/clang/lib/Parse/ParseOpenMP.cpp @@ -2759,6 +2759,19 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( OpenMPClauseKind CKind = Tok.isAnnotation() ? OMPC_unknown : getOpenMPClauseKind(PP.getSpelling(Tok)); + // Check if the clause is unrecognized. + if (getLangOpts().OpenMP < 52 && + (CKind == OMPC_unknown || CKind == OMPC_otherwise)) { + Diag(Tok, diag::err_omp_unknown_clause) + << PP.getSpelling(Tok) << "metadirective"; + } + if (getLangOpts().OpenMP >= 52 && CKind == OMPC_unknown) { + Diag(Tok, diag::err_omp_unknown_clause) + << PP.getSpelling(Tok) << "metadirective"; + } + if (CKind == OMPC_default && getLangOpts().OpenMP >= 52) { + Diag(Tok, diag::warn_omp_default_deprecated); + } SourceLocation Loc = ConsumeToken(); // Parse '('. @@ -2785,6 +2798,13 @@ StmtResult Parser::ParseOpenMPDeclarativeOrExecutableDirective( return Directive; } } + if (CKind == OMPC_otherwise) { + // Check for 'otherwise' keyword. + if (Tok.is(tok::identifier) && + Tok.getIdentifierInfo()->getName() == "otherwise") { + ConsumeToken(); // Consume 'otherwise' + } + } // Skip Directive for now. We will parse directive in the second iteration int paren = 0; while (Tok.isNot(tok::r_paren) || paren != 0) { |