This is the mail archive of the gcc-bugs@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]

[Bug c++/48850] Bogus overflow in constant expression warning


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"

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