================
@@ -2689,6 +2723,148 @@ StmtResult 
Parser::ParseOpenMPDeclarativeOrExecutableDirective(
     // A single match is returned for OpenMP 5.0
     int BestIdx = getBestVariantMatchForContext(VMIs, OMPCtx);
 
+    // Check if we have user conditions that are not simple IntegerLiterals.
+    // For simple IntegerLiterals (like condition(0) or condition(1)), we can
+    // evaluate them here. For anything else (variables, templates, complex
+    // expressions), we need to send to Sema for proper handling.
+    bool HasNonConstantUserCondition = false;
+    for (OMPTraitInfo *TI : TraitInfos) {
+      if (TI && TI->hasUserCondition()) {
+        // Check if all user conditions are simple IntegerLiterals.
+        TI->anyScoreOrCondition([&](Expr *&E, bool IsScore) {
+          if (!IsScore && E) {
+            // If it's not a simple IntegerLiteral, we need Sema
+            if (!isa<IntegerLiteral>(E->IgnoreParenImpCasts())) {
+              HasNonConstantUserCondition = true;
+              return true;
+            }
+          }
+          return false;
+        });
+        if (HasNonConstantUserCondition)
+          break;
+      }
+    }
----------------
zahiraam wrote:

Done.

https://github.com/llvm/llvm-project/pull/192455
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to