I am learning C++ using the books listed here. In particular, I read here that:
If the value represented by a single hexadecimal escape sequence does not fit the range of values represented by the character type used in this string literal (
char
, char8_t, (since C++20)char16_t, char32_t, (since C++11)or wchar_t), the result is unspecified.
(emphasis mine)
This means that, in a system where char
is signed, the result of '\xe4'
will be unspecified. But here the person says that "it is implementation defined and not unspecified".
So, my question: Is the behavior of the below statements unspecified or implementation-defined? That is, is this an error in cppreferene's documentation or have I understood it incorrectly.
char arr[] = {'\xe4','\xbd','\xa0','\xe5','\xa5','\xbd','\0'}; //unspecified or implementation defined
char ch = '\xef'; //unspecified or implementation defined