Well, look at the statement logically. You have three clauses:
Both are null.
Both point to the same function.
Both have the same address.
These clauses are joined by a logical "or". Therefore, if any one of these is true, then the two pointers are allowed to compare equal. If a compiler so decides, it is possible to fail #3 yet still pass #2. Logical "or" means that such pointers would compare equal.
Also, it should be noted that member pointers do not have an "address" in the traditional sense. They do have a value, but it's not a memory address. That's why you're not allowed to cast them to void*
and so forth.
The passage guarantees, given function pointers t
and u
, if t == u
, that t(...);
shall cause the same behavior as u(...);
. That behavior will either be referencing NULL, calling the same function, or executing the code at the same address. Thus, the same behavior is had.
Technically, Mehrdad's problem is that he's getting the same value from two different member function names. So #3 applies. I don't see anything in the standard that requires that different member function names return distinct values when getting functions for them.