[llvm-branch-commits] [clang-tools-extra] [clang-doc][nfc] Declare pointer with auto explicitly (PR #198069)

Paul Kirth via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 15 23:57:24 PDT 2026


https://github.com/ilovepi created https://github.com/llvm/llvm-project/pull/198069

This silences some errors from clang-tidy.

>From 8fb34c01d06ba3bb25656b8bf4b93b08a42b33d5 Mon Sep 17 00:00:00 2001
From: Paul Kirth <paulkirth at google.com>
Date: Sat, 16 May 2026 01:37:45 +0000
Subject: [PATCH] [clang-doc][nfc] Declare pointer with auto explicitly

This silences some errors from clang-tidy.
---
 clang-tools-extra/clang-doc/Serialize.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clang-doc/Serialize.cpp b/clang-tools-extra/clang-doc/Serialize.cpp
index 906bde99349cf..f19b8da83e46b 100644
--- a/clang-tools-extra/clang-doc/Serialize.cpp
+++ b/clang-tools-extra/clang-doc/Serialize.cpp
@@ -509,20 +509,20 @@ template <typename ChildType>
 OwnedPtr<Info> Serializer::makeAndInsertIntoParent(ChildType &Child) {
   if (Child.Namespace.empty()) {
     // Insert into unnamed parent namespace.
-    auto ParentNS = allocatePtr<NamespaceInfo>();
+    auto *ParentNS = allocatePtr<NamespaceInfo>();
     InsertChild(ParentNS->Children, Child);
     return ParentNS;
   }
 
   switch (Child.Namespace[0].RefType) {
   case InfoType::IT_namespace: {
-    auto ParentNS = allocatePtr<NamespaceInfo>();
+    auto *ParentNS = allocatePtr<NamespaceInfo>();
     ParentNS->USR = Child.Namespace[0].USR;
     InsertChild(ParentNS->Children, Child);
     return ParentNS;
   }
   case InfoType::IT_record: {
-    auto ParentRec = allocatePtr<RecordInfo>();
+    auto *ParentRec = allocatePtr<RecordInfo>();
     ParentRec->USR = Child.Namespace[0].USR;
     InsertChild(ParentRec->Children, Child);
     return ParentRec;
@@ -1009,7 +1009,7 @@ void Serializer::parseBases(llvm::SmallVectorImpl<BaseRecordInfo> &Bases,
 std::pair<OwnedPtr<Info>, OwnedPtr<Info>>
 Serializer::emitInfo(const NamespaceDecl *D, const FullComment *FC,
                      Location Loc, bool PublicOnly) {
-  auto NSI = allocatePtr<NamespaceInfo>();
+  auto *NSI = allocatePtr<NamespaceInfo>();
   bool IsInAnonymousNamespace = false;
   populateInfo(*NSI, D, FC, IsInAnonymousNamespace);
   if (!shouldSerializeInfo(PublicOnly, IsInAnonymousNamespace, D))
@@ -1085,7 +1085,7 @@ std::pair<OwnedPtr<Info>, OwnedPtr<Info>>
 Serializer::emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc,
                      bool PublicOnly) {
 
-  auto RI = allocatePtr<RecordInfo>();
+  auto *RI = allocatePtr<RecordInfo>();
   bool IsInAnonymousNamespace = false;
 
   populateSymbolInfo(*RI, D, FC, Loc, IsInAnonymousNamespace);
@@ -1161,7 +1161,7 @@ Serializer::emitInfo(const RecordDecl *D, const FullComment *FC, Location Loc,
 
   // Records are inserted into the parent by reference, so we need to return
   // both the parent and the record itself.
-  auto Parent = makeAndInsertIntoParent<const RecordInfo &>(*RI);
+  auto *Parent = makeAndInsertIntoParent<const RecordInfo &>(*RI);
   return {std::move(RI), std::move(Parent)};
 }
 



More information about the llvm-branch-commits mailing list