[llvm-bugs] [Bug 47339] New: Expected compile time error is not coming for Select type and Associate Construct

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Aug 27 19:06:38 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47339

            Bug ID: 47339
           Summary: Expected compile time error is not coming for Select
                    type and Associate Construct
           Product: flang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedbugs at nondot.org
          Reporter: Inderjeet_kalra at hcl.com
                CC: David.Truby at arm.com, jperier at nvidia.com,
                    kirankumartp at gmail.com, llvm-bugs at lists.llvm.org,
                    sscalpone at nvidia.com

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 at 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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200828/99c23bec/attachment.html>


More information about the llvm-bugs mailing list