C++ Logo

SG16

Advanced search

Subject: Re: Wide characters with multiple c-chars
From: Jens Maurer (Jens.Maurer_at_[hidden])
Date: 2020-07-03 02:02:09


On 02/07/2020 09.09, Corentin via SG16 wrote:
> Hello,
> As part of https://wg21.link/p2178r0,

We haven't really talked about P2178 and its multitude of small-ish
changes in SG16.

> I would like to make *wide* characters litteral with multiple c-char (ie: L'abc') ill-formed

For this particular item, I'd like to have WG14 take the lead:
If they remove the feature, WG21 should follow.

If (for whatever reason) WG14 decides to keep the feature,
there are insufficient reasons for WG21 to spend resources
to remove the feature on its own.

There are zero ripple effects from this conditionally-supported
misfeature, and we have far bigger fish to fry.

As a first step, I'd suggest you file a bug report with MSVC
for the wide multi-character literal case to give a warning
(this likely being a typo).

Jens

> https://compiler-explorer.com/z/MHExrk%c2 
>
> All compilers but MSVC emit a warning by default, some implementations pick the first c-char, others pick the last.
> There is no use (no occurrence in any of the packages in vcpkg) or usage for this feature.
>
> So why do this?
> - Someone unfamiliar with C++ might do auto str = L'abc' instead of L"abc"
> - Things that are not useful should not linger for 40 more years in the standard;  Tom and I talked too much about how to word this "feature" as part of P2029, so it's not free.
> - It's part of a wider "Bogus conversions in phase 5" should be ill-formed rather than doing their best to compile *something*
>
> Please note that I am not proposing to make (narrow) multi character literals ill-formed or deprecated at this point, there are some uses, and these uses are intended.
>
> I would really like your opinion so we can propose that change to EWG and make the change without taking too much of anyone's time (the process really isn't tuned for very small changes, which is why that is part of a larger paper)
>
> Thanks a lot, 
> Corentin
>
>
>  
>


SG16 list run by sg16-owner@lists.isocpp.org