CLang is making two assumptions. First, the while loop can be removed. Second, the return is never reached.
It shouldn't be doing both of them. Removing the while means the return can be reached.
Removing a return is just wrong under any circumstance.