<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 29 March 2018 at 15:08, George Karpenkov via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Richard,<br>
<br>
Thanks for your reply!<br>
<span class=""><br>
> Can you say more about why the static analyzer might want to map from a BindingDecl to a DecompositionDecl?<br>
<br>
</span>One thing I couldn’t figure out is how to figure out whether a given binding represents a global.<br>
But turns out that for my use case turns out that somehow was not required.</blockquote><div><br></div><div>I'm still not sure why you'd want to know that.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
> BindingDecls should generally just be treated wrappers around some lvalue expression.<br>
<br>
</span>Right, yes, that unfortunately forces quite a lot of special-casing on us, as suddenly in many places where we expected only a VarDecl we know get a BindingDecl.</blockquote><div><br></div><div>What kind of places? The intended operational semantics are that when you see a DeclRefExpr naming a BindingDecl, you evaluate its associated subexpression. I'd imagine this is best modeled by generating CFG nodes for the subexpression on each occurrence of such a DeclRefExpr, much like (IIRC) is done for CXXDefaultArgExpr and CXXDefaultInitExpr. That seems like it would not require too many special cases elsewhere.</div><div><br></div><div>(Perhaps the static analyzer needs more than that in order to produce more user-friendly diagnostics?)</div></div></div></div>