From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20123 invoked by alias); 2 May 2007 01:24:33 -0000 Received: (qmail 20061 invoked by uid 48); 2 May 2007 01:24:21 -0000 Date: Wed, 02 May 2007 01:24:00 -0000 Message-ID: <20070502012421.20060.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/27177] [4.0/4.1/4.2/4.3 Regression] ICE in build_simple_base_path, at cp/class.c:474 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "crowl at google dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-05/txt/msg00071.txt.bz2 ------- Comment #12 from crowl at google dot com 2007-05-02 02:24 ------- (In reply to comment #10) > I am not convinced that the code in Comment #8 is valid. > > Although the operand of sizeof is not in fact evaluated, it seems odd to > permit an operand which cannot, even in principle, be evaluated. This is > not even a case in which evaluating the operand would lead to undefined > behavior; there is simply no way to evaluate the operand at all. If there > is an implicit conversion from B* to Z* at this point, then we must know > how to perform the conversion, but we cannot, since B is not complete. While that view has merit, I find no requirement in the standard that requires a complete class. Setting that aside s possibly unreasonable, I think 4.10 paragraph 3 "The null pointer value is converted to the null pointer value of the destination type." enables conversion of null pointers when the pointer type has known bases but is not yet complete. > Are you arguing that in: > > struct B {}; > struct D : public B { > static const int i = sizeof((B*)(D*)0); > }; > > the conversion from D* to B* is a static_cast? I think (B*)(D*)0 is a conversion under 4.10. > Has anyone asked about this case on the core reflector? Would you like me to? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27177