This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/50941] [C++0x] user-defined string literals provide incorrect length for wchar_t, char16_t, and char32_t
- From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 01 Nov 2011 10:24:59 +0000
- Subject: [Bug c++/50941] [C++0x] user-defined string literals provide incorrect length for wchar_t, char16_t, and char32_t
- Auto-submitted: auto-generated
- References: <bug-50941-4@http.gcc.gnu.org/bugzilla/>
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.