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

    <tr>
        <th>Summary</th>
        <td>
            poor diagnostic due to overloading in `extern "C"` block
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang:diagnostics
      </td>
    </tr>

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

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

<pre>
    https://godbolt.org/z/Koo18frzd (GCC does a bit of a better job, treating them as redeclarations and mentioning they're C functions)

The following invalid C++ code:
```
extern "C" {
void Foo(int);
int Foo();
}
```
will give the error:
```
<source>:5:5: error: functions that differ only in their return type cannot be overloaded
    5 | int Foo();
      | ~~~ ^
<source>:4:6: note: previous declaration is here
    4 | void Foo(int);
      | ~~~~ ^
1 error generated.
```
which is profoundly unfair to the person writing the code. The error isn't anything to do with functions that differ only in their return type, and everything to do with being in an extern "C" block, where overloading does not exist.

(quoting @ssbr from an internal bug)
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVL2S2zgMfhqowcRDUb8uVHi98RXX5gUoEZKY0ISPpOw4xT77DWUn6-S8xWn0RwL4AHwAoUIwkyPqoHqB6jVTS5zZd_rSW2W-Gcp61tdujvEUoNiBPIA8TKx7tnHDfgJ5-AHy8Ddz3o7-h0aQ7V_7PWqmgAp7E5HH9EMxksev3IPcY_SkonETxpmOqAJ60jRY5VU07AIqp_FILi3uWleQjSfc47i4YVUCuQXxCmJ3e3-ZCUe2li_JwrizskbjHuQLyBccWFMK_2ZQi_u9Lul7JO8QpNyDlAjNy23_zEbjgRlka1xM7oq7xLh4FzzuQvP6FP9irMXJnCnlgeQ9-49CgWIfePEDQfEZil11f34ZvWePcVYRtRlH8sjOXtG4hG88eoqLdxivJ8JBOccRe0I-k7esNOmbK0TECqHZ4_NscL2S_O3tDaH6_DTCEopdnQJzHBPBePJ0NrwEfKgnmoAzeXoHLlfgjwn-zfmD9_zGBE7kyKtIevOc8dkMc_J68jzy4rS94uJGZTxGXqtwIh_Y4cWbn224tsgGv_wsEZrgQDYRlbvGeVVi1IwXE-f_W4bU8qml6Uz-v2A93ToWlcM_erG3PHxL1pfE368aJv31gKXa0ncT4ubxKIBs_1l4TQxKEULvcfR8TPjGJXxlsV8mkNtMd4XeFluVUZc3om6qti6LbO4KXet2q_si11rU4yiGXLd5Nba5IKmqNjOdFLIUUuSiKBpZbIQu81L2dV2LbSVkA6WgozJ2Y-35mCZFZkJYqGuFLKrMqp5sWGeOlINVboJip42aHIdohgBSpmHku2T9qV-mAKWwJsTwjhdNtNSdmD2-W6JeKJH7SJVxCLX4nVqoxY3dbPH2z_Fm4rz0m4GPIA_J3f3z6eT5Kw0R5GHNJYA8rOn8GwAA__903qSS">