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

Douglas Gregor dgregor at apple.com
Mon Jul 25 12:44:28 PDT 2011


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