[PATCH] D120372: [clang] 'unused-but-set-variable' warning should not apply to __attribute__((objc_precise_lifetime) Objective-C pointers

Stephane Moore via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 22 17:24:59 PST 2022


stephanemoore accepted this revision.
stephanemoore added a comment.
This revision is now accepted and ready to land.

Make sense to me.

I don't know offhand who might be a good second pair of eyes to take a look.



================
Comment at: clang/test/SemaObjC/objc-precise-lifetime-unused-variable.m:6-8
+  // no diagnostics for objects with precise lifetime semantics.
+  __attribute__((objc_precise_lifetime)) id x;
+  x = getFoo();
----------------
Is it worth adding some cases with nested scopes? I think that's a common scenario where `objc_precise_lifetime` is often used?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120372/new/

https://reviews.llvm.org/D120372



More information about the cfe-commits mailing list