From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17346 invoked by alias); 14 Jan 2008 21:29:44 -0000 Received: (qmail 17228 invoked by alias); 14 Jan 2008 21:29:01 -0000 Date: Mon, 14 Jan 2008 22:29:00 -0000 Message-ID: <20080114212901.17227.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/27177] [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: 2008-01/txt/msg01433.txt.bz2 ------- Comment #17 from crowl at google dot com 2008-01-14 21:29 ------- Subject: Re: [4.1/4.2/4.3 Regression] ICE in build_simple_base_path, at cp/class.c:474 The consensus of the C++ standards reflector is that all three following code snippets are well-formed. explicit: struct B {}; struct D : public B { static const int i = sizeof((B*)(D*)0); }; implicit: struct Z {}; struct A : Z {}; Z* implicitToZ (Z*); struct B : A { static const int i = sizeof(implicitToZ((B*)0)); }; non-null: struct B {}; struct D; D* p; struct D: public B { static const int i = sizeof ((B*)p); }; The rational is that even though the classes are not complete within their body, the bases must be known. The reason is that other features of the language, like co-variant returns, would fail. Since the bases are known, the conversions are well-formed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27177