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

           Summary: False positive with -Wuninitialized with explicit
                    self-initialization
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


A lot of code uses the construct of direct explicit initialization to mark it
as intentional. The static analysis based -Wuninitialized should avoid warning
on this code.

% cat x.cc
void test() {
  int x = x;
  (void)x;
}

% ./bin/clang -fsyntax-only -Wuninitialized x.cc
x.cc:2:11: warning: variable 'x' is possibly uninitialized when used here
[-Wuninitialized]
  int x = x;
          ^
x.cc:2:3: note: variable 'x' is declared here
  int x = x;
  ^
x.cc:2:12: note: add initialization to silence this warning
  int x = x;
           ^
            = 0

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