[all-commits] [llvm/llvm-project] aad598: [flang] Portability warnings for an ambiguous ASSO...
Peter Klausler via All-commits
all-commits at lists.llvm.org
Fri Jan 27 16:51:21 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: aad5984b56280d7dc71a43c258c5ed349c9a239f
https://github.com/llvm/llvm-project/commit/aad5984b56280d7dc71a43c258c5ed349c9a239f
Author: Peter Klausler <pklausler at nvidia.com>
Date: 2023-01-27 (Fri, 27 Jan 2023)
Changed paths:
M flang/docs/Extensions.md
M flang/include/flang/Evaluate/tools.h
M flang/lib/Evaluate/intrinsics.cpp
M flang/lib/Evaluate/tools.cpp
M flang/lib/Semantics/check-call.cpp
M flang/lib/Semantics/check-call.h
M flang/lib/Semantics/definable.cpp
M flang/lib/Semantics/expression.cpp
M flang/test/Evaluate/folding06.f90
M flang/test/Semantics/associated.f90
Log Message:
-----------
[flang] Portability warnings for an ambiguous ASSOCIATED() case
The standard's specification for the ASSOCIATED() intrinsic function
describes its optional second argument (TARGET=) as being required
to be a valid target for a pointer assignment statement in which the
first argument (POINTER=) was the left-hand side. Some Fortran compilers
apparently interpret this text as a requirement that the POINTER= argument
actually be a valid left-hand side to a pointer assignment statement,
and emit an error if it is not so. This particularly affects the
use of an explicit NULL pointer as the first argument.
Such usage is well-defined, benign, useful, and supported by at least
two other compilers, so we should continue to accept it. This patch
adds a portability warning and some documentation.
In order to implement the portability warning in the best way, the
special checks on calls to the ASSOCIATED() intrinsic function have
been moved from intrinsic processing to Semantics/check-calls.cpp,
whence they have access to semantics' toolchest. Special checks for
other intrinsic functions might also migrate in the future in order
to keep them all in one place.
Differential Revision: https://reviews.llvm.org/D142768
More information about the All-commits
mailing list