Issue 131356
Summary [flang] Spurious error with ASSOCIATE in a PURE procedure
Labels flang
Assignees
Reporter kcooley-cvd
    When given the following code:

```fortran
MODULE test_m
   REAL :: module_var
CONTAINS
   PURE SUBROUTINE test()
      ASSOCIATE(var => module_var)
      END ASSOCIATE
   END SUBROUTINE test
END MODULE test_m
```

Flang wrongly announces an error:

```
./test.f90:14:17: error: A pure subprogram may not have a variable with the SAVE attribute
 ASSOCIATE(var => module_var)
                  ^^^
```
But `test` is a valid `PURE` subroutine since `var` is not assigned to. Version information:
```
flang version 20.1.0 (https://github.com/llvm/llvm-project.git 24a30daaa559829ad079f2ff7f73eb4e18095f88)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to