aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-06-23 23:16:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-06-23 23:16:19 +0000
commita81397323cc8475ef8243f938118a9c231fb18ff (patch)
tree0e9a4f473d1baef164dcc3e31763568112835cb8 /lib/Sema/SemaDeclObjC.cpp
parent89b29d14bc718750d88f0846d4410910134020dd (diff)
When forming a cycle in objc's inheritance hierarchy,
diagnose it properly and don't throw clang into an infinit loop. // rdar://9653341 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133773 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index b54e2425b2..3bbe421cd1 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -491,10 +491,13 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc,
if (!SuperClassDecl)
Diag(SuperLoc, diag::err_undef_superclass)
<< SuperName << ClassName << SourceRange(AtInterfaceLoc, ClassLoc);
- else if (SuperClassDecl->isForwardDecl())
- Diag(SuperLoc, diag::err_undef_superclass)
+ else if (SuperClassDecl->isForwardDecl()) {
+ Diag(SuperLoc, diag::err_forward_superclass)
<< SuperClassDecl->getDeclName() << ClassName
<< SourceRange(AtInterfaceLoc, ClassLoc);
+ Diag(SuperClassDecl->getLocation(), diag::note_forward_class);
+ SuperClassDecl = 0;
+ }
}
IDecl->setSuperClass(SuperClassDecl);
IDecl->setSuperClassLoc(SuperLoc);