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/D52228
Files:
test/clang-tidy/bugprone-use-after-move.cpp
Index: test/clang-tidy/bugprone-use-after-move.cpp
===================================================================
--- test/clang-tidy/bugprone-use-after-move.cpp
+++ test/clang-tidy/bugprone-use-after-move.cpp
@@ -125,18 +125,18 @@
a.foo();
A other_a = std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:15: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:15: note: move occurred here
}
// A warning should only be emitted for one use-after-move.
void onlyFlagOneUseAfterMove() {
A a;
a.foo();
A other_a = std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:15: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:15: note: move occurred here
a.foo();
}
@@ -146,28 +146,28 @@
A a;
std::move(a);
std::move(a);
- // CHECK-MESSAGES: [[@LINE-1]]:15: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:15: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// This is also true if the move itself turns into the use on the second loop
// iteration.
{
A a;
for (int i = 0; i < 10; ++i) {
std::move(a);
- // CHECK-MESSAGES: [[@LINE-1]]:17: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:7: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:17: note: the use happens in a later loop
+ // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:17: note: the use happens in a later loop
}
}
}
// Checks also works on function parameters that have a use-after move.
void parameters(A a) {
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:3: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
}
void standardSmartPtr() {
@@ -180,38 +180,38 @@
ptr.get();
static_cast<bool>(ptr);
*ptr;
- // CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-5]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
}
{
std::unique_ptr<A> ptr;
std::move(ptr);
ptr->foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
std::unique_ptr<A> ptr;
std::move(ptr);
ptr[0];
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
std::shared_ptr<A> ptr;
std::move(ptr);
ptr.get();
static_cast<bool>(ptr);
*ptr;
- // CHECK-MESSAGES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-5]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:6: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
}
{
std::shared_ptr<A> ptr;
std::move(ptr);
ptr->foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
// std::weak_ptr<> cannot be dereferenced directly, so we only check that
@@ -252,8 +252,8 @@
} ptr;
std::move(ptr);
ptr.get();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'ptr' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
}
@@ -263,18 +263,18 @@
A a;
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
};
// We see the std::move() if it's inside a declaration.
void moveInDeclaration() {
A a;
A another_a(std::move(a));
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// We see the std::move if it's inside an initializer list. Initializer lists
@@ -290,8 +290,8 @@
A a;
S s{std::move(a)};
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
}
void lambdas() {
@@ -301,18 +301,18 @@
auto lambda = [a] {
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
};
}
// This is just as true if the variable was declared inside the lambda.
{
auto lambda = [] {
A a;
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:7: note: move occurred here
};
}
// But don't warn if the move happened inside the lambda but the use happened
@@ -331,31 +331,31 @@
A a;
std::move(a);
auto lambda = [a]() { a.foo(); };
- // CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// ...even if the capture was implicit.
{
A a;
std::move(a);
auto lambda = [=]() { a.foo(); };
- // CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// Same tests but for capture by reference.
{
A a;
std::move(a);
auto lambda = [&a]() { a.foo(); };
- // CHECK-MESSAGES: [[@LINE-1]]:21: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:21: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
A a;
std::move(a);
auto lambda = [&]() { a.foo(); };
- // CHECK-MESSAGES: [[@LINE-1]]:20: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:20: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// But don't warn if the move happened after the capture.
{
@@ -390,8 +390,8 @@
A a;
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:3: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
}
// And if the moved type is a dependent type, the use-after-move is detected if
@@ -401,8 +401,8 @@
T t;
std::move(t);
t.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 't' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:3: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 't' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
}
template void movedTypeIsDependentType<A>();
@@ -417,8 +417,8 @@
Convertible convertible;
takeA(std::move(convertible));
convertible;
- // CHECK-MESSAGES: [[@LINE-1]]:3: warning: 'convertible' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:9: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:3: warning: 'convertible' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:9: note: move occurred here
}
// Using decltype on an expression is not a use.
@@ -480,9 +480,9 @@
A a;
for (int i = 0; i < 10; ++i) {
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE+2]]:7: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:7: note: the use happens in a later loop
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE+2]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:7: note: the use happens in a later loop
std::move(a);
}
}
@@ -559,8 +559,8 @@
std::move(a);
case 2:
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-4]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-4]]:7: note: move occurred here
break;
}
}
@@ -575,8 +575,8 @@
}
if (!b) {
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-5]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-5]]:5: note: move occurred here
}
}
@@ -658,8 +658,8 @@
a = A();
std::move(a);
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// Report a use-after-move if we can't be sure that the variable was assigned
// to.
@@ -671,8 +671,8 @@
}
if (i > 5) {
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-7]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-7]]:5: note: move occurred here
}
}
}
@@ -708,14 +708,14 @@
const A a;
std::move(a);
passByConstPointer(&a);
- // CHECK-MESSAGES: [[@LINE-1]]:25: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:25: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
const A a;
std::move(a);
passByConstReference(a);
- // CHECK-MESSAGES: [[@LINE-1]]:24: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:3: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:24: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:3: note: move occurred here
}
// Clearing a standard container using clear() is treated as a
@@ -820,17 +820,17 @@
} container;
std::move(container);
container.clear();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'container' used after it was
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container' used after it was
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// An intervening clear() on a different container does not reinitialize.
{
std::vector<int> container1, container2;
std::move(container1);
container2.clear();
container1.empty();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'container1' used after it was
- // CHECK-MESSAGES: [[@LINE-4]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container1' used after it was
+ // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
}
}
@@ -875,17 +875,17 @@
} container;
std::move(container);
container.assign(0, 0);
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'container' used after it was
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container' used after it was
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
// An intervening assign() on a different container does not reinitialize.
{
std::vector<int> container1, container2;
std::move(container1);
container2.assign(0, 0);
container1.empty();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'container1' used after it was
- // CHECK-MESSAGES: [[@LINE-4]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'container1' used after it was
+ // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
}
}
@@ -912,8 +912,8 @@
AnnotatedContainer<int> obj;
std::move(obj);
obj.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'obj' used after it was
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'obj' used after it was
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
AnnotatedContainer<int> obj;
@@ -928,8 +928,8 @@
std::move(obj1);
obj2.clear();
obj1.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'obj1' used after it was
- // CHECK-MESSAGES: [[@LINE-4]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'obj1' used after it was
+ // CHECK-NOTES: [[@LINE-4]]:5: note: move occurred here
}
}
@@ -962,27 +962,27 @@
{
A a;
passByValue(a.getInt(), std::move(a));
- // CHECK-MESSAGES: [[@LINE-1]]:17: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:29: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:17: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:29: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:17: note: the use and move are unsequenced
}
{
A a;
passByValue(std::move(a), a.getInt());
- // CHECK-MESSAGES: [[@LINE-1]]:31: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:17: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:31: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-1]]:31: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:17: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:31: note: the use and move are unsequenced
}
// An even more convoluted example.
{
A a;
g(g(a, std::move(a)), g(a, std::move(a)));
- // CHECK-MESSAGES: [[@LINE-1]]:9: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:27: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:9: note: the use and move are unsequenced
- // CHECK-MESSAGES: [[@LINE-4]]:29: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-5]]:7: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-6]]:29: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-1]]:9: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:27: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:9: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-4]]:29: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-5]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-6]]:29: note: the use and move are unsequenced
}
// This case is fine because the actual move only happens inside the call to
// operator=(). a.getInt(), by necessity, is evaluated before that call.
@@ -997,17 +997,17 @@
A a;
int v[3];
v[a.getInt()] = intFromA(std::move(a));
- // CHECK-MESSAGES: [[@LINE-1]]:7: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:21: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:7: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-1]]:7: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:21: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:7: note: the use and move are unsequenced
}
{
A a;
int v[3];
v[intFromA(std::move(a))] = intFromInt(a.i);
- // CHECK-MESSAGES: [[@LINE-1]]:44: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:7: note: move occurred here
- // CHECK-MESSAGES: [[@LINE-3]]:44: note: the use and move are unsequenced
+ // CHECK-NOTES: [[@LINE-1]]:44: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:7: note: move occurred here
+ // CHECK-NOTES: [[@LINE-3]]:44: note: the use and move are unsequenced
}
}
@@ -1023,15 +1023,15 @@
A a;
passByValue(std::move(a), (a = A()));
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:17: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:17: note: move occurred here
}
{
A a;
passByValue((a = A()), std::move(a));
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:28: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:28: note: move occurred here
}
// Common usage pattern: Move the object to a function that mutates it in some
// way, then reassign the result to the object. This pattern is fine.
@@ -1053,15 +1053,15 @@
A a;
std::move(a);
passByValue(a.getInt(), (a = A()));
- // CHECK-MESSAGES: [[@LINE-1]]:17: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:17: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
{
A a;
std::move(a);
passByValue((a = A()), a.getInt());
- // CHECK-MESSAGES: [[@LINE-1]]:28: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:5: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:28: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:5: note: move occurred here
}
}
@@ -1077,8 +1077,8 @@
A a;
(a = A()), A(std::move(a));
a.foo();
- // CHECK-MESSAGES: [[@LINE-1]]:5: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-3]]:16: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:5: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-3]]:16: note: move occurred here
}
}
@@ -1099,8 +1099,8 @@
};
A a;
S2 s2{std::move(a), a.getInt()};
- // CHECK-MESSAGES: [[@LINE-1]]:25: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:11: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:25: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:11: note: move occurred here
}
}
@@ -1114,8 +1114,8 @@
{
A a;
A a1 = std::move(a), a2 = a;
- // CHECK-MESSAGES: [[@LINE-1]]:31: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:12: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:31: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:12: note: move occurred here
}
}
@@ -1138,8 +1138,8 @@
{
A a;
if (A(std::move(a)).getInt() > 0 && a.getInt() > 0) {
- // CHECK-MESSAGES: [[@LINE-1]]:41: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:9: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:41: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:9: note: move occurred here
A().foo();
}
}
@@ -1152,8 +1152,8 @@
{
A a;
if (A(std::move(a)).getInt() > 0 || a.getInt() > 0) {
- // CHECK-MESSAGES: [[@LINE-1]]:41: warning: 'a' used after it was moved
- // CHECK-MESSAGES: [[@LINE-2]]:9: note: move occurred here
+ // CHECK-NOTES: [[@LINE-1]]:41: warning: 'a' used after it was moved
+ // CHECK-NOTES: [[@LINE-2]]:9: note: move occurred here
A().foo();
}
}
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits