Index: clang-tools-extra/clang-doc/Serialize.cpp =================================================================== --- clang-tools-extra/clang-doc/Serialize.cpp +++ clang-tools-extra/clang-doc/Serialize.cpp @@ -327,9 +327,10 @@ if (PublicOnly && ((D->isAnonymousNamespace()) || !isPublic(D->getAccess(), D->getLinkageInternal()))) return nullptr; - auto I = llvm::make_unique(); + std::unique_ptr IPtr = llvm::make_unique(); + NamespaceInfo *I = static_cast(IPtr.get()); populateInfo(*I, D, FC); - return I; + return IPtr; } std::unique_ptr emitInfo(const RecordDecl *D, const FullComment *FC, @@ -337,13 +338,14 @@ bool PublicOnly) { if (PublicOnly && !isPublic(D->getAccess(), D->getLinkageInternal())) return nullptr; - auto I = llvm::make_unique(); + std::unique_ptr IPtr = llvm::make_unique(); + RecordInfo *I = static_cast(IPtr.get()); populateSymbolInfo(*I, D, FC, LineNumber, File); I->TagType = D->getTagKind(); parseFields(*I, D, PublicOnly); if (const auto *C = dyn_cast(D)) parseBases(*I, C); - return I; + return IPtr; } std::unique_ptr emitInfo(const FunctionDecl *D, const FullComment *FC, @@ -356,13 +358,14 @@ Func.Access = clang::AccessSpecifier::AS_none; // Wrap in enclosing scope - auto I = llvm::make_unique(); + std::unique_ptr IPtr = llvm::make_unique(); + NamespaceInfo *I = static_cast(IPtr.get()); if (!Func.Namespace.empty()) I->USR = Func.Namespace[0].USR; else I->USR = SymbolID(); I->ChildFunctions.push_back(std::move(Func)); - return I; + return IPtr; } std::unique_ptr emitInfo(const CXXMethodDecl *D, const FullComment *FC, @@ -380,10 +383,11 @@ Func.Access = D->getAccess(); // Wrap in enclosing scope - auto I = llvm::make_unique(); + std::unique_ptr IPtr = llvm::make_unique(); + RecordInfo *I = static_cast(IPtr.get()); I->USR = ParentUSR; I->ChildFunctions.push_back(std::move(Func)); - return I; + return IPtr; } std::unique_ptr emitInfo(const EnumDecl *D, const FullComment *FC, @@ -419,10 +423,11 @@ } // Put in global namespace - auto I = llvm::make_unique(); + std::unique_ptr IPtr = llvm::make_unique(); + NamespaceInfo *I = static_cast(IPtr.get()); I->USR = SymbolID(); I->ChildEnums.push_back(std::move(Enum)); - return I; + return IPtr; } } // namespace serialize