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

Craig Topper craig.topper at gmail.com
Mon Jul 25 18:36:52 PDT 2011


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


On Mon, Jul 25, 2011 at 12:44 PM, Douglas Gregor <dgregor at apple.com> wrote:
>
> On Jul 25, 2011, at 12:14 PM, Sean Hunt wrote:
>
>> On Mon, Jul 25, 2011 at 11:44, Douglas Gregor <dgregor at apple.com> wrote:
>>> Also, please remove the 'default' case; it's enough that the switch statement is exhaustive.
>>
>> What if the value is outside the range of enumerators? This could
>> certainly happen due to, say, a PCH bug.
>
> In that case, we'd find it and fix PCH.
>
>> I would point out that we
>> prefer llvm_unreachable for impossible cases though. In either case,
>> there ought to be no real cost since this will all get elided in
>> release mode.
>
>
> If you leave the 'default' case in there, it silences warnings about missing enumerators when switching on an enum type. That's Very Very Bad.
>
>        - Doug
>




More information about the cfe-dev mailing list