[llvm-bugs] [Bug 26829] New: Feature specify new lines between namespace declarations

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Mar 3 05:06:23 PST 2016


https://llvm.org/bugs/show_bug.cgi?id=26829

            Bug ID: 26829
           Summary: Feature specify new lines between namespace
                    declarations
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang-format currently does not modify any of the following three examples,
that is, the user still needs to handle style by hand. It would be nice if this
would be fixed. 

Example 1:
namespace A {
namespace B {
namespace C {

}  // namespace C
}  // namespace B
}  // namespace A

Example 2:
namespace A {
namespace B {
namespace C {

}  // namespace C

}  // namespace B

}  // namespace A

Example 3:
namespace A {

namespace B {

namespace C {

}  // namespace C

}  // namespace B

}  // namespace A


For example I would always want no new lines between namespaces and enclosing
brackets like in Example A, but some people might want to follow example 3.

I also sometimes document a new namespace when I introduce it and would like it
to be separately spaced, for example:

namespace A { // already exists
namespace B { // already exists

/// New namespace for C stuff
namespace C {

}  // namespace C

}  // namespace B  
}  // namespace A

where I don't introduce any space between A and B, but leave a line in between
when documenting a new namespace and want that to be respected on the enclosing
bracket.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160303/3d60dbff/attachment.html>


More information about the llvm-bugs mailing list