diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index d50ab8310b07..d97cf810baf9 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -298,9 +298,7 @@ void PCHDeclReader::VisitObjCCategoryDecl(ObjCCategoryDecl *CD) { for (unsigned I = 0; I != NumProtoRefs; ++I) ProtoRefs.push_back(cast(Reader.GetDecl(Record[Idx++]))); CD->setProtocolList(&ProtoRefs[0], NumProtoRefs, Reader.getContext()); - unsigned nextCat = Record[Idx++]; - CD->setNextClassCategory(nextCat ? - cast(Reader.GetDecl(nextCat)) : 0); + CD->setNextClassCategory(cast_or_null(Reader.GetDecl(Record[Idx++]))); CD->setLocEnd(SourceLocation::getFromRawEncoding(Record[Idx++])); }