diff options
author | Ted Kremenek <kremenek@apple.com> | 2012-10-02 05:36:02 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2012-10-02 05:36:02 +0000 |
commit | 3ba17ee280d58bf702eb3836c119bab42dcbb9c8 (patch) | |
tree | c6f32d211ed67995dd115804a344c9a8a0eba0b2 /lib/Sema/SemaDecl.cpp | |
parent | be9af1288881110e406b87914162eaa59f1e5918 (diff) |
Tweak diagnostic text to indicate that __weak on a local variable is only allowed
for ARC. Fixes <rdar://problem/12407705>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 4382432a6f..ddb41edc64 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4578,8 +4578,10 @@ bool Sema::CheckVariableDeclaration(VarDecl *NewVD, && !NewVD->hasAttr<BlocksAttr>()) { if (getLangOpts().getGC() != LangOptions::NonGC) Diag(NewVD->getLocation(), diag::warn_gc_attribute_weak_on_local); - else + else { + assert(!getLangOpts().ObjCAutoRefCount); Diag(NewVD->getLocation(), diag::warn_attribute_weak_on_local); + } } bool isVM = T->isVariablyModifiedType(); |