summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/retain-release.mm
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-10-01 00:48:56 +0000
committerJohn McCall <rjmccall@apple.com>2011-10-01 00:48:56 +0000
commit525f05597f99fc16f399fd7c3bb305b8ed5166f4 (patch)
tree2e2080490f375a640a58fd5acab5cc706ea1cb71 /clang/test/Analysis/retain-release.mm
parent1ed54f50c54400c5968396b4aaa0704c0f1e3a72 (diff)
downloadbcm5719-llvm-525f05597f99fc16f399fd7c3bb305b8ed5166f4.tar.gz
bcm5719-llvm-525f05597f99fc16f399fd7c3bb305b8ed5166f4.zip
Tweak the interface for analyzing the CF conventions for a name
to take a FunctionDecl* instead of an llvm::StringRef. Eventually we might push more logic in there, like using slightly different conventions for C++ methods. Also, fix a bug where 'copy' and 'create' were being caught in non-camel-cased strings. We want copyFoo and CopyFoo and XCopy but not Xcopy or xcopy. llvm-svn: 140911
Diffstat (limited to 'clang/test/Analysis/retain-release.mm')
-rw-r--r--clang/test/Analysis/retain-release.mm10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/retain-release.mm b/clang/test/Analysis/retain-release.mm
index 7c6f9e3c4aa..bae8dc33925 100644
--- a/clang/test/Analysis/retain-release.mm
+++ b/clang/test/Analysis/retain-release.mm
@@ -304,4 +304,14 @@ void test_smartpointer_3() {
foo.noAdopt(x);
}
+extern CFStringRef ElectronMicroscopyEngage(void);
+void test_microscopy() {
+ NSString *token = (NSString*) ElectronMicroscopyEngage();
+ [token release]; // expected-warning {{object that is not owned}}
+}
+extern CFStringRef Scopy(void);
+void test_Scopy() {
+ NSString *token = (NSString*) Scopy();
+ [token release]; // expected-warning {{object that is not owned}}
+}
OpenPOWER on IntegriCloud