[flang-commits] [flang] [Flang][OpenMP] Only allow implicit mappers for Allocatables. (PR #170701)

Akash Banerjee via flang-commits flang-commits at lists.llvm.org
Thu Dec 4 08:51:43 PST 2025


https://github.com/TIFitis created https://github.com/llvm/llvm-project/pull/170701

Generate implicit declare mappers only for Allocatables.

Fixes #169382 introduced by #140562.

>From 8472f68e468231c032903b96a27bf74616c88072 Mon Sep 17 00:00:00 2001
From: Akash Banerjee <Akash.Banerjee at amd.com>
Date: Thu, 4 Dec 2025 16:46:17 +0000
Subject: [PATCH] [Flang][OpenMP] Only allow implicit mappers for Allocatables.

Generate implicit declare mappers only for Allocatables.
Fixes #169382 introduced by #140562.
---
 flang/lib/Lower/OpenMP/Utils.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flang/lib/Lower/OpenMP/Utils.cpp b/flang/lib/Lower/OpenMP/Utils.cpp
index ccac64335c29a..a818d635668de 100644
--- a/flang/lib/Lower/OpenMP/Utils.cpp
+++ b/flang/lib/Lower/OpenMP/Utils.cpp
@@ -189,7 +189,7 @@ bool requiresImplicitDefaultDeclareMapper(
 
     semantics::DirectComponentIterator directComponents{spec};
     for (const semantics::Symbol &component : directComponents) {
-      if (semantics::IsAllocatableOrPointer(component))
+      if (component.attrs().test(semantics::Attr::ALLOCATABLE))
         return true;
 
       if (const semantics::DeclTypeSpec *declType = component.GetType())



More information about the flang-commits mailing list