================
@@ -2759,6 +2759,18 @@ StmtResult
Parser::ParseOpenMPDeclarativeOrExecutableDirective(
OpenMPClauseKind CKind = Tok.isAnnotation()
? OMPC_unknown
: getOpenMPClauseKind(PP.getSpelling(Tok));
+ // Check if the clause is unrecognized.
+ if (CKind == OMPC_unknown) {
+ Diag(Tok, diag::err_omp_unknown_clause)
+ << PP.getSpelling(Tok) << "metadirective";
+ }
+ if (getLangOpts().OpenMP < 52 && CKind == OMPC_otherwise) {
+ Diag(Tok, diag::err_omp_unexpected_clause)
+ << PP.getSpelling(Tok) << "metadirective";
+ }
+ if (CKind == OMPC_default && getLangOpts().OpenMP >= 52) {
+ Diag(Tok, diag::warn_omp_default_deprecated);
+ }
----------------
alexey-bataev wrote:
Drop braces
https://github.com/llvm/llvm-project/pull/128640
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits