<div dir="ltr">







<p class="">Hi all,</p>
<p class="">It seems that the Clang Static Analyzer may miss the analysis information of UnaryOperator. For example:</p>
<p class="">void func(int s) {</p><p class="">    s++;</p>
<p class="">    ++s;</p>
<p class="">}</p>
<p class="">The example may be quite ridiculous…</p>
<p class="">My checker contains a method: <i>void checkPostStmt(const Stmt *DS, CheckerContext &C).</i></p>
<p class="">I thought that it can capture any kind of Stmt.  Since UnaryOperator is a subclass of Expr and Expr is a subclass of Stmt, I thought my checker can give me the analysis information of "s++" and "++s". However, it returned nothing. </p>

<p class="">What' more, I have tried to add another checkPostStmt() method in my checker. The declaration</p>
<p class="">of this method is <i>void checkPostStmt(const UnaryOperator *Op, CheckerContext &C)</i>. The result is same with the previous one, it returned nothing.</p>
<p class="">In fact, I want to use Clang Static Analyzer to capture all kinds of UnaryOperator, including 's++/++s/s--/--'(IncrementOp/DecrementOp). *p(pointer dereference) and so on. So how can I get the analysis information of UnaryOperator in Clang Static Analyzer?</p>

<p class="">Thanks a lot.</p>
<p class=""><br></p>-- <br><div dir="ltr"><font color="#444444">Best regards,</font><div><font color="#444444">Arthur Yoo</font></div></div>
</div>