diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-10 01:22:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-10 01:22:52 +0000 |
commit | 9aab9c4116bb3ea876d92d4af10bff7f4c451f24 (patch) | |
tree | 3409c2bc98b5643b03cc15109e9ba09a7abf7219 /lib/Sema/SemaDeclObjC.cpp | |
parent | ee19f43bf8973bfcccb7329e32a4198641767949 (diff) |
Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 0fd3b25def..8dd484a3b5 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -2911,6 +2911,10 @@ VarDecl *Sema::BuildObjCExceptionDecl(TypeSourceInfo *TInfo, QualType T, T, TInfo, SC_None, SC_None); New->setExceptionVariable(true); + // In ARC, infer 'retaining' for variables of retainable type. + if (getLangOptions().ObjCAutoRefCount && inferObjCARCLifetime(New)) + Invalid = true; + if (Invalid) New->setInvalidDecl(); return New; |