From e194710fcd012df67a2694477ef8ce5a19bf376c Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 1 May 2011 07:23:20 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130645 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/StmtPrinter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 8380e396eb..72d71d3f13 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -1293,7 +1293,6 @@ void StmtPrinter::VisitUnresolvedMemberExpr(UnresolvedMemberExpr *Node) { 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 @@ static const char *getTypeTraitName(UnaryTypeTrait UTT) { 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 @@ static const char *getTypeTraitName(UnaryTypeTrait UTT) { 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) { -- 2.40.0