fix bogus warnings about potentially uninit vars Size and Align.
Patch by Neil Booth!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40452 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/AST/ASTContext.cpp b/AST/ASTContext.cpp
index 3e1f32d..a9fb81f 100644
--- a/AST/ASTContext.cpp
+++ b/AST/ASTContext.cpp
@@ -227,14 +227,14 @@
break;
}
case Type::Tagged:
- if (RecordType *RT = dyn_cast<RecordType>(cast<TagType>(T))) {
- const RecordLayout &Layout = getRecordLayout(RT->getDecl(), L);
- Size = Layout.getSize();
- Align = Layout.getAlignment();
- break;
- }
- // FIXME: Handle enums.
- assert(0 && "Unimplemented type sizes!");
+ RecordType *RT = dyn_cast<RecordType>(cast<TagType>(T));
+ if (!RT)
+ // FIXME: Handle enums.
+ assert(0 && "Unimplemented type sizes!");
+ const RecordLayout &Layout = getRecordLayout(RT->getDecl(), L);
+ Size = Layout.getSize();
+ Align = Layout.getAlignment();
+ break;
}
assert(Align && (Align & (Align-1)) == 0 && "Alignment must be power of 2");