summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/MisusedMovedObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/MisusedMovedObject.cpp')
-rw-r--r--clang/test/Analysis/MisusedMovedObject.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/clang/test/Analysis/MisusedMovedObject.cpp b/clang/test/Analysis/MisusedMovedObject.cpp
index 1c6c8f4cde6..42d3608deb8 100644
--- a/clang/test/Analysis/MisusedMovedObject.cpp
+++ b/clang/test/Analysis/MisusedMovedObject.cpp
@@ -638,7 +638,10 @@ void ifStmtSequencesDeclAndConditionTest() {
}
}
-class C : public A {};
+struct C : public A {
+ [[clang::reinitializes]] void reinit();
+};
+
void subRegionMoveTest() {
{
A a;
@@ -672,6 +675,13 @@ void resetSuperClass() {
C c2 = c; // no-warning
}
+void resetSuperClass2() {
+ C c;
+ C c1 = std::move(c);
+ c.reinit();
+ C c2 = c; // no-warning
+}
+
void reportSuperClass() {
C c;
C c1 = std::move(c); // expected-note {{'c' became 'moved-from' here}}
OpenPOWER on IntegriCloud