summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-06-18 17:58:27 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-06-18 17:58:27 +0000
commit285b6b658531e257d0f495111939777e3dc74348 (patch)
tree13e000557c02d777e66e2985760fb0d4beddebfb /clang/lib/Sema/SemaExpr.cpp
parent85f0dbce5c74e46ff8f31353717faaf3ac58ab9e (diff)
downloadbcm5719-llvm-285b6b658531e257d0f495111939777e3dc74348.tar.gz
bcm5719-llvm-285b6b658531e257d0f495111939777e3dc74348.zip
Objective-C. Attributes on class declarations carry over
to forward class declarations for diagnosis. // rdar://16681279 llvm-svn: 211195
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 0e1aadefe73..4b4cb6c7c0d 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud