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

            Bug ID: 45657
           Summary: Bad comment indentation before ifdef after braceless
                    if
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]

Example input:

$ cat /tmp/a.cc
void f() {
  if (foo)
    bar();
  // Comment
#if BAZ
  baz();
#endif
}

Example output:

$ bin/clang-format < /tmp/a.cc
void f() {
  if (foo)
    bar();
    // Comment
#if BAZ
  baz();
#endif
}

Note that the comment is now overly indented. Inserting a new line after
"baz()" doesn't change it.

(I was using clang-format built from d254b50b2b5b22368780c6003c419ffa1e23fa93)

This was originally filed in Chromium:
https://bugs.chromium.org/p/chromium/issues/detail?id=1074113

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to