aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-04-01 16:50:48 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-04-01 16:50:48 +0000
commit12c0ade49d0063fb651af56e8dda5597c5d780a8 (patch)
tree48feb0715052b1bafe1afb58496f2d516e23bf97 /lib/Sema/SemaTemplate.cpp
parentec700a6a301e49c8524c5da1b008f71bf7562e59 (diff)
Fix -Asserts warning, and protect against missing case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100115 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index 8e93fd876e..888fa062ea 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -4915,14 +4915,15 @@ Sema::ActOnDependentTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
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();
}