<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60416>60416</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Unreachable [[fallthrough]] is diagnosed twice
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang:diagnostics
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
AaronBallman
</td>
</tr>
</table>
<pre>
Consider the following example:
```
int n;
void f(void){
switch (n){
[[fallthrough]]; // allowed but not useful
case 1:;
}
}
```
Clang diagnoses the unreachable fallthrough attribute twice: https://godbolt.org/z/MfK5G9q54. Once for `-Wunreachable-code` and again for `-Wunreachable-code-fallthrough`. We should ensure that only one of those diagnostics is fired instead of two. We should also pay special attention that things like `-Wunreachable-code -Wno-unreachable-code-fallthrough` and `-Wno-unreachable-code -Wunreachable-code-fallthrough` continue to work as expected.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyEU0Fv4ywQ_TX4Mkpkg-MkBx-SRvkOn1Z7WvU8wNhmSyBrxk27v36Fm-5mu62KkAAxzLz3eIMpuT4QtWK1F6tDgRMPcWx3OMawR-9PGAod7XN7F0NylkbggaCL3seLCz3QE57OnoTaifIgyp1oyuucjy4wBKH2L6fH6Cx0Qm7yRsitWF8vII90cWwGEHIT_rnLY0a479B7HsY49YNYHfJUexDyKOQRMKMiC3piCJFhStRN_k0ag4mgyoDVbQWxPlwZ_N78TeXOY-jBOuxDTJRmHaYwEpoBtSe4AQbIPDo9MQFfnMnqwMB8TrnqDLWPVkfPyzj2Qh5_Cnn80v2_-m_7Y1Uv4WswWeIRRFMu7m9qLEy0JJoSMFjAHl34OGxxK1RTLuGeIA1x8hYopGkk4AEZYvDPEANB7ICHmOiVITuTwCXo3EgWXEhMaOeoS7xNhj5FOOMzpDMZhz5zp8AuhpcCPLjQJ_Dugd4HCov7EBefwJ8Zz8_fiYVP2YOJgV2YCDjCJY4PgAno6UyGyS4L2yq7VVssqK2a9apqNltVF0NbN7XWK7mVa4Wk9FZtGqm0oqraWIWlLlwrS6nKSlWVrGVVL9edriupjbG1xhorUZd0QueX3j-e8m8XLqWJ2qasq6bwqMmnufWkNNlfQu1u9BdS5p4c2_x6oac-ibr0LnH6k48de2q_3Rjxgz7Jn_nqXvviy2IaffvGmI6HSS9NPAl5zEWuy-I8xu9kWMjjzCAJeZxJ_AoAAP__uO5dyw">