diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-02 20:53:05 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-04-02 20:53:05 +0000 |
commit | 24e14089cc509ff48cf7f1e6f4f9070803dd739b (patch) | |
tree | 0333e729e3806b0c82b7b8f5980a17207cea5ce5 /lib/Sema/SemaDeclObjC.cpp | |
parent | e541d01cc886e4a3c16c98ee7d9921757727adf1 (diff) |
diagnose declaring class extension after its implementation
(radar 7822210).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100226 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9bc0846901..0c47e63d99 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -431,6 +431,11 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, // Class extensions require a special treatment. Use an existing one. // Note that 'getClassExtension()' can return NULL. CDecl = IDecl->getClassExtension(); + if (IDecl->getImplementation()) { + Diag(ClassLoc, diag::err_class_extension_after_impl) << ClassName; + Diag(IDecl->getImplementation()->getLocation(), + diag::note_implementation_declared); + } } if (!CDecl) { |