diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-18 17:58:27 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-18 17:58:27 +0000 |
commit | ed628cca733aa241db03b7ee3e59e629e38b1cd4 (patch) | |
tree | efbb6328788578054d5b47686c928b2aab6ea8bd /lib/Sema/SemaExpr.cpp | |
parent | 4cf1dbe05e12087cd7f6a64212d3af48582cf320 (diff) | |
download | clang-ed628cca733aa241db03b7ee3e59e629e38b1cd4.tar.gz clang-ed628cca733aa241db03b7ee3e59e629e38b1cd4.tar.bz2 clang-ed628cca733aa241db03b7ee3e59e629e38b1cd4.tar.xz |
Objective-C. Attributes on class declarations carry over
to forward class declarations for diagnosis.
// rdar://16681279
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 0e1aadefe7..4b4cb6c7c0 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -87,6 +87,12 @@ static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S, bool ObjCPropertyAccess) { // See if this declaration is unavailable or deprecated. std::string Message; + + // Forward class declarations get their attributes from their definition. + if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(D)) { + if (IDecl->getDefinition()) + D = IDecl->getDefinition(); + } AvailabilityResult Result = D->getAvailability(&Message); if (const EnumConstantDecl *ECD = dyn_cast<EnumConstantDecl>(D)) if (Result == AR_Available) { |