From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3597 invoked by alias); 27 May 2004 21:46:22 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3571 invoked by uid 48); 27 May 2004 21:46:21 -0000 Date: Fri, 28 May 2004 17:01:00 -0000 Message-ID: <20040527214621.3570.qmail@sourceware.org> From: "leor at bdsoft dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20040527163621.15684.gianni@mariani.ws> References: <20040527163621.15684.gianni@mariani.ws> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/15684] Pointer to member function called on incomplete type should diag X-Bugzilla-Reason: CC X-SW-Source: 2004-05/txt/msg03333.txt.bz2 List-Id: ------- Additional Comments From leor at bdsoft dot com 2004-05-27 21:46 ------- > oh - here is the link again, hopefully without wrapping > http://groups.google.com/groups?hl=en&lr=&ie=UTF- 8&c2coff=1&threadm=3ACC2828.45CA0D3C%40dresdner-bank.com&rnum=1&prev=/groups% 3Fq%3Dg:thl1416673164d%26dq%3D%26hl%3Den%26lr%3D%26ie%3DUTF-8%26c2coff%3D1% 26selm%3D3ACC2828.45CA0D3C%2540dresdner-bank.com That worked. I'm confused by some things Kanze says in that article. First, there's this: The question was whether you can take a pointer to member function on an incomplete class. I don't think that the standard says anything about this directly. But the way I read it, 5.5.3 is /very/ clear and direct. You can't do it. Then there's this: More generally, the standard always specifies when an incomplete type is illegal; using an incomplete type in a context which requires a complete type makes the program ill-formed, and requires a diagnostic. Considering this, it is interesting that 5.5 makes no such restriction. I interpret this to mean that you can also dereference the pointer without completing the type; the following is legal: class X ; void f( X* pc , void (X::*pmf)() ) { (pc->*pmf)() ; } Here again, the Standard says something must be a complete type (OK, the term actually used is "completely-defined", but I'm assuming that's the same thing), and Kanze is saying that the Standard "always specifies" when an incomplete type is illegal? As if saying something "must be completely-defined" is insufficient? Kanze goes on to show the /exact/ situation we're talking about, but he seems to think the Standard sanctions it. Help me out here, I don't get it. -leor -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15684