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

           Summary: Uninitialized value false positive when pointer
                    captured by ctor/method
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


Created an attachment (id=6408)
 --> (http://llvm.org/bugs/attachment.cgi?id=6408)
small reproduction case

A C++ object method taking a pointer argument has the opportunity to capture
said pointer in its own or associated state s.t., later a side effect of
another method call would be to initialize the value pointed to by the method.
This is really no different than a C function taking an argument and storing it
in global state, and having another C function mutate it.

In the attached reproduction, the value of main's local int i is initialized by
the time that UseMe is called, but clang warns anyway:

test.cc:19:3: warning: Function call argument is an uninitialized value
  exit(i);
  ^    ~
1 warning generated.

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