<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/78440>78440</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [analyzer] Superfluous diagnostic piece "Assuming 'arg' is >= 0" appears even when 'arg' is unsigned
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          NagyDonat
      </td>
    </tr>
</table>

<pre>
    The analyzer (more precisely BugReporterVisitor.cpp) produces notes like "Assuming 'arg' is >= 0" when it assumes something new in a conditional statement (and doesn't produce these when the other branch is infeasible). However, this "Assuming 'arg' is >= 0" note did appear unexpectedly in a situation where 'arg' was unsigned:
```
int assuming_unsigned_ge_0(unsigned arg) {
  // expected-note@+2 {{Assuming 'arg' is >= 0}} 
  // expected-note@+1 {{Taking false branch}}
  if (arg < 0)
    return 0;
  // The rest of the testcase is just here to trigger a report in which 'arg' is important:
  // expected-note@+2 {{Assuming 'arg' is <= 0}}
  // expected-note@+1 {{Taking false branch}}
  if (arg > 0)
    return 0;
  // expected-note@+2 {{Division by zero}}
  // expected-warning@+1 {{Division by zero}}
  return 100 / arg;
}
```

I'm creating this issue to track and publicize this issue. In the future I may spend some time on fixing it, but anybody else can take it and I'm happy to help with reviews and other stuff.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy0lE9v4zYQxT8NfRnEoOk_kg86JPEazaWHdtFrQFEjaTYSKZBDe51PX5Cyt8kesgGKBQwbgobPv3mceToE6ixiJbYPYntY6Mi989WfurscnNW8qF1zqb72CNrq4fKKHoQqR-cRJo-GAg4XeIjdXzg5z-j_oUDs_NJMk1B7mLxrosEA1jEGGOgFQSh1H0IcyXYgVKF9J1QBFECsv4j1AaRQCs49WiAGnSoxQHAjcp-OWDwDWdBgnG2IyVk9QGDNOKLlRKdtA43DYIUq-IYA3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