<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 1, 2009, at 10:27 AM, Ted Kremenek wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 1, 2009, at 10:22 AM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Author: dgregor<br>Date: Tue Sep  1 12:22:34 2009<br>New Revision: 80690<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=80690&view=rev">http://llvm.org/viewvc/llvm-project?rev=80690&view=rev</a><br>Log:<br>Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons<br><br></span></blockquote></div><br><div>Can we make pointer comparisons of DeclContext objects illegal (e.g., a private operator== method)?</div></div></blockquote></div><br><div>Sadly, no :(</div><div><br></div><div>An overloaded operator has to have at least on parameter of class or enumeration type (or reference to one of those). The signature we would need, e.g.,</div><div><br></div><div>  private:</div><div>    friend bool operator==(DeclContext *, DeclContext *);</div><div><br></div><div>does not qualify.</div><div><br></div><div>  - Doug</div></body></html>