Silence uninitialized value warning in Release build.

llvm-svn: 52376
This commit is contained in:
Ted Kremenek 2008-06-16 23:46:27 +00:00
parent bba87243aa
commit 1c77e8f26b
1 changed files with 5 additions and 4 deletions

View File

@ -31,10 +31,11 @@ CXXRecordDecl *CXXRecordDecl::Create(ASTContext &C, TagKind TK, DeclContext *DC,
ScopedDecl *PrevDecl) {
Kind DK;
switch (TK) {
case TK_enum: assert(0 && "Enum TagKind passed for Record!");
case TK_struct: DK = CXXStruct; break;
case TK_union: DK = CXXUnion; break;
case TK_class: DK = CXXClass; break;
default: assert(0 && "Invalid TagKind!");
case TK_enum: assert(0 && "Enum TagKind passed for Record!");
case TK_struct: DK = CXXStruct; break;
case TK_union: DK = CXXUnion; break;
case TK_class: DK = CXXClass; break;
}
void *Mem = C.getAllocator().Allocate<CXXRecordDecl>();
return new (Mem) CXXRecordDecl(DK, DC, L, Id, PrevDecl);