Created on 2001-10-07.00:00:00 last changed 5 months ago
Additional notes (June, 2024)
Issue 2823 represents the current language rules; the example has undefined behavior.
Another instance to consider is that of invoking a member function from a null pointer:
struct A { void f () { } }; int main () { A* ap = 0; ap->f (); }
Which is explicitly noted as undefined in 11.4.3 [class.mfct.non.static], even though one could argue that since f() is empty, there is no lvalue->rvalue conversion.
If f is static, however, there seems to be no such rule, and the call is only undefined if the dereference implicit in the -> operator is undefined. IMO it should be.
Incidentally, another thing that ought to be cleaned up is the inconsistent use of "indirection" and "dereference". We should pick one. (This terminology issue has been broken out as issue 342.)
This is related to issue 232.
History | |||
---|---|---|---|
Date | User | Action | Args |
2024-06-22 07:40:17 | admin | set | messages: + msg7747 |
2003-11-15 00:00:00 | admin | set | messages: + msg949 |
2003-11-15 00:00:00 | admin | set | status: open -> nad |
2001-10-07 00:00:00 | admin | create |