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

            Bug ID: 27092
           Summary: two errors when clang-format.exe handle comments
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

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();

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

Reply via email to