diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-04-04 18:45:52 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-04-04 18:45:52 +0000 |
commit | 740991bdf8bb2638ff111ae2084791c52c1cee00 (patch) | |
tree | 9792f470265fbab532786791ec0ff141f4611bf4 /lib/Sema/SemaDeclObjC.cpp | |
parent | 0cc6f59663de0f7684d4ca122b3439b07f521931 (diff) |
Objective-C: Issue deprecated warning when using a
deprecated typedef to subclass or invoke a class method.
// rdar://13569424
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178775 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 96a432a108..5c26d7ff8e 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -521,8 +521,14 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, dyn_cast_or_null<TypedefNameDecl>(PrevDecl)) { QualType T = TDecl->getUnderlyingType(); if (T->isObjCObjectType()) { - if (NamedDecl *IDecl = T->getAs<ObjCObjectType>()->getInterface()) + if (NamedDecl *IDecl = T->getAs<ObjCObjectType>()->getInterface()) { SuperClassDecl = dyn_cast<ObjCInterfaceDecl>(IDecl); + // This handles the following case: + // @interface NewI @end + // typedef NewI DeprI __attribute__((deprecated("blah"))) + // @interface SI : DeprI /* warn here */ @end + (void)DiagnoseUseOfDecl(const_cast<TypedefNameDecl*>(TDecl), SuperLoc); + } } } |