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

             Bug #: 11994
           Summary: false positive: deregerence of null pointer.
           Product: clang
           Version: 3.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified


int& singleton();
void foo();
void bar( int x )
{
        int& a = singleton();
        int& b = singleton();
        if ( &a == 0 )
                foo();
        a = 5;
        if ( b != 5 )
                foo();
}


$ clang --analyze 0.cpp
0.cpp:9:2: warning: Dereference of null pointer
        a = 5;
        ^

of course in c++ the address of reference can't be a null pointer.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to