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

    <tr>
        <th>Summary</th>
        <td>
            Improvement: better diagnostics for undefined behavior
        </td>
    </tr>

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

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

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

<pre>
    Compiling this code:
```
void foo(void)
{
 struct x* y;
    *y;
}
```
with `-O3 -std=c11 -pedantic -Wall -Wextra` leads to:
```
<source>:4:5: error: incomplete type 'struct x' where a complete type is required
    4 |     *y;
```
For people who learned C11 by reading C11 this diagnostic may be confusing because C11 does not require the operand of the unary `*` operator to be pointer type, which points to an object of a complete type.

Expected diagnostics:
```
<source>:4:5: error: lvalue conversion: lvalue has an incomplete type
    4 | *y;
```
@AaronBallman 
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyck8-OozgQxp-muJQSgQ1hcuBApyfSnvY4Z_-pBK-Mi7VN0nn7lemspie7p5GQcJWL4vd9ZauU3DUQDdC9QfdeqTVPHIdl5tjISrN9DCeeF-dduGKeXELDlkCOUI9wqJ9PPd7YWbwwg_hWliCOpaB_g3rElONqMn6AGPEBcsshIojxGUH__tLu7vKEcKh3f0rcpWxBvpumwd1CVoXsDO5-KO9x94M-clRwqNGTsgkz_xcN5CnxGg2B_A5ybEGOHcgRKUaOZeGC4XnxlAnzYyEE0f9E7vE-USRU-GuRSxjp79VFsk89LUJ_whdlXzjOHHEhXjzhfeICHANZPDUN6gdGUrZ4XMLNZ-vUNXAqYmf1QE1oOFzWVIo0GbUm2ootU8LA-V8czBMhLxRVsMiXLVyDio_iJ4iC9LmdOWLm0nhhFzLFTRiIE94nZ6bPbLEUVUDWf5HJpd-LEfuish6_fyxkMtkv2Ok3RuFvyq-b0hvF5Dh8SU4qFZKXaf1i_v8bD209qsjhTXk_q4CVHaQ9yqOqaGj6VvaH4_HQVNPQ289AH6U2qlPWyG-N7UQrj7oz7aVyg6hFV7d12wgp2mavpTq0Rredbo0Q1EJb06yc33t_m_ccr5VLaaWhka3sReWVJp-2uyZEoDtuuyBEuXpxKB_t9HpN0NbepZx-tskuexr-mJfIN5op5GKMplzG9sVyvHDENVi6uHK2NE3q5jhWa_TDlPOyzUScQZyvLk-r3hueQZzLb56v3RK5jBrEeYNLIM5P-tsg_gkAAP__yEFM_A">