[Bug c++/70057] duplicate integer overflow diagnostic in constant expressions
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Feb 27 16:54:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70057
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-02-27
Ever confirmed|0 |1
Known to fail| |5.3.0, 6.3.0, 7.0
--- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed. In GCC 6 and 7 the C++ front end issues not just one or two but
three diagnostics for the test case in comment #0:
$ cat t.C && gcc -S -Wall -Wextra -Wpedantic t.C
template <int N> struct S { };
S<(__INT_MAX__ + 1)> s;
t.C:2:16: warning: integer overflow in expression [-Woverflow]
S<(__INT_MAX__ + 1)> s;
^
t.C:2:20: error: overflow in constant expression [-fpermissive]
S<(__INT_MAX__ + 1)> s;
^
t.C:2:20: error: overflow in constant expression [-fpermissive]
t.C:2:20: note: in template argument for type ‘int’
More information about the Gcc-bugs
mailing list