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

            Bug ID: 41661
           Summary: Missing -Wself-assign (-field) for struct member self
                    assignments
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
          Assignee: dcough...@apple.com
          Reporter: david.bolvan...@gmail.com
                CC: dcough...@apple.com, llvm-bugs@lists.llvm.org

Tested with current Clang trunk.

struct A {
    int b;
};

void selfassign(struct A *a, struct A *b, int n)
{
  a->b = a->b; // Sadly, no warning (typo, should be b->b)
  n = n; // Clang warns
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to