This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/48850] Bogus overflow in constant expression warning
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 16 Jun 2015 12:42:00 +0000
- Subject: [Bug c++/48850] Bogus overflow in constant expression warning
- Auto-submitted: auto-generated
- References: <bug-48850-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48850
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|rejects-valid |
Status|RESOLVED |REOPENED
Component|c |c++
Resolution|FIXED |---
Known to fail| |5.0
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Still present with the C++ frontend though.
> g++-5 -S t.c
t.c:3:36: warning: integer overflow in expression [-Woverflow]
extern char a[((size_t)-1 >> 1) + 1]; /* { dg-error "too large" } */
^
t.c:3:36: error: overflow in array dimension
t.c:3:36: error: size of array âaâ is too large
t.c:5:51: error: size of array âcâ is too large
extern int c[(((size_t)-1 >> 1) + 1) / sizeof(int)]; /* { dg-error "too large"