[cfe-commits] r130645 - /cfe/trunk/lib/AST/StmtPrinter.cpp
Chandler Carruth
chandlerc at gmail.com
Sun May 1 00:23:20 PDT 2011
Author: chandlerc
Date: Sun May 1 02:23:20 2011
New Revision: 130645
URL: http://llvm.org/viewvc/llvm-project?rev=130645&view=rev
Log:
Remove another default and a *completely* bogus return from a switch
over type traits.
Add the missing trait from this switch that Clang's warning uncovered.
Modified:
cfe/trunk/lib/AST/StmtPrinter.cpp
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=130645&r1=130644&r2=130645&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Sun May 1 02:23:20 2011
@@ -1293,7 +1293,6 @@
static const char *getTypeTraitName(UnaryTypeTrait UTT) {
switch (UTT) {
- default: assert(false && "Unknown type trait");
case UTT_HasNothrowAssign: return "__has_nothrow_assign";
case UTT_HasNothrowConstructor: return "__has_nothrow_constructor";
case UTT_HasNothrowCopy: return "__has_nothrow_copy";
@@ -1315,6 +1314,7 @@
case UTT_IsFunction: return "__is_function";
case UTT_IsFundamental: return "__is_fundamental";
case UTT_IsIntegral: return "__is_integral";
+ case UTT_IsLiteral: return "__is_literal";
case UTT_IsLvalueReference: return "__is_lvalue_reference";
case UTT_IsMemberFunctionPointer: return "__is_member_function_pointer";
case UTT_IsMemberObjectPointer: return "__is_member_object_pointer";
@@ -1334,7 +1334,7 @@
case UTT_IsVoid: return "__is_void";
case UTT_IsVolatile: return "__is_volatile";
}
- return "";
+ llvm_unreachable("Type trait not covered by switch statement");
}
static const char *getTypeTraitName(BinaryTypeTrait BTT) {
More information about the cfe-commits
mailing list