@@ -48,7 +48,7 @@ bool ComparisonCategoryInfo::ValueInfo::hasValidIntValue() const {
48
48
49
49
// Before we attempt to get the value of the first field, ensure that we
50
50
// actually have one (and only one) field.
51
- auto *Record = VD->getType ()->getAsCXXRecordDecl ();
51
+ const auto *Record = VD->getType ()->getAsCXXRecordDecl ();
52
52
if (std::distance (Record->field_begin (), Record->field_end ()) != 1 ||
53
53
!Record->field_begin ()->getType ()->isIntegralOrEnumerationType ())
54
54
return false ;
@@ -98,13 +98,13 @@ static const NamespaceDecl *lookupStdNamespace(const ASTContext &Ctx,
98
98
return StdNS;
99
99
}
100
100
101
- static CXXRecordDecl *lookupCXXRecordDecl (const ASTContext &Ctx,
102
- const NamespaceDecl *StdNS,
103
- ComparisonCategoryType Kind) {
101
+ static const CXXRecordDecl *lookupCXXRecordDecl (const ASTContext &Ctx,
102
+ const NamespaceDecl *StdNS,
103
+ ComparisonCategoryType Kind) {
104
104
StringRef Name = ComparisonCategories::getCategoryString (Kind);
105
105
DeclContextLookupResult Lookup = StdNS->lookup (&Ctx.Idents .get (Name));
106
106
if (!Lookup.empty ())
107
- if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(Lookup.front ()))
107
+ if (const CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(Lookup.front ()))
108
108
return RD;
109
109
return nullptr ;
110
110
}
@@ -116,7 +116,7 @@ ComparisonCategories::lookupInfo(ComparisonCategoryType Kind) const {
116
116
return &It->second ;
117
117
118
118
if (const NamespaceDecl *NS = lookupStdNamespace (Ctx, StdNS))
119
- if (CXXRecordDecl *RD = lookupCXXRecordDecl (Ctx, NS, Kind))
119
+ if (const CXXRecordDecl *RD = lookupCXXRecordDecl (Ctx, NS, Kind))
120
120
return &Data.try_emplace ((char )Kind, Ctx, RD, Kind).first ->second ;
121
121
122
122
return nullptr ;
@@ -126,13 +126,13 @@ const ComparisonCategoryInfo *
126
126
ComparisonCategories::lookupInfoForType (QualType Ty) const {
127
127
assert (!Ty.isNull () && " type must be non-null" );
128
128
using CCT = ComparisonCategoryType;
129
- auto *RD = Ty->getAsCXXRecordDecl ();
129
+ const auto *RD = Ty->getAsCXXRecordDecl ();
130
130
if (!RD)
131
131
return nullptr ;
132
132
133
133
// Check to see if we have information for the specified type cached.
134
134
const auto *CanonRD = RD->getCanonicalDecl ();
135
- for (auto &KV : Data) {
135
+ for (const auto &KV : Data) {
136
136
const ComparisonCategoryInfo &Info = KV.second ;
137
137
if (CanonRD == Info.Record ->getCanonicalDecl ())
138
138
return &Info;
0 commit comments