<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><span class="vcard"><a class="email" href="mailto:ahmedasadics@gmail.com" title="Ahmed Asadi <ahmedasadics@gmail.com>"> <span class="fn">Ahmed Asadi</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - an impossible case for -Wimplicit-fallthrough and [[clang::fallthrough]]"
href="https://llvm.org/bugs/show_bug.cgi?id=30636">bug 30636</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>ahmedasadics@gmail.com
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - an impossible case for -Wimplicit-fallthrough and [[clang::fallthrough]]"
href="https://llvm.org/bugs/show_bug.cgi?id=30636#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - an impossible case for -Wimplicit-fallthrough and [[clang::fallthrough]]"
href="https://llvm.org/bugs/show_bug.cgi?id=30636">bug 30636</a>
from <span class="vcard"><a class="email" href="mailto:ahmedasadics@gmail.com" title="Ahmed Asadi <ahmedasadics@gmail.com>"> <span class="fn">Ahmed Asadi</span></a>
</span></b>
<pre>fun<false> gets instantiated to the following function:
int fun(int i)
{
switch (i)
{
case 1:
if (false)
return 3;
case 2:
return 4;
default:
return 5;
}
}
case 1 falls through to case 2, hence the warning.
When you insert [[clang::fallthrough]], it isn't reachable in fun<true> because
it will always hit 'return 3'.
Clang produces valid warnings in both cases. I'm marking the bug as invalid.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>