From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10797 invoked by alias); 10 Jun 2009 17:04:08 -0000 Received: (qmail 10545 invoked by uid 22791); 10 Jun 2009 17:04:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-pz0-f194.google.com (HELO mail-pz0-f194.google.com) (209.85.222.194) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 10 Jun 2009 17:03:58 +0000 Received: by pzk32 with SMTP id 32so701338pzk.0 for ; Wed, 10 Jun 2009 10:03:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.83.201 with SMTP id g9mr1281926vcl.42.1244653436499; Wed, 10 Jun 2009 10:03:56 -0700 (PDT) Reply-To: gdr@integrable-solutions.net In-Reply-To: <4A2FD669.5040905@gmail.com> References: <4A2FD0FE.8090508@gmail.com> <4A2FD669.5040905@gmail.com> Date: Wed, 10 Jun 2009 17:04:00 -0000 Message-ID: <206fcf960906101003y56491009u153ceb13e7f2552e@mail.gmail.com> Subject: Re: skip_evaluation From: Gabriel Dos Reis To: Paolo Bonzini Cc: Ian Lance Taylor , gcc@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00251.txt.bz2 On Wed, Jun 10, 2009 at 10:51 AM, Paolo Bonzini wr= ote: > >>> =A0 struct B {}; >>> =A0 struct D : public B { >>> =A0 =A0 =A0 static const int i =3D sizeof((B*)(D*)0); >>> =A0 }; >>> >>> =A0 struct Z {}; >>> =A0 struct A : Z {}; >>> =A0 Z* implicitToZ (Z*); >>> =A0 struct B : A { >>> =A0 =A0 =A0 static const int i =3D sizeof(implicitToZ((B*)0)); >>> =A0 }; >>> >>> =A0 struct B {}; >>> =A0 struct D; >>> =A0 D* p; >>> =A0 struct D: public B { >>> =A0 =A0 =A0 static const int i =3D sizeof ((B*)p); >>> =A0 }; >>> >>> (see PR27177). =A0All of these would still be forbidden within (0?x:y). >> >> OK, but should they perhaps give an error which would perhaps not be >> given if skip_evaluation is true? > > build_cp_class does not give errors after it tests skip_evaluation. =A0The > constant-expression errors are given in the parsers. which arguably is not a good place to issue such errors. Support for constexpr implies that we refrain from issuing such semantics error from the parser. However, constexpr patches will come somewhere in July, so Ian probably does not want to wait for that now. -- Gaby