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++/52567] constant expression not recognized as being constant


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;
    }
}


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