https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61660
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Udo Steinberg from comment #3) > Created attachment 33035 [details] > Testcase 2 > > Then, similar to this new test case, I would expect something like the > following: > > g++ -std=gnu++11 foo.cc -o foo > > foo.cc: In function 'void check_type(unsigned int, unsigned int)': > foo.cc:10:17: error: non-constant condition for static assertion > case 0: static_assert (s == sizeof (uint16), "must use 16bit > type"); break; > ^ > foo.cc:10:17: error: 's' is not a constant expression > > If the compiler does not treat 'x' in the first test case as a constant, it > would be good to issue a warning like it does for 's' in the second test > case. That is still correct s is not a constant expression.