<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - alpha.core.BoolAssignment does not work (at least for C and C++)"
href="https://bugs.llvm.org/show_bug.cgi?id=52296">52296</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>alpha.core.BoolAssignment does not work (at least for C and C++)
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Static Analyzer
</td>
</tr>
<tr>
<th>Assignee</th>
<td>dcoughlin@apple.com
</td>
</tr>
<tr>
<th>Reporter</th>
<td>nok.raven@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dcoughlin@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>I am not sure whether alpha.core.BoolAssignment is supposed to work with C and
C++ code
(<a href="https://clang-analyzer.llvm.org/alpha_checks.html#alpha.core.BoolAssignment">https://clang-analyzer.llvm.org/alpha_checks.html#alpha.core.BoolAssignment</a>
suggests it is only for ObjC?) though source code
(<a href="https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp#L43-L53">https://github.com/llvm/llvm-project/blob/e356027016c6365b3d8924f54c33e2c63d931492/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp#L43-L53</a>)
might indicate it should, but the next code (derived from the documentation
example) does not produce a warning:
#include <stdbool.h>
typedef int BOOL;
void test() {
BOOL foo = -1;
_Bool bar = -1;
bool qaz = -1;
}
<a href="https://godbolt.org/z/MMTzcYz65">https://godbolt.org/z/MMTzcYz65</a>
See also
<a href="https://stackoverflow.com/questions/69592513/scan-build-for-clang-13-not-showing-errors">https://stackoverflow.com/questions/69592513/scan-build-for-clang-13-not-showing-errors</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>