[LLVMbugs] [Bug 23958] New: Simple construct that is otherwise diagnosed is not found when class is split up into source and header

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 26 00:54:27 PDT 2015


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

            Bug ID: 23958
           Summary: Simple construct that is otherwise diagnosed is not
                    found when class is split up into source and header
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: christian.kandeler at theqtcompany.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

For instance, this code:
    struct SomeClass { SomeClass(); };
    SomeClass::SomeClass() {
        int *i = 0;
        *i = 0;
    }
yields the following error, as expected: "someclass.cpp:5:8: warning:
Dereference of null pointer (loaded from variable 'i')"

However, if you put the declaration of SomeClass into a header and the
implementation into a source file (see attachment), then nothing gets diagnosed
anymore.

-- 
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/20150626/2c07acf1/attachment.html>


More information about the llvm-bugs mailing list