[LLVMbugs] [Bug 15774] New: BoolAssignmentChecker not catching literals

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 17 21:10:12 PDT 2013


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

            Bug ID: 15774
           Summary: BoolAssignmentChecker not catching literals
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: adamschn at umich.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I'm not sure if this is by design, but it doesn't seem like the bool assignment
checker is reporting a bug for the use of integer literals. For example, cases
like this don't produce warnings:

void test_cppbool_initialization() {
  bool x = 2;  // expected warning
  x = 3; // expected-warning
}

I thought that the current structure with getting as a DefinedSVal would catch
literal assignment, but that doesn't seem to be the case.

If someone could point me in the right direction, I would be interested in
fixing/extending this behavior.

-- 
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/20130418/6dc0aced/attachment.html>


More information about the llvm-bugs mailing list