JonasToth updated this revision to Diff 167917. JonasToth added a comment. - adjust regex in check_clang_tidy
Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D52691 Files: test/clang-tidy/check_clang_tidy.py test/clang-tidy/performance-move-constructor-init.cpp Index: test/clang-tidy/performance-move-constructor-init.cpp =================================================================== --- test/clang-tidy/performance-move-constructor-init.cpp +++ test/clang-tidy/performance-move-constructor-init.cpp @@ -5,7 +5,7 @@ #include <s.h> -// CHECK-FIXES: #include <utility> +// CHECK FIXES: #include <utility> template <class T> struct remove_reference {typedef T type;}; template <class T> struct remove_reference<T&> {typedef T type;}; @@ -30,9 +30,9 @@ struct D : B { D() : B() {} D(const D &RHS) : B(RHS) {} - // CHECK-MESSAGES: :[[@LINE+3]]:16: warning: move constructor initializes base class by calling a copy constructor [performance-move-constructor-init] - // CHECK-MESSAGES: 26:3: note: copy constructor being called - // CHECK-MESSAGES: 27:3: note: candidate move constructor here + // CHECK-NOTES: :[[@LINE+3]]:16: warning: move constructor initializes base class by calling a copy constructor [performance-move-constructor-init] + // CHECK-NOTES: 26:3: note: copy constructor being called + // CHECK-NOTES: 27:3: note: candidate move constructor here D(D &&RHS) : B(RHS) {} }; @@ -75,8 +75,10 @@ struct M { B Mem; - // CHECK-MESSAGES: :[[@LINE+1]]:16: warning: move constructor initializes class member by calling a copy constructor [performance-move-constructor-init] + // CHECK-NOTES: :[[@LINE+1]]:16: warning: move constructor initializes class member by calling a copy constructor [performance-move-constructor-init] M(M &&RHS) : Mem(RHS.Mem) {} + // CHECK-NOTES: 26:3: note: copy constructor being called + // CHECK-NOTES: 27:3: note: candidate move constructor here }; struct N { @@ -109,7 +111,7 @@ struct Positive { Positive(Movable M) : M_(M) {} - // CHECK-MESSAGES: [[@LINE-1]]:12: warning: pass by value and use std::move [modernize-pass-by-value] + // CHECK-NOTES: [[@LINE-1]]:12: warning: pass by value and use std::move [modernize-pass-by-value] // CHECK-FIXES: Positive(Movable M) : M_(std::move(M)) {} Movable M_; }; Index: test/clang-tidy/check_clang_tidy.py =================================================================== --- test/clang-tidy/check_clang_tidy.py +++ test/clang-tidy/check_clang_tidy.py @@ -169,7 +169,7 @@ subprocess.check_output( ['FileCheck', '-input-file=' + notes_file, input_file_name, '-check-prefix=' + check_notes_prefix, - '-implicit-check-not={{note|warning|error}}:'], + '-implicit-check-not={{{{warning|error}}:|note: (?!FIX-IT)}}'], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: print('FileCheck failed:\n' + e.output.decode())
Index: test/clang-tidy/performance-move-constructor-init.cpp =================================================================== --- test/clang-tidy/performance-move-constructor-init.cpp +++ test/clang-tidy/performance-move-constructor-init.cpp @@ -5,7 +5,7 @@ #include <s.h> -// CHECK-FIXES: #include <utility> +// CHECK FIXES: #include <utility> template <class T> struct remove_reference {typedef T type;}; template <class T> struct remove_reference<T&> {typedef T type;}; @@ -30,9 +30,9 @@ struct D : B { D() : B() {} D(const D &RHS) : B(RHS) {} - // CHECK-MESSAGES: :[[@LINE+3]]:16: warning: move constructor initializes base class by calling a copy constructor [performance-move-constructor-init] - // CHECK-MESSAGES: 26:3: note: copy constructor being called - // CHECK-MESSAGES: 27:3: note: candidate move constructor here + // CHECK-NOTES: :[[@LINE+3]]:16: warning: move constructor initializes base class by calling a copy constructor [performance-move-constructor-init] + // CHECK-NOTES: 26:3: note: copy constructor being called + // CHECK-NOTES: 27:3: note: candidate move constructor here D(D &&RHS) : B(RHS) {} }; @@ -75,8 +75,10 @@ struct M { B Mem; - // CHECK-MESSAGES: :[[@LINE+1]]:16: warning: move constructor initializes class member by calling a copy constructor [performance-move-constructor-init] + // CHECK-NOTES: :[[@LINE+1]]:16: warning: move constructor initializes class member by calling a copy constructor [performance-move-constructor-init] M(M &&RHS) : Mem(RHS.Mem) {} + // CHECK-NOTES: 26:3: note: copy constructor being called + // CHECK-NOTES: 27:3: note: candidate move constructor here }; struct N { @@ -109,7 +111,7 @@ struct Positive { Positive(Movable M) : M_(M) {} - // CHECK-MESSAGES: [[@LINE-1]]:12: warning: pass by value and use std::move [modernize-pass-by-value] + // CHECK-NOTES: [[@LINE-1]]:12: warning: pass by value and use std::move [modernize-pass-by-value] // CHECK-FIXES: Positive(Movable M) : M_(std::move(M)) {} Movable M_; }; Index: test/clang-tidy/check_clang_tidy.py =================================================================== --- test/clang-tidy/check_clang_tidy.py +++ test/clang-tidy/check_clang_tidy.py @@ -169,7 +169,7 @@ subprocess.check_output( ['FileCheck', '-input-file=' + notes_file, input_file_name, '-check-prefix=' + check_notes_prefix, - '-implicit-check-not={{note|warning|error}}:'], + '-implicit-check-not={{{{warning|error}}:|note: (?!FIX-IT)}}'], stderr=subprocess.STDOUT) except subprocess.CalledProcessError as e: print('FileCheck failed:\n' + e.output.decode())
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits