llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

Expected compile time error is not coming for Select type and Associate Construct

Open llvmbot opened this issue 6 years ago • 1 comments

Bugzilla Link 47339
Version trunk
OS Linux
Reporter LLVM Bugzilla Contributor
CC @Sameeranjoshi,@jeanPerier,@kiranktp,@psteinfeld,@sscalpone

Extended Description

Following test case should generate compile time error for invalid selector at line #​4 and #​9 :

R1105 selector is expr or variable C1103 (R1105) variable shall not be a coindexed object.

[root@localhost flang]# cat -n /root/LLVM/selecttype_coarray.f90 1 class(),allocatable :: calc[:] 2 integer :: icoa[] 3 4 associate(sel=>icoa[2]) 5 end associate 6 7 icoa = 2 8 allocate(integer::calc[*]) 9 select type(sel=>calc[2]) 10 type is(integer) 11 sel = 2 12 end select 13 end

Solution: I have modified resolve-names.cpp to add required checks. I will upload modified file/test case for review in differential once the bug is accepted.

llvmbot avatar Aug 28 '20 02:08 llvmbot

This one appears to have been fixed by its reporter, Inderjeet Kalra, (thanks!) in https://reviews.llvm.org/D87073 .

ekieri avatar Apr 13 '22 20:04 ekieri