[clang] [clang] Fix-it hint for `++this` -> `++*this` when deref is modifiable (PR #94159)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 7 08:15:54 PDT 2024


================
@@ -10,6 +10,7 @@ void h() {
   SEL* ps = &s;
 
   @selector(dealloc) = s;  // expected-error {{expression is not assignable}}
+  // expected-note at -1 {{add '*' to dereference it}}
----------------
Sirraide wrote:

Yeah, again, I unfortunately won’t be of much help with this issue in particular due to lack of Objective-C knowledge; if we can’t find a way around this then it *might* be fine to leave this as a false positive (partially depending on how common this case is), but I’d prefer it for someone who actually knows Objective-C to comment on whether that is the case.

The only thing I can think of is we can maybe work off of whatever the type of `@selector(dealloc)` is, provided that that’s anything special? 

https://github.com/llvm/llvm-project/pull/94159


More information about the cfe-commits mailing list