<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hello. I am newbie in Clang Static Analyzer and I am trying to
write new Clang Static Analyzer check, which is aimed to find
issues with casting values to enum: if we cast anything which is
no presented in target enum it will be unspecified/undefined
behavior(depends on C++ version).</p>
<p>So my plan is:</p>
<ol>
<li>Find all casts in source code. Seems like
'check::PreStmt<CastExpr>>' it's what I need.</li>
<li>In my implementation of `checkPreStmt` method I must get
target type from CastExpr, but I don't know, how to do it - can
you help with it?</li>
<li>Then if target type in Cast is Enum, I must get all values
from this Enum and compare it with all possible values which can
be presented by CastExpr->getSubExpr() - here I don't know
how to evaluate CastExpr->getSubExpr() and how to get all
values from Enum.</li>
</ol>
<p>Do you have any ideas?<br>
</p>
<pre class="moz-signature" cols="72">--
Best regards,
Alexander Zaitsev</pre>
</body>
</html>