[clang] [clang-format] Handle common C++ non-keyword types as such (PR #83709)

via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 5 03:27:29 PST 2024


================
@@ -71,8 +71,21 @@ bool FormatToken::isSimpleTypeSpecifier() const {
   }
 }
 
-bool FormatToken::isTypeOrIdentifier() const {
-  return isSimpleTypeSpecifier() || Tok.isOneOf(tok::kw_auto, tok::identifier);
+// Sorted common C++ non-keyword types.
+static SmallVector<StringRef> CppNonKeywordTypes = {
+    "int16_t",  "int32_t",  "int64_t",  "int8_t",  "intptr_t",  "size_t",
----------------
mydeveloperday wrote:

ssize_t too? should everything be considered? https://en.cppreference.com/w/cpp/types/integer

https://github.com/llvm/llvm-project/pull/83709


More information about the cfe-commits mailing list