https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2015-11-25 00:00:00 |2016-4-26 CC| |msebor at gcc dot gnu.org Known to fail| |4.9.3, 5.3.0, 6.0 --- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- Confirmed with all supported versions of GCC, including today's top of trunk: $ cat z.cpp && /home/msebor/build/gcc-trunk-git/gcc/xgcc -B/home/msebor/build/gcc-trunk-git/gcc -S -Wall -Wextra -Wpedantic -fdump-tree-optimized=/dev/stdout -xc++ z.cpp constexpr const char s[] = "1234"; constexpr const char* p = "1234"; static_assert (s < s + 1, "This works"); static_assert (p < p + 1, "This fails"); z.cpp:5:1: error: non-constant condition for static assertion static_assert (p < p + 1, "This fails"); ^~~~~~~~~~~~~ z.cpp:5:18: error: ‘(((const char*)"1234") < (((const char*)"1234") + 1u))’ is not a constant expression static_assert (p < p + 1, "This fails"); ~~^~~~~~~