]> granicus.if.org Git - clang/commit
Suggest objc_method_family(none) for a property named -newFoo or similar.
authorJordan Rose <jordan_rose@apple.com>
Fri, 16 Jan 2015 23:04:31 +0000 (23:04 +0000)
committerJordan Rose <jordan_rose@apple.com>
Fri, 16 Jan 2015 23:04:31 +0000 (23:04 +0000)
commit34bdecd9a8f5572d75b0f70bb3b7da8913d7585c
tree8b3d1073b424e816c102c2ed16c3a935af434687
parent3f7e4c8e18953516e772ceee748f66ed7b2cb096
Suggest objc_method_family(none) for a property named -newFoo or similar.

As mentioned in the previous commit, if a property (declared with @property)
has a name that matches a special Objective-C method family, the getter picks
up that family despite being declared by the property. The most correct way
to solve this problem is to add the 'objc_method_family' attribute to the
getter with an argument of 'none', which unfortunately requires an explicit
declaration of the getter.

This commit adds a note to the existing error (ARC) or warning (MRR) for
such a poorly-named property that suggests the solution; if there's already
a declaration of the getter, it even includes a fix-it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226339 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/arc-decls.m