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

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 3 10:54:33 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",
----------------
zygoloid wrote:

Does `byte` really belong here? It's not available as an unqualified name, only as `std::byte`. I could see an argument for including `nullptr_t` here because it is available unqualified, but even that seems a little hard to justify since I don't think people write that often. I also expect people use `byte` as a variable name frequently; the same doesn't seem to be true for these other names.

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


More information about the cfe-commits mailing list