[cfe-dev] [PATCH] C++0x unicode string and character literals now with test cases

Craig Topper craig.topper at gmail.com
Mon Jul 25 21:43:10 PDT 2011


Ok I've removed the defaults that I could and removed the implicit
const conversion stuff.

~Craig

On Mon, Jul 25, 2011 at 9:16 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Jul 25, 2011, at 6:45 PM, Sean Hunt wrote:
>
>> On Mon, Jul 25, 2011 at 18:36, Craig Topper <craig.topper at gmail.com> wrote:
>>> As far as the const conversion for the new string literal types, gcc
>>> 4.5.2 allows it and throws a warning. Looks like the standard may
>>> consider these cases to be illegal now instead of deprecated for even
>>> the old cases.
>>>
>>> Google found this page which documents discussion on this topic. Look
>>> for "693. New string types and deprecated conversion "
>>> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n3007.html
>>>
>>> ~Craig
>>
>> I think we should follow the CWG's direction here. The reason it was
>> not added, even as a deprecated conversion, was to avoid people
>> relying on a brand new deprecated conversion which would make it more
>> difficult to remove later when it could have been nipped in the bud.
>> So for consistency, the deprecated conversion for char* was removed.
>> In my opinion, given that the committee decided on this specific
>> issue, we should follow the committee's direction and reject this
>> conversion, certainly for the new types but probably char* as well
>> given the committee's explicit decision in that regard (and update the
>> compatibility docs).
>
>
> I have a sinking feeling that rejecting the string literal to char* conversion is going to break a lot of existing code. We'll have to do it eventually, but we'll need *excellent* recovery when we do.
>
>        - Doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unicode_strings.patch
Type: application/octet-stream
Size: 78891 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110725/4046a5b4/attachment.obj>


More information about the cfe-dev mailing list