This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/57035] New: TS29113's C535b: Wrongly accept DIMENSION(..) to TRANSFER
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 22 Apr 2013 18:29:29 +0000
- Subject: [Bug fortran/57035] New: TS29113's C535b: Wrongly accept DIMENSION(..) to TRANSFER
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57035
Bug #: 57035
Summary: TS29113's C535b: Wrongly accept DIMENSION(..) to
TRANSFER
Classification: Unclassified
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: accepts-invalid, diagnostic
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: burnus@gcc.gnu.org
>From http://gcc.gnu.org/ml/fortran/2013-04/msg00203.html
The following code is wrongly accepted:
subroutine assumed_rank (a)
integer, intent(in) :: a(..)
integer :: c(1:4)
c = transfer(a,c,4)
end subroutine
>From TS29113:
"C535b An assumed-rank variable name shall not appear in a designator or
expression except as an actual argument corresponding to a dummy argument that
is assumed-rank, the argument of the C_LOC function in the ISO_C_BINDING
intrinsic module, or the first argument in a reference to an intrinsic inquiry
function."
There might be similar issues with TYPE(*) and !GCC$ attributes no_arg_check,
which are similar constraints.
Possibly the simplest would be to use intrinsic.c's do_check which could use
both
if (!specific->inquiry)
...
and
for (arg = arg->next; arg; arg = arg->next)
if (arg->expr ... )
...