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

    <tr>
        <th>Summary</th>
        <td>
            Warning for mismatched declaration/definition with enum
        </td>
    </tr>

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

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

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

<pre>
    For a testcase such as

```
enum E { l = -1, z = 0, g = 1 };
int foo(void);
enum E foo(void) { return z; }
```
If the implementation type of `enum E` is not `int`, we will correctly emit an error (e.g. -fshort-enums).
It would be desirable to emit a warning in this case, because it is probably a mistake and definitely a portability error.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtkdGumzAMhp8m3FhFIdBSLrg4XVdpT7DrJBjIWSBVYk7V8_QzlLNp0qQI7Nj-_fFjQvdsbyGCBsJEVieEtNgRdBLyKuTb_jzJ_WwpzssE30HUF_AgyiscCqG-wecWyzUctrDglqsoL68pNxP0IQh1_giuE6r5U9n1_ilu6hFpiTN8cucm9T-YHz3QiOCmu8cJZ9Lkwgz0vCOEHrjtpc4BuARzoPWOWVYBJn0gPJz3YEOMaMk_ASdHoGfAGNkYJsJ8yOHQpzFEOqxqifnyfTvBIyy-A4PQYXJRG49AYVeBh46zmwdwjDTy_tXhda1Bqxc2m5v49h6D4cEnD0wukf6FDNCxYO9mR7gV7rxdG-cdPV9oeda1ZdeUjc7Ikcf2576rZ2yWmTTZEVcV63XcbBHqtmuuHj0cjbB-T7ZE345E9yTKN-7hM3BtMbkNEyfef3y9Doz6zj5x6lJakK24HatanrKxbUxXlrYqVdeXvambojaVssdTXSGqqmgyrw361IrjRRyvmWuVVEpWslBSFkWTW9uV1fmEdWMbe5aNqCRO2vl8XZyHOGSx3RjMMiQuerYq_S3qlNwwI37p64X4j7WRxvp0ltmG226svwHIbu5A">