r203029 - [-Wunreachable-code] generalize pruning out warning on trivial returns.

Ted Kremenek kremenek at apple.com
Wed Mar 5 16:24:56 PST 2014


No, my test case is wrong.  I’ll fix.

On Mar 5, 2014, at 4:15 PM, David Blaikie <dblaikie at gmail.com> wrote:

>> +MyEnum trivial_dead_return_enum_2(int x) {
>> +  switch (x) {
>> +    case 1: return 1;
>> +    case 2: return 2;
>> +    case 3: return 3;
>> +  }
>> +
>> +  return 2; // no-warning
> 
> Wow - was this return really considered 'dead' at some point? How/why?
> That looks totally reachable...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140305/37614406/attachment.html>


More information about the cfe-commits mailing list