[clang-format][NFC] Add is_sorted() assertion for binary_search()
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 68e9618..24a36d9 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -3158,6 +3158,7 @@
"UIImage",
"UIView",
};
+ assert(llvm::is_sorted(FoundationIdentifiers));
for (auto *Line : AnnotatedLines) {
if (Line->First && (Line->First->TokenText.starts_with("#") ||
diff --git a/clang/lib/Format/FormatToken.cpp b/clang/lib/Format/FormatToken.cpp
index 0d8ae1c..9c98b78 100644
--- a/clang/lib/Format/FormatToken.cpp
+++ b/clang/lib/Format/FormatToken.cpp
@@ -43,6 +43,7 @@
bool FormatToken::isTypeName(const LangOptions &LangOpts) const {
if (is(TT_TypeName) || Tok.isSimpleTypeSpecifier(LangOpts))
return true;
+ assert(llvm::is_sorted(CppNonKeywordTypes));
return (LangOpts.CXXOperatorNames || LangOpts.C11) && is(tok::identifier) &&
llvm::binary_search(CppNonKeywordTypes, TokenText);
}