[llvm] [llvm-rc] Concatenate consecutive string tokens (PR #68685)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 11 08:36:53 PDT 2023


cjacek wrote:

> However that’s problematic; we currently need to keep the `L””` or `””` around the strings until the end, since we need to know whether the data was defined as a long string or not.

The usual behavior (like in C) is that such concatenation promotes the whole string to be a wide string and testing with windres confirms that it follows that pattern. I used following test:
```
1 test
{
   "aaaa",
   L"bbbb" "cccc",
}
```
windres will interpret `"aaaa"` as a narrow string, but `L"bbbb" "cccc"` as a wide string, the same as `L"bbbbcccc"`. Implementing that behavior seems right to me and it means that the concatenation in tokenizer would not need to preserve 'L' part of each component separately and should be able to just concatenate the payload.

BTW, `"bbbb" L"cccc"` is considered a syntax error by windres.

https://github.com/llvm/llvm-project/pull/68685


More information about the llvm-commits mailing list