]> granicus.if.org Git - clang/commitdiff
When name lookup finds a module-private Objective-C class declaration,
authorDouglas Gregor <dgregor@apple.com>
Thu, 15 Dec 2011 20:36:27 +0000 (20:36 +0000)
committerDouglas Gregor <dgregor@apple.com>
Thu, 15 Dec 2011 20:36:27 +0000 (20:36 +0000)
check whether any previous declarations of the class were visible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146680 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaLookup.cpp
test/Modules/decldef.mm

index a6ad8f8fcf520ecad7f4738c953aec859aa28678..a1713ee6850179f53f21ae167332feb254248430 100644 (file)
@@ -1063,6 +1063,8 @@ static NamedDecl *getPreviousDeclaration(NamedDecl *D) {
     return FD->getPreviousDeclaration();
   if (RedeclarableTemplateDecl *RTD = dyn_cast<RedeclarableTemplateDecl>(D))
     return RTD->getPreviousDeclaration();
+  if (ObjCInterfaceDecl *ID = dyn_cast<ObjCInterfaceDecl>(D))
+    return ID->getPreviousDeclaration();
   
   return 0;
 }
index bbdcd9cb8fac35b2b61cbbfef48be9edf861a244..3d24a0ef533f063a9ec2044d07e5372e484d2439 100644 (file)
@@ -7,9 +7,7 @@ B *b1; // expected-error{{unknown type name 'B'}}
 
 __import_module__ decldef.Decl;
 
-// FIXME: No link between @interface (which we can't see) and @class
-// (which we can).
-// A *a2;
+A *a2;
 B *b;
 
 void testB() {