================
@@ -2712,6 +2714,153 @@ StmtResult
Parser::ParseOpenMPDeclarativeOrExecutableDirective(
// A single match is returned for OpenMP 5.0
int BestIdx = getBestVariantMatchForContext(VMIs, OMPCtx);
+ // Check if we have user conditions with non-constant expressions that
+ // require runtime selection.
+ bool HasUserCondition = llvm::any_of(VMIs, [](const VariantMatchInfo &VMI)
{
+ return VMI.HasNonConstantUserCondition;
+ });
+
+ // Different directives have different data-sharing attributes, so each
+ // variant needs its own CapturedStmt with proper DSA context.
+ // We manually cache body tokens and inject them for each variant parse.
+ if (HasUserCondition) {
----------------
alexey-bataev wrote:
```suggestion
if (HasUserCondition &&
getLangOpts().OpenMPMetadirectiveRuntimeSelection) {
```
https://github.com/llvm/llvm-project/pull/192455
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits