[cfe-commits] r62245 - in /cfe/trunk: lib/Sema/CMakeLists.txt lib/Sema/IdentifierResolver.h lib/Sema/Sema.h lib/Sema/SemaCXXScopeSpec.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprCXX.cpp lib/Sema/SemaLookup.cpp test/Parser/cxx-using-directive.cpp test/SemaCXX/qualified-id-lookup.cpp

Chris Lattner clattner at apple.com
Fri Jan 16 13:15:07 PST 2009


On Jan 16, 2009, at 12:50 PM, Douglas Gregor wrote:
>>> My complaint about putting a default: in there still stands: it  
>>> suppresses a useful warning, where we've omitted a case, and turns  
>>> it into a run-time failure.
>>
>> Does GCC produce a warning for cases like:
>>
>> int foo() {
>> switch (someenum) {
>> case <all possible enums>:
>>   return 0;
>> }
>> // no return
>> }
>>
>> About falling off the end of the function?
>
> Yeah, it does.

That's bad.  Can we just use default: assert(0) in those cases?

-Chris



More information about the cfe-commits mailing list