summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/arc-templates.mm
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2014-01-02 19:42:02 +0000
committerDouglas Gregor <dgregor@apple.com>2014-01-02 19:42:02 +0000
commitfb2ed8374bea0765e4fbbcc6f22ccde4a23aee5b (patch)
tree2305f25e9dddb7ca8c275caccc2a7e7436540b60 /test/SemaObjCXX/arc-templates.mm
parent231eb81681d0b8b8b841c820d694f79b5d6b865f (diff)
downloadclang-fb2ed8374bea0765e4fbbcc6f22ccde4a23aee5b.tar.gz
clang-fb2ed8374bea0765e4fbbcc6f22ccde4a23aee5b.tar.bz2
clang-fb2ed8374bea0765e4fbbcc6f22ccde4a23aee5b.tar.xz
Objective-C ARC++: Prefer references to __strong/__weak over __unsafe_unretained.
Fixes <rdar://problem/15713945>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198343 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaObjCXX/arc-templates.mm')
-rw-r--r--test/SemaObjCXX/arc-templates.mm16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/SemaObjCXX/arc-templates.mm b/test/SemaObjCXX/arc-templates.mm
index b3519b9573..ebede6404f 100644
--- a/test/SemaObjCXX/arc-templates.mm
+++ b/test/SemaObjCXX/arc-templates.mm
@@ -302,3 +302,19 @@ namespace rdar14467941 {
float &fr2 = takePtr<A>(a);
}
}
+
+namespace rdar15713945 {
+ template <class T> int &f(__strong T &);
+ template <class T> float &f(__weak T &);
+ template <class T> double &f(__unsafe_unretained T &);
+ template <class T> char &f(T &);
+
+ void foo() {
+ __strong NSString * const strong = 0;
+ int &ir = (f)(strong);
+ __weak NSString * const weak = 0;
+ float &fr = (f)(weak);
+ __unsafe_unretained NSString * const unsafe = 0;
+ double &dr = (f)(unsafe);
+ }
+}