aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaDecl.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 51c479040b..3130f02bef 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -1592,6 +1592,11 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC,
Diag(D.getIdentifierLoc(), diag::err_as_qualified_auto_decl);
InvalidDecl = true;
}
+
+ if (NewVD->hasLocalStorage() && NewVD->getType().isObjCGCWeak()) {
+ Diag(D.getIdentifierLoc(), diag::warn_attribute_weak_on_local);
+ }
+
// Merge the decl with the existing one if appropriate. If the decl is
// in an outer scope, it isn't the same thing.
if (PrevDecl && isDeclInScope(PrevDecl, DC, S)) {