[llvm-bugs] [Bug 31646] New: alpha.deadcode.UnreachableCode false positive

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Jan 15 04:42:13 PST 2017


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

            Bug ID: 31646
           Summary: alpha.deadcode.UnreachableCode false positive
           Product: clang
           Version: 4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: bagnara at cs.unipr.it
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 17842
  --> https://llvm.org/bugs/attachment.cgi?id=17842&action=edit
Testcase allowing reproduction of the problem.

$ cat z.c
union U {
  int a;
};

int foo(union U u) {
  return u.a ? 1 : 0;
}

$ clang-4.0 -cc1 -analyze -analyzer-checker=alpha.deadcode.UnreachableCode z.c
z.c:6:20: warning: This statement is never executed
  return u.a ? 1 : 0;
                   ^
1 warning generated.
$ clang-4.0 --version
clang version 4.0.0-svn291446-1~exp1 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
$

-- 
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/20170115/81aa8793/attachment.html>


More information about the llvm-bugs mailing list