This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/52567] constant expression not recognized as being constant
- From: "l_belev at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Mar 2012 21:08:07 +0000
- Subject: [Bug c++/52567] constant expression not recognized as being constant
- Auto-submitted: auto-generated
- References: <bug-52567-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52567
--- Comment #5 from Luchezar Belev <l_belev at yahoo dot com> 2012-03-12 21:08:07 UTC ---
Ok, but at least the error message should be changed to tell about overflow.
For example the following code gives error too, but it says
"error: overflow in constant expression"
which is more clear
int foo(int x) {
switch (x) {
case 1: return 5;
case (1<<31)-1: return 7;
}
}