[cfe-commits] r100115 - /cfe/trunk/lib/Sema/SemaTemplate.cpp
Daniel Dunbar
daniel at zuster.org
Thu Apr 1 09:50:48 PDT 2010
Author: ddunbar
Date: Thu Apr 1 11:50:48 2010
New Revision: 100115
URL: http://llvm.org/viewvc/llvm-project?rev=100115&view=rev
Log:
Fix -Asserts warning, and protect against missing case.
Modified:
cfe/trunk/lib/Sema/SemaTemplate.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=100115&r1=100114&r2=100115&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Thu Apr 1 11:50:48 2010
@@ -4915,14 +4915,15 @@
if (!NNS)
return true;
- ElaboratedTypeKeyword Keyword;
+ ElaboratedTypeKeyword Keyword = ETK_None;
switch (TagDecl::getTagKindForTypeSpec(TagSpec)) {
case TagDecl::TK_struct: Keyword = ETK_Struct; break;
case TagDecl::TK_class: Keyword = ETK_Class; break;
case TagDecl::TK_union: Keyword = ETK_Union; break;
case TagDecl::TK_enum: Keyword = ETK_Enum; break;
}
-
+ assert(Keyword != ETK_None && "Invalid tag kind!");
+
return Context.getDependentNameType(Keyword, NNS, Name).getAsOpaquePtr();
}
More information about the cfe-commits
mailing list