[cfe-commits] Patch - String literal UCN conversion should use post-concatenation string type
Douglas Gregor
dgregor at apple.com
Sat Aug 6 22:18:07 PDT 2011
On Jul 2, 2011, at 9:53 PM, Craig Topper wrote:
> When a multiple piece string literal is parsed by clang, each piece
> performs UCN conversion depending whether it was written as "" or L"".
> This means the "" are converted using UTF-8 and the L"" are converted
> using UTF-16 or UTF-32 depending on the size of wchar_t. When a narrow
> string and wide string are concatenated, the final string is a wide
> string. So if you put a UCN in the part declared as narrow you can end
> up with UTF-8 data in a wide string.
>
> This patch fixes this by using the final type of the string to do UCN
> conversion.
Sorry, I must have missed this before... do you have a test case?
- Doug
More information about the cfe-commits
mailing list