[LLVMbugs] [Bug 20798] New: Analyzer cannot determine std::string empty

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 29 00:22:38 PDT 2014


            Bug ID: 20798
           Summary: Analyzer cannot determine std::string empty
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: Jani_Lahtinen at mcafee.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 12950
  --> http://llvm.org/bugs/attachment.cgi?id=12950&action=edit
Test code

Possible a duplicate of bug 19161, but the static analyzer fails to infer
whether std::string is emtpy. For the attached code scan-build says:

tst.cc:45:7: warning: Assigned value is garbage or undefined
  xxx = x;
      ^ ~
1 warning generated.
scan-build: 1 bug found.

But when the program is run one can see that it is not the case.

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/20140829/ea8f50e6/attachment.html>

More information about the llvm-bugs mailing list