[Bug c++/67824] constexpr char* compare operations not constexpr, but char[] operations ARE
erich.keane at intel dot com
gcc-bugzilla@gcc.gnu.org
Wed Jan 6 20:43:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67824
--- Comment #1 from Erich Keane <erich.keane at intel dot com> ---
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");
More information about the Gcc-bugs
mailing list