summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commit3ee91fad906363c4f65d6e15ed4808c23972593c (patch)
treede2bf6ba37414384e32df1ff0a5fb406899de50d /clang/lib/Sema
parent9d2f340249aa88346794a90b11224ed4b46c00e3 (diff)
downloadbcm5719-llvm-3ee91fad906363c4f65d6e15ed4808c23972593c.tar.gz
bcm5719-llvm-3ee91fad906363c4f65d6e15ed4808c23972593c.zip
When forming a cycle in objc's inheritance hierarchy,
diagnose it properly and don't throw clang into an infinit loop. // rdar://9653341 llvm-svn: 133773
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index b54e2425b2c..3bbe421cd14 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud