https://llvm.org/bugs/show_bug.cgi?id=26647

            Bug ID: 26647
           Summary: False positive - Switch statement analysis assumes
                    default cannot be taken
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kreme...@apple.com
          Reporter: avi.bugzi...@mail.ashevin.com
                CC: llvm-bugs@lists.llvm.org
    Classification: Unclassified

Created attachment 15915
  --> https://llvm.org/bugs/attachment.cgi?id=15915&action=edit
Sample code illustrating bug

When an enumerated type is used as a bit mask, the analyzer assumes that
covering all the individual enumeration values precludes reaching the default
case.  This can lead to warnings of unused initializations.

In the attached sample code, the analyzer warns that "bc" is initialized, but
not read.  The output of the program correctly logs "BC".

(Please forgive the extraneous bits.  The sample code is used for quick testing
of ideas.)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to