<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60551>60551</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [flang] Compilation error of "local-name" and "user-name" of the same name as specified in the USE statement
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          ohno-fj
      </td>
    </tr>
</table>

<pre>
    ```
Version of flang-new : 17.0.0(dd3f7b02255a52b709797cdc6d121b113df9b4ab)
```

"local-name" and "user-name" with the same name specified in `USE` statement result in a compilation-time error.

The following are the test program, flang-new, gfortran and ifort compilation result.

snggn512_3.f90:
```fortran
module m1
  type x
 integer ::x1=2
  end type x
end module m1

program main
  use m1,x=>x
  type(x)::v06
  write(6,*) "v06%x1 = ", v06%x1
end program main
```

```
$ flang-new -flang-experimental-exec snggn512_3.f90
error: Semantic errors in snggn512_3.f90
./snggn512_3.f90:9:8: error: Derived type 'x' not found
 type(x)::v06
         ^
./snggn512_3.f90:10:27: error: 'v06' is not an object of derived type; it is implicitly typed
    write(6,*) "v06%x1 = ", v06%x1
                            ^^^
$
```

```
$ gfortran snggn512_3.f90
$ ./a.out
 v06%x1 = 2
$
```

```
$ ifort snggn512_3.f90
$ ./a.out
 v06%x1 = 2
$
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0Vd1uqzgQfhpzYwWZIeBwwUVO07xA9-ztyuCB-MjYkW1a-vYrA2l-TlXtVjoIkYxnmG_8fTNGeK96g1iT4gcpDokYw8m62p6M3XS_ksbK95qUbL3ZgbD93-i8sobajnZamH5j8I2SfE8znrKUEdhJmXe8YQBFIQpoOKt4xVvZljKDrMmyXHZVsxUNgWpJ-YCwPgG0bYXeGDEgAaDCSEoARo_uY-1NhRMNJ6ReDEjjKvVnbFWnUFJlKCnZz5dnUjLqgwg4oAnUoR91iF5BWzuclRZBWbMJakCKzlmX3tbx1wlpZ7W2b8r0VDic8QL6QM_O9k4MBJ6uVESj76wLTpi5ZBWNW6C1gDsQb_reFBn8k6ddxUi-fyBmTbisDlaOGumQLSal4f2MdFotZQL26KIkJN9PGckPcAlEI--Co_2QbXmuO6ODUOby8ujnKHiaSH4g-fN0C09gN0U9Z9BXVl58b06F6CwJPBHYE6iihjEAiimjJD9EO5J2WbtW9nsRnzfKwyJsbxpzs_zF6YxORfmF3uCELX1gfAGN4sdWfsFBmKDapR187JXP4lMCx9-UixzsYpKPbAd06hVX5gnwiQCnxgba2dHIlamvSFwvUjx_gZvFB_A7ZAJ8ppVT5WdEYahtfmEb4vjKm7pI_oOqEMPUcNaqVUG_zw55LeK7WtIvrrin5b6I9_-U_hi1z_SJAZErkdoxrLXclQvfRF1m-k9AJrLOZZVXIsE6K3lRclZss-RUQ1kKIXmVcQ5ZtW13TVm1QvIOId_mvEhUDQxyBqxkOwaQpfkOmSyAw050ogBBtgwHoXSq9euQWtcnyvsR65IVRZZo0aD283cAIE7O7Ix6FofE1fGdTTP2nmyZVj74a5aggp4_IPOokeJAn24Ou7kXY7f9p_Pcdg-nufD3B3r0_nx5vh7nyeh0fQrh7OPYwJHAsVfhNDZpawcCx1jm-rM5Oxt7n8Bx3pwncJw3_28AAAD__w2A-28">