[clang] [clang-format] Harden annotation of operator keywords (PR #196768)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 10 23:19:18 PDT 2026


================
@@ -1208,6 +1208,9 @@ TEST_F(TokenAnnotatorTest, UnderstandsOverloadedOperators) {
   ASSERT_EQ(Tokens.size(), 9u) << Tokens;
   // Not TT_FunctionDeclarationName.
   EXPECT_TOKEN(Tokens[2], tok::kw_operator, TT_Unknown);
+
+  // Verify we don't crash.
+  annotate("operator foo*;");
----------------
owenca wrote:

```suggestion
  annotate("operator foo *;");
```

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


More information about the cfe-commits mailing list