[LLVMbugs] [Bug 18392] False positive: Clang warns about unhanded switch values even if they are handled elsewhere

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 6 17:46:46 PST 2014


http://llvm.org/bugs/show_bug.cgi?id=18392

Richard Smith <richard-llvm at metafoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |richard-llvm at metafoo.co.uk
         Resolution|---                         |WONTFIX

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
Sorry, it's not feasible for us to fix this; this would require significant
flow analysis that is beyond the scope of what we want to do in the compiler
frontend. If you want this level of sophistication, the clang static analyzer
might work for you.

You can work around this with something like:

  switch( value )
  {
      case AnEnumA: __builtin_unreachable(); // handled above
      case AnEnumB: // ...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140107/3a4c4573/attachment.html>


More information about the llvm-bugs mailing list