This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15684] Pointer to member function called on incomplete type should diag
- From: "leor at bdsoft dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 May 2004 20:29:27 -0000
- Subject: [Bug c++/15684] Pointer to member function called on incomplete type should diag
- References: <20040527163621.15684.gianni@mariani.ws>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From leor at bdsoft dot com 2004-05-27 20:29 -------
(In reply to comment #5)
> I cannot find where in the C++ standard that this is invalid and in the
thread it only says that they
> contracted EDG, if you think this is an issue, raise it to
comp.lang.c++.moderated instead and then
> when they decide it is invalid you can reopen this bug.
The citation from the standard is (5.5p3):
3 The binary operator ->* binds its second operand, which shall be of
type "pointer to member of T" (where T is a completely-defined class
type) to its first operand, which shall be of type "pointer to T" or
"pointer to a class of which T is an unambiguous and accessible base
class." The result is an object or a function of the type specified
by the second operand.
"where T is a completely-defined class type" is pretty cut-and-dried. Plus,
as John Spicer has indicated to me in a private email:
"An implementation could choose different forms of pointer-to-member
representations depending on whether or not the class had virtual functions, or
something like that. In such implemenations, a complete type would be needed
to get correct behavior."
-leor
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15684