[cfe-commits] r121084 - in /cfe/trunk/lib: AST/StmtPrinter.cpp Parse/ParseExprCXX.cpp
Francois Pichet
pichet2000 at gmail.com
Mon Dec 6 16:55:57 PST 2010
Author: fpichet
Date: Mon Dec 6 18:55:57 2010
New Revision: 121084
URL: http://llvm.org/viewvc/llvm-project?rev=121084&view=rev
Log:
Fix enumerator not handled in switch warnings.
Modified:
cfe/trunk/lib/AST/StmtPrinter.cpp
cfe/trunk/lib/Parse/ParseExprCXX.cpp
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=121084&r1=121083&r2=121084&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Mon Dec 6 18:55:57 2010
@@ -1206,6 +1206,7 @@
static const char *getTypeTraitName(UnaryTypeTrait UTT) {
switch (UTT) {
+ default: llvm_unreachable("Unknown unary type trait");
case UTT_HasNothrowAssign: return "__has_nothrow_assign";
case UTT_HasNothrowCopy: return "__has_nothrow_copy";
case UTT_HasNothrowConstructor: return "__has_nothrow_constructor";
@@ -1222,15 +1223,14 @@
case UTT_IsPolymorphic: return "__is_polymorphic";
case UTT_IsUnion: return "__is_union";
}
- llvm_unreachable("Unknown unary type trait");
return "";
}
static const char *getTypeTraitName(BinaryTypeTrait BTT) {
switch (BTT) {
+ default: llvm_unreachable("Unknown binary type trait");
case BTT_IsBaseOf: return "__is_base_of";
}
- llvm_unreachable("Unknown binary type trait");
return "";
}
Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=121084&r1=121083&r2=121084&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Mon Dec 6 18:55:57 2010
@@ -1800,6 +1800,7 @@
static UnaryTypeTrait UnaryTypeTraitFromTokKind(tok::TokenKind kind) {
switch(kind) {
+ default: llvm_unreachable("Not a known unary type trait");
case tok::kw___has_nothrow_assign: return UTT_HasNothrowAssign;
case tok::kw___has_nothrow_copy: return UTT_HasNothrowCopy;
case tok::kw___has_nothrow_constructor: return UTT_HasNothrowConstructor;
@@ -1817,14 +1818,13 @@
case tok::kw___is_union: return UTT_IsUnion;
case tok::kw___is_literal: return UTT_IsLiteral;
}
- llvm_unreachable("Not a known unary type trait");
}
static BinaryTypeTrait BinaryTypeTraitFromTokKind(tok::TokenKind kind) {
switch(kind) {
+ default: llvm_unreachable("Not a known binary type trait");
case tok::kw___is_base_of: return BTT_IsBaseOf;
}
- llvm_unreachable("Not a known binary type trait");
}
/// ParseUnaryTypeTrait - Parse the built-in unary type-trait
More information about the cfe-commits
mailing list