This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Support namespaces ending in semicolon
ClosedPublic

Authored by krasimir on Mar 7 2017, 2:26 AM.

Details

Summary

This patch adds support for namespaces ending in semicolon to the namespace comment fixer.
source:

namespace A {
  int i;
  int j;
};

clang-format before:

namespace A {
  int i;
  int j;
} // namespace A;

clang-format after:

namespace A {
  int i;
  int j;
}; // namespace A

Diff Detail

Repository
rL LLVM

Event Timeline

krasimir created this revision.Mar 7 2017, 2:26 AM
krasimir edited the summary of this revision. (Show Details)Mar 7 2017, 2:28 AM
krasimir added a reviewer: djasper.
krasimir added a subscriber: cfe-commits.
djasper accepted this revision.Mar 7 2017, 6:12 AM

Minor nit, otherwise looks good.

lib/Format/NamespaceEndCommentsFixer.cpp
152 ↗(On Diff #90826)

No braces around single-statement ifs.

This revision is now accepted and ready to land.Mar 7 2017, 6:12 AM
krasimir updated this revision to Diff 90839.Mar 7 2017, 6:18 AM
  • Remove braces
This revision was automatically updated to reflect the committed changes.