[PATCH] D32480: clang-format: Add CompactNamespaces option

Francois Ferrand via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 23 04:40:14 PDT 2017

Typz added a comment.

Just to be clear: as it is, the patch does not implement what you describe, both on the 'indent' side (as expected, we are discussing it), but also on the "merging" of braces side. Consecutive namespace opening are merged on one side; and consecutive namespace closing are merged on the other side; but there is no relation between the two.

What this means is that at the moment your exemple would be formatted (without indent) like this:

  namespace A { namespace B {
  int i;
  namespace C {
  int j;
  }}} // namespace A::B::C


More information about the cfe-commits mailing list