diff --git a/clang-tools-extra/clang-tidy/GlobList.cpp b/clang-tools-extra/clang-tidy/GlobList.cpp index 88e6ea22d675c7..5b70b8d8c57718 100644 --- a/clang-tools-extra/clang-tidy/GlobList.cpp +++ b/clang-tools-extra/clang-tidy/GlobList.cpp @@ -52,7 +52,7 @@ GlobList::GlobList(StringRef Globs) { } while (!Globs.empty()); } -bool GlobList::contains(StringRef S) { +bool GlobList::contains(StringRef S) const { // Iterating the container backwards as the last match determins if S is in // the list. for (const GlobListItem &Item : llvm::reverse(Items)) { diff --git a/clang-tools-extra/clang-tidy/GlobList.h b/clang-tools-extra/clang-tidy/GlobList.h index 5acb6a5b878cbb..fe68a3497c92ab 100644 --- a/clang-tools-extra/clang-tidy/GlobList.h +++ b/clang-tools-extra/clang-tidy/GlobList.h @@ -33,7 +33,7 @@ class GlobList { /// Returns \c true if the pattern matches \p S. The result is the last /// matching glob's Positive flag. - bool contains(StringRef S); + bool contains(StringRef S) const; private: