1- // RUN: %check_clang_tidy -std=c++11 %s modernize -use-cpp-style-comments %t -- --
1+ // RUN: %check_clang_tidy -std=c++11 %s readability -use-cpp-style-comments %t -- --
22
33// Single-line full C-style comment
44static const int CONSTANT = 42 ; /* Important constant value */
5- // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
5+ // CHECK-MESSAGES: :[[@LINE-1]]:33: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
66// CHECK-FIXES: static const int CONSTANT = 42; // Important constant value
77
88// Inline comment that should NOT be transformed
@@ -12,7 +12,7 @@ int a = /* inline comment */ 5;
1212/* This is a multiline comment
1313 that spans several lines
1414 and should be converted to C++ style */
15- // CHECK-MESSAGES: :[[@LINE-3]]:1: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
15+ // CHECK-MESSAGES: :[[@LINE-3]]:1: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
1616// CHECK-FIXES: // This is a multiline comment
1717// CHECK-FIXES: // that spans several lines
1818// CHECK-FIXES: // and should be converted to C++ style
@@ -29,40 +29,40 @@ void processData(int data /* input data */,
2929 * Block comment with asterisks
3030 * Should be converted to C++ style
3131 *******************************/
32- // CHECK-MESSAGES: :[[@LINE-4]]:1: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
32+ // CHECK-MESSAGES: :[[@LINE-4]]:1: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
3333// CHECK-FIXES: // ******************************
3434// CHECK-FIXES: // * Block comment with asterisks
3535// CHECK-FIXES: // * Should be converted to C++ style
3636// CHECK-FIXES: // ******************************
3737int calculateSomething () { return 1 ;}
3838// Comment at end of complex line
3939int complexCalculation = calculateSomething(); /* Result of complex calculation */
40- // CHECK-MESSAGES: :[[@LINE-1]]:48: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
40+ // CHECK-MESSAGES: :[[@LINE-1]]:48: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
4141// CHECK-FIXES: int complexCalculation = calculateSomething(); // Result of complex calculation
4242
4343// Nested comments and edge cases
4444void edgeCaseFunction () {
4545 int x = 10 /* First value */ + 20 /* Second value */ ; // Inline comments should not transform
4646
4747 /* Comment with special characters !@#$%^&*()_+ */
48- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
48+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
4949 // CHECK-FIXES: // Comment with special characters !@#$%^&*()_+
5050}
5151
5252// Multiline comment with various indentations
5353 /* This comment is indented
5454 and should preserve indentation when converted */
55- // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
55+ // CHECK-MESSAGES: :[[@LINE-2]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
5656// CHECK-FIXES: // This comment is indented
5757// CHECK-FIXES: // and should preserve indentation when converted
5858
5959// Complex function with mixed comment types
6060void complexFunction () {
6161 /* Full line comment at start of block */
62- // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
62+ // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
6363 // CHECK-FIXES: // Full line comment at start of block
6464
6565 int x = 10 ; /* Inline comment not to be transformed */
66- // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: use C++ style comments '//' instead of C style comments '/*...*/' [modernize -use-cpp-style-comments]
66+ // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: use C++ style comments '//' instead of C style comments '/*...*/' [readability -use-cpp-style-comments]
6767 // CHECK-FIXES: int x = 10; // Inline comment not to be transformed
68- }
68+ }
0 commit comments