From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2783 invoked by alias); 6 Jan 2007 18:11:04 -0000 Received: (qmail 2775 invoked by uid 22791); 6 Jan 2007 18:11:03 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-106-saturday.noc.nerim.net (HELO mallaury.nerim.net) (62.4.17.106) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 06 Jan 2007 18:10:56 +0000 Received: from zeus.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by mallaury.nerim.net (Postfix) with ESMTP id 57DA64F3C9; Sat, 6 Jan 2007 19:10:42 +0100 (CET) Received: from zeus.integrable-solutions.net (localhost [127.0.0.1]) by zeus.integrable-solutions.net (8.13.3/8.13.3/SuSE Linux 0.7) with ESMTP id l06IAnCY008598; Sat, 6 Jan 2007 19:10:51 +0100 Received: (from gdr@localhost) by zeus.integrable-solutions.net (8.13.3/8.13.3/Submit) id l06IAnVD008597; Sat, 6 Jan 2007 19:10:49 +0100 To: =?iso-8859-1?q?Manuel_L=F3pez-Ib=E1=F1ez?= Cc: gcc-patches Subject: Re: [PATCH] PR c++/28986 failure to diagnose overflow for binary operators References: <6c33472e0701060949l27f86e3bx1eb762c0c93fb394@mail.gmail.com> From: Gabriel Dos Reis In-Reply-To: <6c33472e0701060949l27f86e3bx1eb762c0c93fb394@mail.gmail.com> Date: Sat, 06 Jan 2007 18:11:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-01/txt/msg00480.txt.bz2 "Manuel L=F3pez-Ib=E1=F1ez" writes: | :ADDPATCH c++: |=20 | Somehow the C++ front-end is not able to diagnose overflow for the | result of binary operators. The fix is trivial (I can hardly believe | that this is not a regression). In addition, I have adapted the | overflow testcases from the C front-end to the C++ testsuite with some | minor modifications. For reference, I also provide a diff showing | those modifications. |=20 | One particular issue that I am not sure about is whether initialisers | for static variables need to be constant in C++ as they do in C. The | relevant hunk in the diff between C and C++ testcases is: |=20 | -/* But this expression does need to be constant. */ | +/* But this expression does need to be constant (in C++ ???). */ No, C++ does not have that restriction. (there is a new category of constant expressions in the pipeline, but it is too early to devise a testcase for that right now). The patch is OK, modulo removal of the C-only restriction. -- Gaby