[Bug c++/50941] [C++0x] user-defined string literals provide incorrect length for wchar_t, char16_t, and char32_t

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Tue Nov 1 10:25:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50941

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> 2011-11-01 10:24:59 UTC ---
I need to make a correction in regard to the actually provided length values:

a) The following assertions incorrectly hold:

static_assert( L""_len == 1, "Ouch");
static_assert( u""_len == 1, "Ouch");
static_assert( U""_len == 3, "Ouch");

b) For non-empty strings other "value patterns" occur, e.g. these tests

static_assert(L"1"_len == 3, "Ouch");
static_assert(u"1"_len == 3, "Ouch");
static_assert(U"1"_len == 7, "Ouch");

evaluate to true, even though the length should be 1 in all these cases.



More information about the Gcc-bugs mailing list