<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - two errors when clang-format.exe handle comments"
   href="https://llvm.org/bugs/show_bug.cgi?id=27092">27092</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>two errors when clang-format.exe handle comments
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows XP
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Formatter
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>akkaa@139.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>djasper@google.com, klimek@google.com, llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Format this code ten times use inplace format(-i) 
 use clang-format.exe in LLVM-3.9.0-r264047-win32.exe on Windows 7,
If the file is DOS mode(line end with \r\n), 
we will not get the same result.
If the file is Unix mode(line end with \n), it is ok.

// save to DOS file mode (line end with \r\n)
// install LLVM-3.9.0-r264047-win32.exe on Windows 7.
// command: clang-format.exe -style=llvm -i a.cpp

/*
 comment
*/      /* block comment end and begin at same line.
This line will move to right by 1 in each clang-format.exe process.
*/

#define MM() \
  foo(); \
  /* block comment line larger than 80 in macro, block comment line larger than
80 in macro, block comment line larger than 80 in macro */ \
  bar();

we will get:

// save to DOS file mode (line end with \r\n)
// install LLVM-3.9.0-r264047-win32.exe on Windows 7.
// command: clang-format.exe -style=llvm -i a.cpp

/*
 comment
*/ /* block comment end and begin at same line.
         This line will move to right by 1 in each clang-format.exe process.
         */

#define MM()                                                                  
\
  foo();                                                                      
\
  /* block comment line larger than 80 in macro, block comment line larger \ \
\
   * \                                                                        
\
   * \ \                                                                       
     \
   * \ \ \                                                                     
       \
   * \ \ \ \                                                                   
         \
   * \ \ \ \ \                                                                 
           \
   * \ \ \ \ \ \                                                               
             \
   * \ \ \ \ \ \ \                                                             
               \
   * than 80 in macro, block comment line larger than 80 in macro */          
\
  bar();</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>