diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-02-16 21:33:09 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-02-16 21:33:09 +0000 |
| commit | e404d0ba05acd3246eef0ee08b2787f967fe1f68 (patch) | |
| tree | 0df9091a4118d476a602d64ff6e8097e6ccaa62d /clang/lib/Sema/SemaDeclObjC.cpp | |
| parent | ced903b793c1561fad92318f128461fd301e010e (diff) | |
| download | bcm5719-llvm-e404d0ba05acd3246eef0ee08b2787f967fe1f68.tar.gz bcm5719-llvm-e404d0ba05acd3246eef0ee08b2787f967fe1f68.zip | |
warn about interfaces that inherit from deprecated classes.
llvm-svn: 64671
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index c3789508e14..b82c50a4b50 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -108,6 +108,11 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, ObjCInterfaceDecl *SuperClassDecl = dyn_cast_or_null<ObjCInterfaceDecl>(PrevDecl); + + // Diagnose classes that inherit from deprecated classes. + if (SuperClassDecl) + DiagnoseUseOfDeprecatedDeclImpl(SuperClassDecl, SuperLoc); + if (PrevDecl && SuperClassDecl == 0) { // The previous declaration was not a class decl. Check if we have a // typedef. If we do, get the underlying class type. @@ -118,6 +123,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, SuperClassDecl = dyn_cast<ObjCInterfaceDecl>(IDecl); } } + // This handles the following case: // // typedef int SuperClass; @@ -128,6 +134,7 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, Diag(PrevDecl->getLocation(), diag::note_previous_definition); } } + if (!dyn_cast_or_null<TypedefDecl>(PrevDecl)) { if (!SuperClassDecl) Diag(SuperLoc, diag::err_undef_superclass) |

