[PATCH] D148473: [clang-format] C# short ternary operator misinterpreted as a CSharpNullable

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 16 12:05:55 PDT 2023


HazardyKnusperkeks accepted this revision.
HazardyKnusperkeks added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clang/lib/Format/TokenAnnotator.cpp:1338-1342
+        if (!Contexts.back().IsExpression && Line.MustBeDeclaration &&
+            !(Tok->Next &&
+              Tok->Next->isOneOf(tok::identifier, tok::string_literal) &&
+              Tok->Next->Next &&
+              Tok->Next->Next->isOneOf(tok::colon, tok::question))) {
----------------
Even if there are more negations, I can read this better.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148473/new/

https://reviews.llvm.org/D148473



More information about the cfe-commits mailing list