[flang-commits] [flang] [flang][cuda] Check for use of host array in device context (PR #119756)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Dec 16 05:44:13 PST 2024


================
@@ -387,13 +387,11 @@ template <bool IsCUFKernelDo> class DeviceContextChecker {
               Check(x.value());
             },
             [&](const common::Indirection<parser::AssignmentStmt> &x) {
-              if (IsCUFKernelDo) {
-                const evaluate::Assignment *assign{
-                    semantics::GetAssignment(x.value())};
-                if (assign) {
-                  ErrorIfHostSymbol(assign->lhs, source);
-                  ErrorIfHostSymbol(assign->rhs, source);
-                }
+              const evaluate::Assignment *assign{
----------------
klausler wrote:

`assign` should be local to the predicate of the `if` if it is not used thereafter.

https://github.com/llvm/llvm-project/pull/119756


More information about the flang-commits mailing list