[PATCH] D30659: [clang-format] Make NamespaceEndCommentFixer add at most one comment

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 6 08:44:02 PST 2017


djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.

Would probably be interesting to add these test cases:

  #if A
  namespace A {
  #else
  namespace B {
  #endif
  int i;
  int j;
  }//namespace A

and:

  namespace A {
  int i;
  int j;
  #if A
  }//namespace A
  #else
  }//namespace A
  #endif



================
Comment at: lib/Format/NamespaceEndCommentsFixer.cpp:139
+    FormatToken *RBraceTok = EndLine->First;
+    if (RBraceTok->Finalized) continue;
+    RBraceTok->Finalized = true;
----------------
Use clang-format :). (there should be a linebreak before "continue".


https://reviews.llvm.org/D30659





More information about the cfe-commits mailing list