<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 30, 2013, at 5:44 , Gábor Kozár <<a href="mailto:kozargabor@gmail.com">kozargabor@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">><span class="Apple-converted-space"> </span><i>...a lot of C++ objects are value objects, which means they get copied from place to place, and currently it's up to checker writers to determine when that copy happens. Anna actually started sketching out a C++ iterator checker and realized that this problem was nontrivial (though by no means insurmountable).<br><br></i></div><span style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; display: inline !important; float: none; ">I have thought that's what checkBind() is for - but I haven't really looked into what is it that it exactly does. Although I imagine that wrapping an object inside another object would cause complications - because in that case you have to check how the copy ctor behaves in relation to the wrapped object (i.e. is it copied or is a new one created, or is it passed by reference/pointer?), and then track it accordingly. Hmm... yeah, I think can see why this is a non-trivial matter. :) I do find it interesting though - might be something I'll look into during the summer holiday.</span><br style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "></blockquote></div><br><div>checkBind() is a little different from copy-constructing—it's used for low-level "physical" copies while copy-constructing is for "semantic" copies. In C++, every struct copy you do "calls" the copy-constructor for the struct, even if it gets lowered down to a memcpy later anyway. The analyzer similarly will evaluate the copy constructor, allow checkers to do pre- and post-call checks, and then use a low-level bind (if it can) to model the copy. Note that if there's a custom copy constructor, or if any of the members have a custom copy constructor, the low-level bind is no good and the analyzer will have to do a memberwise copy via IPA with the constructor body.</div><div><br></div><div>(In light of your other e-mail I should point out that this applies to trunk builds; at 3.2 I believe constructors were still considered opaque, even trivial copy constructors.)</div><div><br></div><div>I hope that clears up some of the intent, even if it doesn't directly help you.</div><div>Jordan</div></body></html>