[clang] [LifetimeSafety] Track moved declarations to prevent false positives (PR #170007)
Utkarsh Saxena via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 16 12:37:39 PST 2026
================
@@ -1392,3 +1397,25 @@ void add(int c, MyObj* node) {
arr[4] = node;
}
} // namespace CppCoverage
+
+namespace do_not_warn_on_std_move {
+void silenced() {
+ MyObj b;
+ View v;
+ {
+ MyObj a;
+ v = a;
+ b = std::move(a); // No warning for 'a' being moved.
+ }
+ (void)v;
+}
+
+void silenced_flow_insensitive(bool c) {
+ MyObj a;
+ View v = a;
+ if (c) {
+ MyObj b = std::move(a);
----------------
usx95 wrote:
Done.
https://github.com/llvm/llvm-project/pull/170007
More information about the cfe-commits
mailing list