[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 Martin Sebor changed: What|Removed |Added Status|NEW |RESOLVED Known to work||7.0 Resolution|--- |DUPLICATE Known to fail|6.0 |6.1.0 --- Comment #5 from Martin Sebor --- This is fixed on trunk (7.0) by the patch for bug 71448 committed in r237212. *** This bug has been marked as a duplicate of bug 71448 ***
[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 Martin Sebor 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 --- 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"); ~~^~~
[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 --- Comment #3 from Erich Keane --- Don't know if it is a result of the red-hat packaging, or the .1 release, but the 3.7.1 release from here: http://llvm.org/releases/download.html seems to no longer crash.(In reply to Erich Keane from comment #2) > Don't know if it is a result of the red-hat packaging, or the .1 release, > but the 3.7.1 release from here: http://llvm.org/releases/download.html > > seems to no longer crash. Er, sorry, this is for a different bug meant for clang. Please disregard, I don't see how to delete it.
[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 --- Comment #2 from Erich Keane --- Don't know if it is a result of the red-hat packaging, or the .1 release, but the 3.7.1 release from here: http://llvm.org/releases/download.html seems to no longer crash.
[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 --- Comment #1 from Erich Keane --- I just reconfirmed this in 5.3.1 on Fedora: gcc (GCC) 5.3.1 20151207 (Red Hat 5.3.1-2) Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Error message for the previous example is: constexpr_gcc_bug.cpp: In function ‘int main()’: constexpr_gcc_bug.cpp:8:5: error: non-constant condition for static assertion static_assert(root2 < root2 + 1, "This fails"); ^ constexpr_gcc_bug.cpp:8:25: error: ‘(((const char*)"12") < (((const char*)"12") + 1u))’ is not a constant expression static_assert(root2 < root2 + 1, "This fails");
[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824 Paolo Carlini changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2015-11-25 Ever confirmed|0 |1