[ObjC] Warn on unguarded use of partial declaration
authorErik Pilkington <erik.pilkington@gmail.com>
Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Tue, 16 Aug 2016 17:44:11 +0000 (17:44 +0000)
commit5cd57177a51abc7b0bfe18f70566572dbccab9a0
tree37e54d241289b11708d39bd977a59b43c3a31e42
parentc98ef718eab85e44701a23f63c1e69eb6e43cc51
[ObjC] Warn on unguarded use of partial declaration

This commit adds a traversal of the AST after Sema of a function that diagnoses
unguarded references to declarations that are partially available (based on
availability attributes). This traversal is only done when we would otherwise
emit -Wpartial-availability.

This commit is part of a feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

Differential revision: https://reviews.llvm.org/D23003

llvm-svn: 278826
17 files changed:
clang/include/clang/AST/Stmt.h
clang/include/clang/Basic/DiagnosticGroups.td
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Sema/ScopeInfo.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/Stmt.cpp
clang/lib/Sema/JumpDiagnostics.cpp
clang/lib/Sema/ScopeInfo.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaExpr.cpp
clang/lib/Sema/SemaStmt.cpp
clang/test/Parser/objc-available.m
clang/test/Sema/attr-availability.c
clang/test/SemaObjC/attr-availability.m
clang/test/SemaObjC/property-deprecated-warning.m
clang/test/SemaObjC/unguarded-availability.m [new file with mode: 0644]