[PATCH] D78160: [flang] Checks for constraints C741 through C750

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 09:38:55 PDT 2020


PeteSteinfeld marked an inline comment as done.
PeteSteinfeld added inline comments.


================
Comment at: flang/test/Semantics/assign04.f90:9
   type(t(1, 2)) :: x
-  !ERROR: Assignment to constant 'x%k' is not allowed
+  !ERROR: Left-hand side of assignment is not modifiable
   x%k = 4
----------------
tskeith wrote:
> Are the changes to this file intentional? They don't seem related to your changes.
I changed the implementation of "IsConstantExpr" in lib/Evaluate/check-expression.cpp to say that symbols that are components are constants.  That change caused this test to emit different error messages for these two cases.

Previously, a symbol was only declared as a constant if it had the PARAMETER attribute or was an implied DO index.  My reasoning is that the derived type object establishes whether the expression is constant.  The problem I was trying to solve is that we were always treating expressions like "a%b" as non-constant even if "a" was a constant.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78160/new/

https://reviews.llvm.org/D78160





More information about the llvm-commits mailing list