Skip to content

Commit d08bc0f

Browse files
hokeinyuxuanchen1997
authored andcommitted
[clang] Add the const to all default lists in SemaAttr.cpp, NFC
Summary: Address the comment in #99622 (comment) Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251273
1 parent e1abf2c commit d08bc0f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

clang/lib/Sema/SemaAttr.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void Sema::inferGslPointerAttribute(NamedDecl *ND,
117117
if (!Parent)
118118
return;
119119

120-
static llvm::StringSet<> Containers{
120+
static const llvm::StringSet<> Containers{
121121
"array",
122122
"basic_string",
123123
"deque",
@@ -137,9 +137,9 @@ void Sema::inferGslPointerAttribute(NamedDecl *ND,
137137
"unordered_multimap",
138138
};
139139

140-
static llvm::StringSet<> Iterators{"iterator", "const_iterator",
141-
"reverse_iterator",
142-
"const_reverse_iterator"};
140+
static const llvm::StringSet<> Iterators{"iterator", "const_iterator",
141+
"reverse_iterator",
142+
"const_reverse_iterator"};
143143

144144
if (Parent->isInStdNamespace() && Iterators.count(ND->getName()) &&
145145
Containers.count(Parent->getName()))
@@ -165,7 +165,7 @@ void Sema::inferGslPointerAttribute(TypedefNameDecl *TD) {
165165
}
166166

167167
void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) {
168-
static llvm::StringSet<> StdOwners{
168+
static const llvm::StringSet<> StdOwners{
169169
"any",
170170
"array",
171171
"basic_regex",
@@ -189,7 +189,7 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) {
189189
"unordered_multimap",
190190
"variant",
191191
};
192-
static llvm::StringSet<> StdPointers{
192+
static const llvm::StringSet<> StdPointers{
193193
"basic_string_view",
194194
"reference_wrapper",
195195
"regex_iterator",
@@ -217,7 +217,7 @@ void Sema::inferGslOwnerPointerAttribute(CXXRecordDecl *Record) {
217217
}
218218

219219
void Sema::inferNullableClassAttribute(CXXRecordDecl *CRD) {
220-
static llvm::StringSet<> Nullable{
220+
static const llvm::StringSet<> Nullable{
221221
"auto_ptr", "shared_ptr", "unique_ptr", "exception_ptr",
222222
"coroutine_handle", "function", "move_only_function",
223223
};

0 commit comments

Comments
 (0)