This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/69972] duplicate integer overflow diagnostic in constant expressions
- From: "bernds at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Mar 2016 15:52:18 +0000
- Subject: [Bug c/69972] duplicate integer overflow diagnostic in constant expressions
- Auto-submitted: auto-generated
- References: <bug-69972-4 at http dot gcc dot gnu dot org/bugzilla/>
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â