C++ Logo

liaison

Advanced search

Re: [wg14/wg21 liaison] [SG16] [ WG14 ] Mixed Wide String Literals

From: JeanHeyd Meneide <phdofthehouse_at_[hidden]>
Date: Wed, 9 Dec 2020 16:42:33 -0500
Dear Tom and Corentin,

On Wed, Dec 9, 2020 at 4:03 PM Tom Honermann via SG16
<sg16_at_[hidden]> wrote:
> On 12/9/20 2:22 PM, Corentin Jabot via SG16 wrote:
>> On Wed, Dec 9, 2020, 05:52 Tom Honermann via SG16 <sg16_at_[hidden]> wrote:
>>>
>>> Got it, thanks. I agree there are use cases for the behavior you describe of effectively ignoring any prefixes after the first one. One complication is that "" L"" is equivalent to L"" L"" (and L"" "") today; even after P2201 and N2594. That means prefixing an unadorned string literal won't have the effect of forcing an encoding. That would be inconsistent, but maybe that is ok.
>>
>>
>> How frequent is that pattern in actual production code?
>
> I have no idea, but I would hope it is exceedingly infrequent :)

     Not very. We sort of disabused the notion of mixing string
literals out of people since a lot of compilers did strange things
with it or just didn't support the u/U/u8 mixes. Most people didn't
ask, and most customers of static analyzers where this was a
warning/error never really complained if they hit it. There was quite
a few requests to remove the functionality, but with the explicit
intention of replacing it later in C. Again, I imagine C++ is hardly
affected by this since C++ has better tools for constant propagation,
concatenation, and more!

Sincerely,
JeanHeyd

Received on 2020-12-09 15:42:46