<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Expected compile time error is not coming for Select type specification."
   href="https://bugs.llvm.org/show_bug.cgi?id=46789">46789</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Expected compile time error is not coming for Select type specification.
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>flang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Inderjeet_kalra@hcl.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>David.Truby@arm.com, jperier@nvidia.com, kirankumartp@gmail.com, llvm-bugs@lists.llvm.org, sscalpone@nvidia.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=23761" name="attach_23761" title="Test program.">attachment 23761</a> <a href="attachment.cgi?id=23761&action=edit" title="Test program.">[details]</a></span>
Test program.

Issue is related to Semantic specification checks for Select Type construct.
F18 compiler is not generating expected compilation error.

As per below Fortran 2018 specification, compile time error should be generated
if Selector is NOT unlimited Polymorphic and Intrinsic type specification is
specified in Type Guard statement.

C1162 (R1152) If selector is not unlimited polymorphic, each TYPE IS or CLASS
IS type-guard-stmt shall specify an extension of the declared type of selector.

Test program:  Error is expected at line #16.
============
[root@localhost Select_type_fix]# cat -n selecttype04.f90 
     1  type base
     2   integer :: ii
     3  end type
     4  type,extends(base) :: ext
     5   integer :: jj
     6  end type
     7  call CheckC1162()
     8  contains
     9    subroutine CheckC1162()
    10     class(base),allocatable :: aobj
    11     allocate(ext::aobj)
    12     select type(sel=>aobj)
    13      ! OK
    14      class is(base)
    15      !ERROR: Intrinsic Type specification must not be specified
    16      type is(integer)
    17      ! OK
    18      class default
    19     end select
    20    end
    21  end

-  Gfortran behavior is correct, expected compilation Error is coming.

[root@localhost Select_type_fix]# gfortran selecttype04.f90 
selecttype04.f90:16:12:

     type is(integer)
            1
Error: Unexpected intrinsic type â€˜INTEGER’ at (1)

[root@localhost Select_type_fix]# gfortran -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib
--enable-languages=c,c++,fortran
Thread model: posix
gcc version 7.3.0 (GCC) 
[root@localhost Select_type_fix]#</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>