https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65509

--- Comment #14 from Mitsuru Kariya <kariya_mitsuru at hotmail dot com> ---
The rev.221737 seems to be able to compile the sample code above, but cannot
compile another sample code like below.

================= sample code =================
constexpr char s1[] = "s1";
constexpr char s2[] = "s2";

constexpr auto eq = (s1 + 0) == (s2 + 1);

int main() {}
================= sample code =================
================ error message ================
compare2.cpp:4:30: error: '(((const char*)(& s1)) == (((const char*)(& s2)) +
1u))' is not a constant expression
 constexpr auto eq = (s1 + 0) == (s2 + 1);
================ error message ================

Although the first sample causes compilation error only in 5.0.0, the second
sample causes compilation error in 4.9.2 too.

cf. http://melpon.org/wandbox/permlink/KhcREuNqGofbZvqw

Reply via email to