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

    <tr>
        <th>Summary</th>
        <td>
            Enhancement: diagnose undefined behavior: lvalue conversion: lvalue has an incomplete type and does not have array type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          pmor13
      </td>
    </tr>
</table>

<pre>
    Code:
```c
struct x y;
int main(void)
{
    (void)(1 ? y : y);
}
struct x {int i;};
```
Invocation:
```
$ clang t0.c -O2 -Wall -pedantic -Wextra -std=c11
```
Expected diagnostics:
```
lvalue conversion: lvalue has an incomplete type and does not have array type
```
Actual diagnostics:
```
<nothing>
```
Clang version:
```
assertions trunk
```

C11:
> If the lvalue has an incomplete type and does not have array type, the **behavior is undefined**.

Extra: 

- Stack Overflow question: https://stackoverflow.com/q/74874062/1778275
- Godbolt demo: https://godbolt.org/z/85rnc6K9j

@EugeneZelenko Labels: `clang::diagnostics`, `enhancement`, `good first issue`.

@jakevossen5 @junaire @elhewaty Any interest / time / motivation in implementing this enhancement?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2L4zgQ_TXypUiw5M8cfHB34mXYhTnsYWBvslSx1S1LGUn2dPbXL3ISEnqysLADgVhVz69ePVWZe68Gg9iQ4oUU-4TPYbSuOU3W0SzprTw3r1YiyVqS7knakjK9_MTl7IObRYAPOJPs5RJSJsDElSGsXqyShO2ur1ZXAADAQ5LVFEjWwRlI1sI5hm5UpNp_KkOql8ivIqTa34E3WZfjF7NYwYOy5mfh1yPLQWhuBgjpVsDmK4PNN641bE4ouQlKwOYbfgTHYeODJNleUPqU6fBxQhFQglR8MNYHJfy_VdUL1zOCsGZB5y_y4BocuQduQBlhp5PGgBDOJwRuJEiLHowNMPIFgTvHz2vyaY1WhJnr_6KGZK_GhlGZgWSHp4jX1aG71qcg7j266LWH4Gbz_rzWhY_SO0t2gC9HCCP-HwfY68pAWEtY2-PIF2UdKA-zkXhUBuUltX2UcYj3Gq1_DG7gz8DFO3xd0B21_QHfZ_TXEYIxhNPqI-sI63wE2ituK-xEWPedsK7K6ypPS0ZYR6uqZlVxo_7Nyt7qABIn-zPfcMlurRsI6_4mrKsLZ0T5--7tUSHJ08M8oMG_UKN5t_AH71H7tZEyXac5Umbt492XafSIlCmakRuBE5pwDw7WSjgq5wMo72ckZbr9VPKNv-NivUdTQDzOhiuH8RH1iD94OENrzqBMQIc-AGEdBDXh-jDZoJZ1EUEZUPFaowAV925UHh5FZV0im0zush1PsKFlxWiRUUaTscl51dOe1jKradEjY7LcHTErWMEEzalMVMNSxihjFc2LOqdbUVBeUxQ18l1K6z7KnbjSW62XKRqdrP02xa6idaJXI2_fQNdE0KafB0_yVCsf_P21oILG5vCou70tG96nDm6z-LDhv2rtk9np5tMEqTDO_XUUo9br3-bk7BuKQFi39usJ69aW_wkAAP__6UDNMw">