<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54215>54215</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Improvement: diagnose undefined behavior: within a translation unit the same identifier appears with both internal and external linkage
</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>
```
static int x;
void f(void)
{
int x;
{
extern int x;
}
}
```
Expected diagnostics:
```
t0.c:7:20: error: the same identifier 'x' appears with both internal and external linkage
7 | extern int x;
```
C11:
> If, within a translation unit, the same identifier appears with both internal and external linkage, the behavior is undefined.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytklGPnCAQxz8NvpAaRF3WBx7udq_JfQyUUWkRDODe9tt39Nxuttk2aVICOPBnZn4OtF7_kOTA9s7OhL3EpJLpqHGJXkn5-rl58UbTnvDjahDefO4SscsU26PDuvMgrw2uCYJ7evJ8i3gzHqHerjN0CTTVRg3ORySMpHx5ejaxvENN4OAMJwoh-LAaaQQa1QTUaHDJ9AYCJVxccVA1z6BCpB8mjbT1OCEm0ipLldM7Oi6scd_VAHd2gfQn-tdf_A3wVBR39vKNvmNhT1ti46iiKSgXLV6Cd3RxJq3iM_J_Jd7DtDCqi_GBmojhNfTGgc4zLUvdlI3KkkkW5Ps0B3-BCbOtldvLDnePX3FW-Y_s_wM8W4KVY0rzduP8K_YBPZc27_yEC2svt88XhP6GDwWXJsYFIhp1xYs6G6UoqwNvD5UuW9ZqEGXHj1o1x7qvWK9Uk1nVgo2S1K-EcwcfdAuBNqnPmZGccc5KVhVNzXiVV1Xbi2PVCNEzIZqGVAwmZWy-cuQ-DFmQG1K7DBFFa2KKd1HFaAYHsKXD-GpJow9ynnwoymzLLDfyn3DyIOQ">