This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15684] Pointer to member function called on incomplete type should diag


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]