[llvm-bugs] [Bug 31911] New: newline between comments and preprocessor directive doesn't stop clang-format from lining comment up with preprocessor directive

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Feb 8 20:23:36 PST 2017


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

            Bug ID: 31911
           Summary: newline between comments and preprocessor directive
                    doesn't stop clang-format from lining comment up with
                    preprocessor directive
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dcheng at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Based on the comments in
https://bugs.chromium.org/p/chromium/issues/detail?id=369454, I'm under the
impression that separating a comment block from a preprocessor directive by a
newline should prevent from being lined up with the preprocessor directive, but
that doesn't appear to work.

Input:
int F() {
  // Should be in column 2.

#define X
  return 0;
}

int G() {
  // Should be in column 0.
#define Y
  return 0;
}

Output:
int F() {
// Should be in column 2.

#define X
  return 0;
}

int G() {
// Should be in column 0.
#define Y
  return 0;
}

-- 
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/20170209/64600c27/attachment.html>


More information about the llvm-bugs mailing list