[PATCH] D23003: [ObjC Availability] Warn upon unguarded use of partially available declaration
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 10 13:29:58 PDT 2016
erik.pilkington updated this revision to Diff 67582.
erik.pilkington added a comment.
This new patch rebases on top of r277887, and addresses Manman's comments.
After looking through the AST nodes, I realized I neglected to emit a diagnostic for member expressions. I also noticed that function parameters are not being handled correctly. For example:
int f(introduced_in_10_12_t x) __attribute__((availability(macos, introduced=10.12)));
Triggers `-Wunguarded-availability`, which is clearly incorrect. I think the fix here is just to delay the diagnostic until we know the context availability. This isn't really related to this patch, so I'll fix it in a follow up.
Outside of that I can't think of any cases of referencing a declaration in a function body that we're missing.
Thanks!
https://reviews.llvm.org/D23003
Files:
include/clang/AST/Stmt.h
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/ScopeInfo.h
include/clang/Sema/Sema.h
lib/AST/Stmt.cpp
lib/Sema/JumpDiagnostics.cpp
lib/Sema/ScopeInfo.cpp
lib/Sema/SemaDecl.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaStmt.cpp
test/Parser/objc-available.m
test/Sema/attr-availability.c
test/SemaObjC/attr-availability.m
test/SemaObjC/property-deprecated-warning.m
test/SemaObjC/unguarded-availability.m
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23003.67582.patch
Type: text/x-patch
Size: 33609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160810/1c9bcbf7/attachment-0001.bin>
More information about the cfe-commits
mailing list