[LLVMbugs] [Bug 12992] New: Xcode "Fix-It" should prefer property over ivar as suggestion

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed May 30 15:46:47 PDT 2012


             Bug #: 12992
           Summary: Xcode "Fix-It" should prefer property over ivar as
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Static Analyzer
        AssignedTo: kremenek at apple.com
        ReportedBy: paul at corporationunknown.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 8662
  --> http://llvm.org/bugs/attachment.cgi?id=8662
Screenshot of Xcode's suggestion

I have filed this against Xcode as rdar://11560792 but I imagine it needs
llvm/clang support to fully implement so I'm adding it here as well.

Xcode 4.3.2 (4E2002) (LLVM 3.1)


When correcting a "bare property" typo for a property with a renamed backing
ivar, the "Fix-It" recommendation should prefer invoking the getter/setter of
the property, instead of recommending the backing ivar (which it currently

Steps to Reproduce: 

1. Create a class with a property.
2. Synthesize that property with a renamed backing ivar, such as "@synthesize
example = _example;"
3. Mistype the property without "self." later in the code, such "example = nil"

Expected Results:

The "Fix-It" popup from the compiler error should promote best practice of
using the "self.example" property accessor.

Actual Results:

The "Fix-It" popup suggests using "_example", using direct ivar access. I have
renamed the ivar explicitly to avoid directly accessing it outside of specific

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list