[PATCH] D75856: [clang-format] cleanup from D75517

Jonathan B Coe via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 10:14:20 PDT 2020


jbcoe updated this revision to Diff 249148.

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

https://reviews.llvm.org/D75856

Files:
  clang/lib/Format/TokenAnnotator.cpp
  clang/unittests/Format/FormatTestCSharp.cpp


Index: clang/unittests/Format/FormatTestCSharp.cpp
===================================================================
--- clang/unittests/Format/FormatTestCSharp.cpp
+++ clang/unittests/Format/FormatTestCSharp.cpp
@@ -650,8 +650,15 @@
   FormatStyle Style = getGoogleStyle(FormatStyle::LK_CSharp);
 
   // Do not format array subscript operators as attributes.
-  verifyFormat(R"(if (someThings[index].Contains(myThing)) {)", Style);
-  verifyFormat(R"(if (someThings[i][j][k].Contains(myThing)) {)", Style);
+  verifyFormat(R"(//
+if (someThings[index].Contains(myThing)) {
+})",
+               Style);
+
+  verifyFormat(R"(//
+if (someThings[i][j][k].Contains(myThing)) {
+})",
+               Style);
 }
 
 } // namespace format
Index: clang/lib/Format/TokenAnnotator.cpp
===================================================================
--- clang/lib/Format/TokenAnnotator.cpp
+++ clang/lib/Format/TokenAnnotator.cpp
@@ -373,7 +373,7 @@
     if (Tok.Previous && Tok.Previous->is(tok::identifier))
       return false;
 
-    // Chains [] in of `identifier[i][j][k]` are not attributes.
+    // Chains of [] in `identifier[i][j][k]` are not attributes.
     if (Tok.Previous && Tok.Previous->is(tok::r_square)) {
       auto *MatchingParen = Tok.Previous->MatchingParen;
       if (!MatchingParen || MatchingParen->is(TT_ArraySubscriptLSquare))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75856.249148.patch
Type: text/x-patch
Size: 1352 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200309/70354535/attachment.bin>


More information about the cfe-commits mailing list