[LLVMbugs] [Bug 10238] New: False positive with class scope "static const" used with an object

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jul 1 05:33:40 PDT 2011


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

           Summary: False positive with class scope "static const" used
                    with an object
           Product: clang
           Version: 2.9
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: geza at bitquad.com
                CC: llvmbugs at cs.uiuc.edu


Hi, 

this little code gives me an "operand is a garbage value" warning:

struct Array {
    static const int size = 4;
};

bool fn(Array &a) {
    int s = a.size;
    return s>0;
}

If I remove the "int s = a.size" line, and change the end to "return a.size>0",
I don't get a warning.

Or, If I change a.size to Array::size, I don't get a warning either.

-- 
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.



More information about the llvm-bugs mailing list