[PATCH] D52691: [clang-tidy] NFC use CHECK-NOTES in tests for performance-move-constructor-init
Jonas Toth via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 29 07:51:33 PDT 2018
JonasToth created this revision.
JonasToth added reviewers: alexfh, aaron.ballman, hokein.
Herald added subscribers: cfe-commits, xazax.hun.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D52691
Files:
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
@@ -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,10 @@
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-NOTES: 7:1: note: FIX-IT applied suggested code changes
+ // CHECK-NOTES: 113:28: note: FIX-IT applied suggested code changes
+ // CHECK-NOTES: 113:29: note: FIX-IT applied suggested code changes
// CHECK-FIXES: Positive(Movable M) : M_(std::move(M)) {}
Movable M_;
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52691.167604.patch
Type: text/x-patch
Size: 2016 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180929/b9c83163/attachment-0001.bin>
More information about the cfe-commits
mailing list