Allow the cf_returns_[not_]retained attributes to appear on out-parameters.
authorDouglas Gregor <dgregor@apple.com>
Fri, 19 Jun 2015 23:17:46 +0000 (23:17 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 19 Jun 2015 23:17:46 +0000 (23:17 +0000)
commiteb6e64ca8fd72725153fc25914f94a771d9c8572
treed2722fd8b182c767f33ef4e5dfd4b4b1db8c6a40
parent74ecc89c464a858f261ec279dd202dfafa476d7d
Allow the cf_returns_[not_]retained attributes to appear on out-parameters.

Includes a simple static analyzer check and not much else, but we'll also
be able to take advantage of this in Swift.

This feature can be tested for using __has_feature(cf_returns_on_parameters).

This commit also contains two fixes:
- Look through non-typedef sugar when deciding whether something is a CF type.
- When (cf|ns)_returns(_not)?_retained is applied to invalid properties,
  refer to "property" instead of "method" in the error message.

rdar://problem/18742441

llvm-svn: 240185
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/StaticAnalyzer/Checkers/ObjCRetainCount.h
clang/lib/Analysis/CocoaConventions.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp
clang/test/Analysis/retain-release.m
clang/test/SemaObjC/attr-cf_returns.m [new file with mode: 0644]