[all-commits] [llvm/llvm-project] a7802a: [flang] Do not return true for pointer sub-object ...
jeanPerier via All-commits
all-commits at lists.llvm.org
Fri Mar 11 00:26:59 PST 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a7802a806d5f8dea2038507f4746b661d4e9bf97
https://github.com/llvm/llvm-project/commit/a7802a806d5f8dea2038507f4746b661d4e9bf97
Author: Jean Perier <jperier at nvidia.com>
Date: 2022-03-11 (Fri, 11 Mar 2022)
Changed paths:
M flang/lib/Evaluate/tools.cpp
M flang/lib/Semantics/check-call.cpp
M flang/test/Semantics/call03.f90
M flang/test/Semantics/call07.f90
Log Message:
-----------
[flang] Do not return true for pointer sub-object in IsPointerObject
evaluate::IsPointerObject used to return true for pointer suboject like
`pointer(10)` while these object are not pointers. This prevented some
checks like 15.5.2.7 to be correctly enforced (e.g., it was possible to
pass `pointer(10)` to a non intent(in) dummy pointer).
After updating IsPointerObject behavior and adding a test for 15.5.2.7 in
call07.f90, a test in call03.f90 for 15.5.2.4(14) was failing.
It appeared the related semantics check was relying on IsPointerObject
to return true for `pointer(10)`. Adapt the code to detect pointer element
in another way.
While looking at the code, I also noticed that semantics was
rejecting `character(1)` pointer/assumed shape suboject when these are
allowed (the standard has a special case for character(1) in
15.5.2.4(14), and I verified that other compilers that enforce 15.5.2.4(14)
do accept this).
Differential Revision: https://reviews.llvm.org/D121377
More information about the All-commits
mailing list