================
@@ -2516,6 +2549,24 @@ StmtResult 
Parser::ParseOpenMPDeclarativeOrExecutableDirective(
   StmtResult Directive = StmtError();
   bool HasAssociatedStatement = true;
 
+  // Check if it is extension directive.
+  // Extension directives must have extension directives
+  // enabled and must use the ompx sentinel
+  if (isExtensionDirective(DKind)) {
+    if (!isOmpx) {
+      Diag(Loc, diag::err_omp_extension_without_ompx)
+          << getOpenMPDirectiveName(DKind);
+    } else if (!getLangOpts().OpenMPExtensions) {
+      Diag(Loc, diag::warn_omp_extension_directive_not_enabled)
+          << getOpenMPDirectiveName(DKind);
----------------
alexey-bataev wrote:

I rather doubt there should be this check, better to enable ompx pragma handler 
only if getLangOpts().OpenMPExtensions is true.

https://github.com/llvm/llvm-project/pull/66919
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to