This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/28986 failure to diagnose overflow for binary operators


On 06 Jan 2007 19:10:48 +0100, Gabriel Dos Reis
<gdr@integrable-solutions.net> wrote:
| 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:
|
| -/* 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.

I have updated (and bootstrapped and regression tested again) the patch to reflect this. Also, I have removed the testcase g++.dg/conversion/nullptr1.C since it is already included and thoroughly tested in g++.dg/warn/overflow-warn-*.C

Another issue is that g++.dg/warn/overflow-warn-*.C testcases are a
modified copy of the corresponding gcc.dg/overflow-warn-*.c. Should I
use "svn copy" and modify each of them to keep the history? Or should
I just create them as new files to avoid any trouble?

Cheers,

Manuel.

Attachment: c-c++-overflow-testsuite.diff
Description: Text document

Attachment: c++-overflow-warning.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]