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

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 3 12:06:26 PST 2024


================
@@ -34,9 +34,15 @@ const char *getTokenTypeName(TokenType Type) {
   return nullptr;
 }
 
+// Sorted common C++ non-keyword types.
+static SmallVector<StringRef> CppNonKeywordTypes = {
+    "byte",   "int16_t",  "int32_t",  "int64_t",  "int8_t",
+    "size_t", "uint16_t", "uint32_t", "uint64_t", "uint8_t",
----------------
owenca wrote:

I was aware of that. By “common” I mean common C-casted. We definitely don’t want to include POSIX-specific types as we have the TypeNames option for that. Also, we don’t want to cater to C-specific constructs if it might regress C++ code.

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


More information about the cfe-commits mailing list