C++ Logo


Advanced search

Re: [SG16] Feedback on P1854: Conversion to literal encoding should not lead to loss of meaning

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Fri, 29 Oct 2021 11:31:19 -0400
On Fri, Oct 29, 2021 at 4:13 AM Corentin <corentin.jabot_at_[hidden]> wrote:

> On Fri, Oct 29, 2021 at 9:52 AM Jens Maurer <Jens.Maurer_at_[hidden]> wrote:
>> On 29/10/2021 04.53, Hubert Tong via SG16 wrote:
>> > With respect to the new encodability restriction for strings, I believe
>> that unevaluated strings should not be treated the same way as strings that
>> need to be translated into a literal encoding. I think we may need to
>> advance P2361 ("Unevaluated strings") first.
>> The paragraph in question starts with
>> "String literal objects are initialized with the sequence of code unit
>> values..."
>> The existing text using /string-literal/ in various places makes it clear
>> when
>> and if a string-literal is converted to a string literal object.
>> Insofar, I consider P2361 superfluous.
Aside from P2361's intentional changes, it highlights the fact that
diagnosable rules and semantics around string literals are underspecified
in contexts where strings are not used to initialize a string literal
object. It was rather easier to (intentionally) squint at the wording the
other way before.

> Agreed, I don't see a reason to introduce a dependency between the two
> papers.
> P2361 only changes are in regard to numeric sequences and encoding prefixes

I can agree that a strict reading means that P1854 is not causing a worse
problem of over-restricting uninitialized strings.

Received on 2021-10-29 10:31:47