summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-02 20:53:05 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-02 20:53:05 +0000
commite16cdb407a3f0990d365dff4f904a007ab3b9542 (patch)
tree254cc9a338f695339945030bb6aa59289a9c0f05 /clang/lib
parentcc034c787959e70e012325975af28fb55324ba73 (diff)
downloadbcm5719-llvm-e16cdb407a3f0990d365dff4f904a007ab3b9542.tar.gz
bcm5719-llvm-e16cdb407a3f0990d365dff4f904a007ab3b9542.zip
diagnose declaring class extension after its implementation
(radar 7822210). llvm-svn: 100226
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 9bc0846901a..0c47e63d99e 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud