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/69972] duplicate integer overflow diagnostic in constant expressions


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69972

Bernd Schmidt <bernds at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernds at gcc dot gnu.org

--- Comment #3 from Bernd Schmidt <bernds at gcc dot gnu.org> ---
For C I'm thinking it should be straightforward to set/check TREE_NO_WARNING (I
have an untested patch).

For the C++ testcase the problem is that the first one is a warning, while the
second one is an error - we can't really omit that.

The C++ errors become even more entertaining when you add -fpermissive:

69972-b.cc:2:16: warning: integer overflow in expression [-Woverflow]
69972-b.cc:2:20: warning: overflow in constant expression [-fpermissive]
69972-b.cc:2:20: note: in template argument for type âintâ 
69972-b.cc: In instantiation of âstruct S<-2147483648>â:
69972-b.cc:2:22:   required from here
69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
69972-b.cc:1:27: note: in template argument for type âintâ 
69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
69972-b.cc:1:27: note: in template argument for type âintâ 
69972-b.cc:1:27: warning: overflow in constant expression [-fpermissive]
69972-b.cc:1:27: note: in template argument for type âintâ

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