On Sep 1, 2009, at 10:27 AM, Ted Kremenek wrote:


On Sep 1, 2009, at 10:22 AM, Douglas Gregor wrote:

Author: dgregor
Date: Tue Sep  1 12:22:34 2009
New Revision: 80690

URL: http://llvm.org/viewvc/llvm-project?rev=80690&view=rev
Log:
Add DeclContext::Equals to compare declaration contexts based on their primary context. Use this instead of pointer comparisons


Can we make pointer comparisons of DeclContext objects illegal (e.g., a private operator== method)?

Sadly, no :(

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.,

  private:
    friend bool operator==(DeclContext *, DeclContext *);

does not qualify.

  - Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to